Files
codeql/csharp/ql/test/library-tests/expressions/PropertyAccess1.ql
2018-12-20 10:19:59 +01:00

16 lines
382 B
Plaintext

/**
* @name Test for property access
*/
import csharp
from Method m, PropertyAccess e
where
m.hasName("Bar") and
e.getEnclosingCallable() = m and
e.getTarget().getName() = "Length" and
e.getTarget().getDeclaringType() instanceof StringType and
e.getQualifier().(ParameterAccess).getTarget().getName() = "s" and
e.getEnclosingStmt() instanceof ReturnStmt
select m, e