File tree Expand file tree Collapse file tree 2 files changed +21
-19
lines changed
Expand file tree Collapse file tree 2 files changed +21
-19
lines changed Original file line number Diff line number Diff line change 1+ import ql
2+
3+ MemberCall explicitThisCallInFile ( File f ) {
4+ result .getLocation ( ) .getFile ( ) = f and
5+ result .getBase ( ) instanceof ThisAccess and
6+ // Exclude `this.(Type).whatever(...)`, as some files have that as their only instance of `this`.
7+ not result = any ( InlineCast c ) .getBase ( )
8+ }
9+
10+ PredicateCall implicitThisCallInFile ( File f ) {
11+ result .getLocation ( ) .getFile ( ) = f and
12+ exists ( result .getTarget ( ) .getDeclaringType ( ) .getASuperType ( ) ) and
13+ // Exclude `SomeModule::whatever(...)`
14+ not exists ( result .getQualifier ( ) )
15+ }
16+
17+ PredicateCall confusingImplicitThisCall ( File f ) {
18+ result = implicitThisCallInFile ( f ) and
19+ exists ( explicitThisCallInFile ( f ) )
20+ }
Original file line number Diff line number Diff line change 99 */
1010
1111import ql
12-
13- MemberCall explicitThisCallInFile ( File f ) {
14- result .getLocation ( ) .getFile ( ) = f and
15- result .getBase ( ) instanceof ThisAccess and
16- // Exclude `this.(Type).whatever(...)`, as some files have that as their only instance of `this`.
17- not result = any ( InlineCast c ) .getBase ( )
18- }
19-
20- PredicateCall implicitThisCallInFile ( File f ) {
21- result .getLocation ( ) .getFile ( ) = f and
22- exists ( result .getTarget ( ) .getDeclaringType ( ) .getASuperType ( ) ) and
23- // Exclude `SomeModule::whatever(...)`
24- not exists ( result .getQualifier ( ) )
25- }
26-
27- PredicateCall confusingImplicitThisCall ( File f ) {
28- result = implicitThisCallInFile ( f ) and
29- exists ( explicitThisCallInFile ( f ) )
30- }
12+ import codeql_ql.style.ImplicitThisQuery
3113
3214from PredicateCall c
3315where c = confusingImplicitThisCall ( _)
You can’t perform that action at this time.
0 commit comments