Skip to content

Commit 5478d33

Browse files
Query format
1 parent b806d05 commit 5478d33

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

Diff for: cpp/autosar/src/rules/A1-1-2/CompilerWarningLevelNotInCompliance.ql

+6-12
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ predicate hasResponseFileArgument(Compilation c) { c.getAnArgument().matches("@%
2323
class CompilationArgument extends string {
2424
Compilation compilation;
2525

26-
CompilationArgument() {
27-
this = compilation.getAnArgument()
28-
}
26+
CompilationArgument() { this = compilation.getAnArgument() }
2927
}
3028

3129
/**
@@ -35,13 +33,11 @@ class EnableWarningFlag extends CompilationArgument {
3533
string warningType;
3634

3735
EnableWarningFlag() {
38-
warningType = regexpCapture("^-W([\\w-]+)(=.*)?$", 1)
39-
and not this instanceof DisableWarningFlag
36+
warningType = regexpCapture("^-W([\\w-]+)(=.*)?$", 1) and
37+
not this instanceof DisableWarningFlag
4038
}
4139

42-
string getWarningType() {
43-
result = warningType
44-
}
40+
string getWarningType() { result = warningType }
4541
}
4642

4743
/**
@@ -56,13 +52,11 @@ class DisableWarningFlag extends CompilationArgument {
5652
warningType = regexpCapture("^-W([\\w-]+)=0", 1)
5753
}
5854

59-
string getWarningType() {
60-
result = warningType
61-
}
55+
string getWarningType() { result = warningType }
6256
}
6357

6458
predicate hasEnabledWarning(Compilation c) {
65-
exists(EnableWarningFlag enableFlag |
59+
exists(EnableWarningFlag enableFlag |
6660
c.getAnArgument() = enableFlag and
6761
not exists(DisableWarningFlag disableFlag |
6862
c.getAnArgument() = disableFlag and

0 commit comments

Comments
 (0)