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