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
naomod
Model Driven Engineering (MDE)
Source Code Analyzer
Commits
03107e51
Commit
03107e51
authored
Dec 22, 2019
by
Arthur Liégeois
🍆
Committed by
Gerson SUNYE
Dec 22, 2019
Browse files
Rule
#618
fixed
parent
bd429a49
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/atl/analysis.atl
View file @
03107e51
...
...
@@ -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 @
03107e51
...
...
@@ -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
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