Commit 10023cd0 authored by Gerson SUNYE's avatar 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
......@@ -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(),
......
......@@ -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
......
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