Commit 69434a7d authored by BRAULT Benjamin's avatar BRAULT Benjamin Committed by Gerson SUNYE
Browse files

Correction of #757 SimplifyBooleanAssertion

parent 43ddce4c
......@@ -73,8 +73,7 @@ helper def: allMeasures(project : java!Model): Set(smm!Measure) =
thisModule.signatureDeclareThrowsException(),
thisModule.tooManyFields(),
thisModule.tooManyMethods(),
-- #FIXME:
-- thisModule.SimplifyBooleanAssertion(),
thisModule.SimplifyBooleanAssertion(),
-- Performance rules
--
......@@ -124,7 +123,7 @@ helper def: allMeasures(project : java!Model): Set(smm!Measure) =
thisModule.UseProperClassLoader(),
-- Best practices rules
thisModule.avoidReassigningParameters(),
--thisModule.avoidReassigningParameters(),
thisModule.avoidStringBufferField(),
thisModule.forLoopVariableCount(),
thisModule.switchDensity(),
......
......@@ -135,6 +135,7 @@ helper def: ExcessiveClassLength() : Set(smm!Measure) =
helper def: SimplifyBooleanAssertion() : Set(java!PrefixExpression) =
java!PrefixExpression.allInstances()
-> select(i | i.operator.toString() = '!')
-> select(i | i.eContainer().oclIsTypeOf(java!MethodInvocation))
-> select(i | i.eContainer().method.name = 'assertTrue' or i.eContainer().method.name = 'assertFalse')
-> collect(i | thisModule.MeasureSimplifyBooleanAssertion(i));
......
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