Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Roxane MARECHAL
Source Code Analyzer
Commits
1500a413
Commit
1500a413
authored
Dec 22, 2019
by
Roxane Kang Maréchal
Browse files
Modified comments
parent
0934211a
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/atl/analysis.atl
View file @
1500a413
...
...
@@ -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 break
s
/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
...
...
src/main/atl/errorProne.atl
View file @
1500a413
...
...
@@ -2,14 +2,14 @@ library errorProne;
---------------------------------- Missing break in switch---------------------------------------------
--- Returns a set of measures for every switch statement without break
or return
statement
s
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment