CodeQL queries 1.23

Skip to end of metadata
Go to start of metadata

Find accesses to "private" attributes (those starting with an underscore)

import python

predicate is_private(Attribute a) {
    a.getName().matches("\\_%") and 
    not a.getName().matches("\\_\\_%\\_\\_")
}

from Attribute access
where is_private(access) and
not access.getObject().(Name).getId() = "self"
select access