We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 70f4efb commit c449469Copy full SHA for c449469
ql/ql/src/queries/style/FieldOnlyUsedInCharPred.ql
@@ -0,0 +1,21 @@
1
+/**
2
+ * @name Field only used in CharPred
3
+ * @description A field only being used in the charpred suggests that the field should be inlined into the charpred.
4
+ * @kind problem
5
+ * @problem.severity recommendation
6
+ * @id ql/field-only-used-in-charpred
7
+ * @tags correctness
8
+ * @precision very-high
9
+ */
10
+
11
+import ql
12
13
+from Class c, FieldDecl f
14
+where
15
+ c.getAField() = f and
16
+ forex(FieldAccess access | access.getDeclaration() = f.getVarDecl() |
17
+ access.getEnclosingPredicate() = c.getCharPred()
18
+ ) and
19
+ not f.getVarDecl().overrides(_) and
20
+ f.getLocation().getFile().getAbsolutePath().matches("%/javascript/%")
21
+select f, "Field is only used in CharPred"
0 commit comments