diff --git a/src/main/atl/analysis.atl b/src/main/atl/analysis.atl index 31348825e67b6c59bae7ebe38607f3ca30f34bfe..f1263e89c68abf35d7ad6151c620defedbbfe32f 100644 --- a/src/main/atl/analysis.atl +++ b/src/main/atl/analysis.atl @@ -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(), diff --git a/src/main/atl/bestPractices.atl b/src/main/atl/bestPractices.atl index 168babbd0978b6033a754de2af31618bbdf11f91..dd6844d6c9a453dc45a7ee3633ac74420dc0ed99 100644 --- a/src/main/atl/bestPractices.atl +++ b/src/main/atl/bestPractices.atl @@ -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