Details
-
Suggestion
-
Resolution: Won't Fix
-
None
Description
Ant has extra maxComplexity and maxStatements attributes available which are not supported in Maven plugin, for example:
<methodContext name="simple_method" regexp="(.* )?public .*(get|set|is)[A-Z0-9].*" maxStatements="1"/>
in Maven we have name and regexp attributes only:
<configuration> <methodContexts> <!-- vvvvv name vvvvvv regexp --> <simple_method>((.* )?public .*(get|set|is)[A-Z0-9].*</simple_method> </methodContexts> </configuration>
Possible solution
Create <methodContextsExt> which would accept entries like:
<methodContextsExt> <methodContext> <name>simple_method</name> <regexp>(.* )?public .*(get|set|is)[A-Z0-9].*</regexp> <maxComplexity>10</maxComplexity> <maxStatements>10</maxStatements> <!-- for CLOV-1162: --> <maxCumulativeComplexity>20</maxCumulativeComplexity> <maxCumulativeStatments>20</maxCumulativeStatments> </methodContext> <methodContextsExt> ... more ...
Alternatively, extend parsing of existing <methodContexts> tag so whenever it finds the <methodContext> entry it will not treat it as name of new context but as a structure from sample above.
See also [-CLOV-1162-|../browse/CLOV-1162].