Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Roxane MARECHAL
Source Code Analyzer
Commits
b46d78d0
Commit
b46d78d0
authored
Dec 21, 2019
by
Gerson SUNYE
Browse files
Merge branch 'master' into 'master'
Fix Bugged rules avoidDollarSigns See merge request
naomod/mde/projet-2019!130
parents
3f3fdf6b
f7f53b4a
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/atl/analysis.atl
View file @
b46d78d0
...
@@ -44,6 +44,7 @@ helper def: allMeasures(project : java!Model): Set(smm!Measure) =
...
@@ -44,6 +44,7 @@ helper def: allMeasures(project : java!Model): Set(smm!Measure) =
-- Code Style rules
-- Code Style rules
--
--
thisModule.avoidDollarSigns(),
thisModule.avoidPrefixingMethodParameters(),
thisModule.avoidPrefixingMethodParameters(),
thisModule.extendsObject(),
thisModule.extendsObject(),
thisModule.fieldDeclarationsShouldBeAtStartOfClass(),
thisModule.fieldDeclarationsShouldBeAtStartOfClass(),
...
@@ -132,7 +133,6 @@ helper def: allMeasures(project : java!Model): Set(smm!Measure) =
...
@@ -132,7 +133,6 @@ helper def: allMeasures(project : java!Model): Set(smm!Measure) =
-- thisModule.emptyfinalizeMethod(),
-- thisModule.emptyfinalizeMethod(),
-- thisModule.doNotThrowExceptionInFinally(),
-- thisModule.doNotThrowExceptionInFinally(),
-- thisModule.finalizeShouldBeProtected(),
-- thisModule.finalizeShouldBeProtected(),
-- thisModule.avoidDollarSigns(),
-- thisModule.returnEmptyArrayRatherThanNull(),
-- thisModule.returnEmptyArrayRatherThanNull(),
-- thisModule.replaceVectorToList()
-- thisModule.replaceVectorToList()
-- thisModule.unusedPrivateMethod ()
-- thisModule.unusedPrivateMethod ()
...
...
src/main/atl/codestyle.atl
View file @
b46d78d0
...
@@ -5,7 +5,7 @@ library codestyle;
...
@@ -5,7 +5,7 @@ library codestyle;
-- Rule for metrics AvoidDollarSigns : return the set of class Measures that violates the rule.
-- Rule for metrics AvoidDollarSigns : return the set of class Measures that violates the rule.
helper def: avoidDollarSigns() : Set(smm!Measure) =
helper def: avoidDollarSigns() : Set(smm!Measure) =
-- Browse through all variable/method/class/interface.
-- Browse through all variable/method/class/interface.
java!TypeDeclaration.allInstances()->union(java!MethodDeclaration.allInstances())->union(java!VariableDeclaration.allInstances())->select(i | i.name.indexOf('$') <> -1)
java!TypeDeclaration.allInstances()->union(java!MethodDeclaration.allInstances())->union(java!VariableDeclaration.allInstances())->
reject(each | each.isProxy())->
select(i | i.name.indexOf('$') <> -1)
->collect(i | thisModule.MesureAvoidDollarSigns(i));
->collect(i | thisModule.MesureAvoidDollarSigns(i));
-- Rule for metrics shortMethodName : return the set of method Measures that violates the rule.
-- Rule for metrics shortMethodName : return the set of method Measures that violates the rule.
...
@@ -166,4 +166,4 @@ helper context java!ClassDeclaration def: isNotAllFieldsDeclaredAtStartOfClass()
...
@@ -166,4 +166,4 @@ helper context java!ClassDeclaration def: isNotAllFieldsDeclaredAtStartOfClass()
endif
endif
endif
endif
)
)
endif;
endif;
\ No newline at end of file
Write
Preview
Markdown
is supported
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