Skip to content

Commit dec57ed

Browse files
committed
Statements: Improve var naming and alert message.
1 parent 715aa8d commit dec57ed

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* `M6-4-4` - alert message updated for clarity.

cpp/common/src/codingstandards/cpp/rules/nestedlabelinswitch/NestedLabelInSwitch.qll

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ abstract class NestedLabelInSwitchSharedQuery extends Query { }
1111
Query getQuery() { result instanceof NestedLabelInSwitchSharedQuery }
1212

1313
query predicate problems(
14-
SwitchCase nestedCase, string message, SwitchCase case, string caseLabel, SwitchStmt switch,
14+
SwitchCase case, string message, SwitchCase caseLocation, string caseLabel, SwitchStmt switch,
1515
string switchLabel
1616
) {
17-
not isExcluded(nestedCase, getQuery()) and
18-
switch.getASwitchCase() = case and
19-
not nestedCase.getParentStmt() = switch.getChildStmt() and
20-
nestedCase = case and
17+
not isExcluded(case, getQuery()) and
18+
switch.getASwitchCase() = caseLocation and
19+
not case.getParentStmt() = switch.getChildStmt() and
20+
case = caseLocation and
2121
message =
22-
"The switch $@ does not appear at the outermost level of the compound statement forming the body of the $@ statement." and
23-
caseLabel = nestedCase.toString() and
22+
"The case $@ does not appear at the outermost level of the compound statement forming the body of the $@ statement." and
23+
caseLabel = case.toString() and
2424
switchLabel = switch.toString()
2525
}

0 commit comments

Comments
 (0)