Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Ronan GUEGUEN
Source Code Analyzer
Commits
69434a7d
Commit
69434a7d
authored
Dec 21, 2019
by
BRAULT Benjamin
Committed by
Gerson SUNYE
Dec 21, 2019
Browse files
Correction of
#757
SimplifyBooleanAssertion
parent
43ddce4c
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/atl/analysis.atl
View file @
69434a7d
...
...
@@ -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(),
...
...
src/main/atl/design.atl
View file @
69434a7d
...
...
@@ -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));
...
...
Write
Preview
Supports
Markdown
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