Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 678e433

Browse files
committed
update cpp/missing-case-in-switch to match java
1 parent ea2777f commit 678e433

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

cpp/ql/src/Likely Bugs/Likely Typos/MissingEnumCaseInSwitch.ql

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313

1414
import cpp
1515

16-
from EnumSwitch es, float missing, float total
16+
from EnumSwitch es, float missing, float total, EnumConstant case
1717
where
1818
not es.hasDefaultCase() and
1919
missing = count(es.getAMissingCase()) and
2020
total = missing + count(es.getASwitchCase()) and
21-
missing / total < 0.3
22-
select es, "Switch statement is missing case for " + es.getAMissingCase().getName()
21+
missing / total < 0.3 and
22+
case = es.getAMissingCase()
23+
select es, "Switch statement does not have a case for $@.", case, case.getName()

0 commit comments

Comments
 (0)