Commit 1500a413 authored by Roxane Kang Maréchal's avatar Roxane Kang Maréchal
Browse files

Modified comments

parent 0934211a
......@@ -2036,7 +2036,7 @@ helper def: numberFieldsInClasse(s:java!ClassDeclaration) : Integer =
-- Return the number of FieldDeclaration in a class.
s.bodyDeclarations-> select(r | r.oclIsTypeOf(java!FieldDeclaration))->size();
--- Returns the number of breaks/return/continue/throw of the switch statement passed in parameter
--- Returns the number of break/return/continue/throw statements of the switch statement passed in parameter
helper def: nbBreakStatementOfASwitchStatement(ss:java!SwitchStatement) : Integer =
ss.statements->select(each |
each.oclIsTypeOf(java!BreakStatement) or
......
......@@ -2,14 +2,14 @@ library errorProne;
---------------------------------- Missing break in switch---------------------------------------------
--- Returns a set of measures for every switch statement without break or return statements for each case option
--- Returns a set of measures for every switch statement without a break statement for each case option
helper def: missingBreakInSwitch(): Set(smm!Measure) =
java!SwitchStatement.allInstances()
-> select (switchStatement | thisModule.switchStatementContainsMissingBreaks(switchStatement))
-> collect (switchStatement | thisModule.MeasureMissingBreakInSwitch(switchStatement))
;
--- Returns true if the switch statement contains missing breaks or return, false otherwise
--- Returns true if the switch statement contains missing breaks, false otherwise
helper def: switchStatementContainsMissingBreaks(ss: java!SwitchStatement): Boolean =
-- If the number of switch cases (omitting those that empty => indicates intentional fallout) is bigger than
-- the number of break statements => we don't have a break statement for every switch case
......
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