Commit 0934211a authored by Roxane Kang Maréchal's avatar Roxane Kang Maréchal
Browse files

Added case where there is continue statement in input file and also handling in analysis.atl

parent 1193718f
This diff is collapsed.
......@@ -175,8 +175,7 @@ rule MeasureMissingBreakInSwitch(ss: java!SwitchStatement) {
measurement: smm!DirectMeasurement (
error <- 'Missing breaks in Switch in Class : ' + ss.originalCompilationUnit.name + '',
-- Indicates the number of breaks missing in the switch statement
-- value <- (thisModule.nbBranchesOfASwitchStatement(ss) - thisModule.nbIntentionalFallThroughOfASwitchStatement(ss)) - thisModule.nbBreakStatementOfASwitchStatement(ss)
value <- thisModule.nbEmptySwitchCasesOfASwitchStatement(ss)
value <- (thisModule.nbBranchesOfASwitchStatement(ss) - thisModule.nbEmptySwitchCasesOfASwitchStatement(ss)) - thisModule.nbBreakStatementOfASwitchStatement(ss)
)
do {
missingBreakInSwitch;
......@@ -2042,7 +2041,8 @@ helper def: nbBreakStatementOfASwitchStatement(ss:java!SwitchStatement) : Intege
ss.statements->select(each |
each.oclIsTypeOf(java!BreakStatement) or
each.oclIsTypeOf(java!ReturnStatement) or
each.oclIsTypeOf(java!ThrowStatement)
each.oclIsTypeOf(java!ThrowStatement) or
each.oclIsTypeOf(java!ContinueStatement)
).size()
;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment