CodeQL library for Python
codeql/python-all 2.2.0 (changelog, source)
Search

Class Test

Import path

import semmle.python.filters.Tests

Direct supertypes

Indirect supertypes

Known direct subtypes

Inherited predicates

containsfrom Scope
containsInScope

Whether this contains inner syntactically and inner has the same scope as this

from Scope
getANormalExit

Gets an exit from this Scope’s control flow graph, that does not result from an exception

from Scope
getAStmt

Gets a top-level statement in this scope

from Scope
getAnExitNode

Gets an exit from this Scope’s control flow graph

from Scope
getBody

Gets the statements forming the body of this scope

from Scope
getDocString

Gets the docstring for this scope

from Scope
getEnclosingModulefrom Scope
getEnclosingScope

Gets the scope enclosing this scope (modules have no enclosing scope)

from Scope
getEntryNode

Gets the entry point into this Scope’s control flow graph

from Scope
getEvaluatingScope

Gets the evaluation scope for code in this (lexical) scope. This is usually the scope itself, but may be an enclosing scope. Notably, for list comprehensions in Python 2.

from Scope
getFallthroughNode

Gets the non-explicit exit from this Scope’s control flow graph

from Scope
getLastStatementfrom Scope
getLocationfrom Scope
getName

Gets the name of this scope

from Scope
getReturnNode

Gets the exit of this scope following from a return statement

from Scope
getScope

Gets the scope enclosing this scope (modules have no enclosing scope).

from Scope
getStmt

Gets the nth statement of this scope

from Scope
inSource

Holds if this scope is in the source archive, that is it is part of the code specified, not library code

from Scope
isPublic

Holds if this scope is deemed to be public

from Scope
isTopLevel

Holds if this a top-level (non-nested) class or function

from Scope
precedes

Holds if this scope can be expected to execute before other. Modules precede functions and methods in those modules __init__ precedes other methods. __enter__ precedes __exit__. NOTE that this is context-insensitive, so a module “precedes” a function in that module, even if that function is called from the module scope.

from Scope
toString

Gets a textual representation of this element.

from Scope_