File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
cpp/ql/src/Best Practices/Unused Entities Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 13
13
14
14
import cpp
15
15
16
+ predicate possiblyIncompleteFile ( File f ) {
17
+ exists ( Diagnostic d | d .getFile ( ) = f and d .getSeverity ( ) >= 3 )
18
+ or
19
+ exists ( ErrorExpr ee | ee .getFile ( ) = f )
20
+ }
21
+
16
22
predicate immediatelyReachableFunction ( Function f ) {
17
23
not f .isStatic ( )
18
24
or
@@ -33,9 +39,7 @@ predicate immediatelyReachableFunction(Function f) {
33
39
f .getAnAttribute ( ) .hasName ( "unused" )
34
40
or
35
41
// a compiler error in the same file suggests we may be missing data
36
- exists ( Diagnostic d | d .getFile ( ) = f .getFile ( ) and d .getSeverity ( ) >= 3 )
37
- or
38
- exists ( ErrorExpr ee | ee .getFile ( ) = f .getFile ( ) )
42
+ possiblyIncompleteFile ( f .getFile ( ) )
39
43
}
40
44
41
45
predicate immediatelyReachableVariable ( Variable v ) {
You can’t perform that action at this time.
0 commit comments