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 3d3c687Copy full SHA for 3d3c687
ql/ql/src/queries/style/FieldOnlyUsedInCharPred.ql
@@ -0,0 +1,20 @@
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 maintainability
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(_)
20
+select f, "Field is only used in CharPred"
0 commit comments