Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
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
10023cd0
Commit
10023cd0
authored
Dec 22, 2019
by
Gerson SUNYE
Browse files
Merge branch 'AvoidReassigningParameters' into 'master'
Rule #618 fixed Closes #618 See merge request
naomod/mde/projet-2019!146
parents
bd429a49
03107e51
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/atl/analysis.atl
View file @
10023cd0
...
...
@@ -123,7 +123,7 @@ helper def: allMeasures(project : java!Model): Set(smm!Measure) =
thisModule.UseProperClassLoader(),
-- Best practices rules
-- #FIXME:
thisModule.avoidReassigningParameters(),
thisModule.avoidReassigningParameters(),
thisModule.avoidStringBufferField(),
thisModule.forLoopVariableCount(),
thisModule.switchDensity(),
...
...
src/main/atl/bestPractices.atl
View file @
10023cd0
...
...
@@ -122,7 +122,7 @@ helper context java!VariableDeclarationExpression def: nbLocalVariableDeclaratio
helper def: avoidReassigningParameters(): Set(smm!Measure) =
java!AbstractMethodDeclaration.allInstances()->select(method |
method.parameters.size() > 0 -- need at least
1
parameter
method.parameters.size() > 0
and not method.body.oclIsUndefined()
-- need at least
one
parameter
and a body
)->collect(method |
method.body.statements->select(statement |
statement.oclIsTypeOf(java!ExpressionStatement) -- statement must be an expression
...
...
Write
Preview
Supports
Markdown
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