Skip to content

Commit 98c7610

Browse files
committed
Fix query formatting.
1 parent 61d4ba3 commit 98c7610

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

cpp/autosar/src/rules/A7-1-7/IdentifierDeclarationAndInitializationNotOnSeparateLines.ql

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,28 @@ import codingstandards.cpp.autosar
1919
class UniqueLineStmt extends Locatable {
2020
UniqueLineStmt() {
2121
not isAffectedByMacro() and
22-
(exists(Declaration d |
23-
this = d.getADeclarationEntry() and
24-
not d instanceof Parameter and
25-
not d instanceof TemplateParameter and
26-
// TODO - Needs to be enhanced to solve issues with
27-
// templated inner classes.
28-
not d instanceof Function and
29-
not d.isFromTemplateInstantiation(_) and
30-
not d.(Variable).isCompilerGenerated() and
31-
not exists(RangeBasedForStmt f | f.getADeclaration() = d) and
32-
not exists(DeclStmt declStmt, ForStmt f |
33-
f.getInitialization() = declStmt and
34-
declStmt.getADeclaration() = d
35-
) and
36-
not exists(LambdaCapture lc | lc.getField().getADeclarationEntry() = this)
22+
(
23+
exists(Declaration d |
24+
this = d.getADeclarationEntry() and
25+
not d instanceof Parameter and
26+
not d instanceof TemplateParameter and
27+
// TODO - Needs to be enhanced to solve issues with
28+
// templated inner classes.
29+
not d instanceof Function and
30+
not d.isFromTemplateInstantiation(_) and
31+
not d.(Variable).isCompilerGenerated() and
32+
not exists(RangeBasedForStmt f | f.getADeclaration() = d) and
33+
not exists(DeclStmt declStmt, ForStmt f |
34+
f.getInitialization() = declStmt and
35+
declStmt.getADeclaration() = d
36+
) and
37+
not exists(LambdaCapture lc | lc.getField().getADeclarationEntry() = this)
38+
)
39+
or
40+
this instanceof ExprStmt and
41+
not exists(ForStmt f | f.getInitialization().getAChild*() = this) and
42+
not exists(LambdaExpression l | l.getLambdaFunction().getBlock().getAChild*() = this)
3743
)
38-
or
39-
this instanceof ExprStmt and
40-
not exists(ForStmt f | f.getInitialization().getAChild*() = this) and
41-
not exists(LambdaExpression l | l.getLambdaFunction().getBlock().getAChild*() = this))
4244
}
4345
}
4446

0 commit comments

Comments
 (0)