Exclude .kt files from java/complex-boolean-expression

This commit is contained in:
Tamas Vajk
2022-11-16 09:38:39 +01:00
parent de833d620e
commit ac85d2eb3e
2 changed files with 12 additions and 10 deletions

View File

@@ -92,13 +92,16 @@ class ComparisonOrEquality extends BinaryExpr {
from Expr e, string pattern, string rewrite
where
e.(BoolCompare).simplify(pattern, rewrite)
or
conditionalWithBool(e, pattern, rewrite)
or
e.(LogNotExpr).getExpr().(ComparisonOrEquality).negate(pattern, rewrite)
or
e.(LogNotExpr).getExpr() instanceof LogNotExpr and
pattern = "!!A" and
rewrite = "A"
e.getFile().isJavaSourceFile() and
(
e.(BoolCompare).simplify(pattern, rewrite)
or
conditionalWithBool(e, pattern, rewrite)
or
e.(LogNotExpr).getExpr().(ComparisonOrEquality).negate(pattern, rewrite)
or
e.(LogNotExpr).getExpr() instanceof LogNotExpr and
pattern = "!!A" and
rewrite = "A"
)
select e, "Expressions of the form \"" + pattern + "\" can be simplified to \"" + rewrite + "\"."

View File

@@ -1 +0,0 @@
| SimplifyBoolExpr.kt:8:8:8:16 | ... (value equals) ... | Expressions of the form "A == true" can be simplified to "A". |