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
Roxane MARECHAL
Source Code Analyzer
Commits
baef321b
Commit
baef321b
authored
Dec 07, 2019
by
Roxane Kang Maréchal
Browse files
Removed some if/else conditionals
parent
8568f984
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/atl/analysis.atl
View file @
baef321b
...
...
@@ -45,7 +45,7 @@ helper def: allMeasures(project : java!Model): Set(smm!Measure) =
--
thisModule.shortMethodName(),
thisModule.tooManyStaticImports(),
thisModule.
A
voidDollarSigns(),
thisModule.
a
voidDollarSigns(),
thisModule.shortClassName(),
thisModule.extendsObject(),
thisModule.unnecessaryReturn(),
...
...
src/main/atl/documentation.atl
View file @
baef321b
...
...
@@ -56,32 +56,40 @@ helper def: matchesCommentRequiredProperty(
-- Check correspondance with modifier vibility
.and(
if (tuple.modifier.isEmpty()) then true
else
if (tuple.modifier = elem.modifier.visibility.name) then true else false endif
endif)
tuple.modifier.isEmpty() or tuple.modifier = elem.modifier.visibility.name)
-- Check correspondance with annotation
.and(
if (tuple.annotation.isEmpty()) then true
else
if (thisModule.getAnnotationTypeDeclarationsFromBodyDeclaration(elem)
->exists(annotation | annotation.name = tuple.annotation)
) then true else false endif
endif)
tuple.annotation.isEmpty() or
thisModule.getAnnotationTypeDeclarationsFromBodyDeclaration(elem)
->exists(annotation | annotation.name = tuple.annotation))
-- Check correspondance with prefixes
.and(
if (tuple.prefixes.isEmpty()) then true
else
if (tuple.prefixes->exists(p |
tuple.prefixes.isEmpty() or
tuple.prefixes->exists(p |
-- If elem is of type FieldDeclaration, name field is null so we have to use fragments
if (elem.oclIsTypeOf(java!FieldDeclaration))
then elem.fragments.first().name.startsWith(p)
else elem.name.startsWith(p)
endif
-- This creates problem : Operation not found: OclUndefined.startsWith(java.lang.String)
-- (elem.oclIsTypeOf(java!FieldDeclaration) and (elem.fragments.first().name.startsWith(p)))
-- or elem.name.startsWith(p)
)
)
--if (tuple.prefixes.isEmpty()) then true
--else
-- if (tuple.prefixes->exists(p |
-- If elem is of type FieldDeclaration, name field is null so we have to use fragments
if (elem.oclIsTypeOf(java!FieldDeclaration))
then elem.fragments.first().name.startsWith(p)
else elem.name.startsWith(p)
endif)
) then true else false endif
endif)
--
if (elem.oclIsTypeOf(java!FieldDeclaration))
--
then elem.fragments.first().name.startsWith(p)
--
else elem.name.startsWith(p)
--
endif)
--
) then true else false endif
--
endif)
;
-- Returns true if the elem has comments, false otherwise
...
...
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