Skip to content

Commit d296256

Browse files
committed
QL: Exclude overridden fields from FieldOnlyUsedInCharPred.ql
1 parent 12c810c commit d296256

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ql/ql/src/queries/style/FieldOnlyUsedInCharPred.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ where
2121
any(PredicateCall call |
2222
call.getEnclosingPredicate() = c.getCharPred() and call.getTarget() instanceof NewTypeBranch
2323
).getAnArgument() and
24-
not f.getVarDecl().overrides(_)
24+
not f.getVarDecl().overrides(_) and
25+
not any(FieldDecl other).getVarDecl().overrides(f.getVarDecl())
2526
select f, "Field is only used in CharPred."
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
| FieldOnlyUsedInCharPred.qll:2:3:2:12 | FieldDecl | Field is only used in CharPred. |
2-
| FieldOnlyUsedInCharPred.qll:22:3:22:11 | FieldDecl | Field is only used in CharPred. |

0 commit comments

Comments
 (0)