Uploaded image for project: 'Clover'
  1. Clover
  2. CLOV-1173

Add maxComplexity / maxStatements for Clover-for-Maven

XMLWordPrintable

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      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].

              Unassigned Unassigned
              mparfianowicz Marek Parfianowicz
              Votes:
              4 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: