Re: Create a new Complexity check

Oliver Burn <[email protected]> Wed, 16 Dec 2009 13:15:15 +1100
Newsgroups gmane.comp.java.audit.checkstyle.user
Message-ID <[email protected]>
It is possible to persist information across calls. The instance of the
Check is created once and used.

If you extend AbstractComplexityCheck, you can override beginTree() and
endTree() to know when processing starts and finishes. You will need to copy
the implementation of visitTokenHook() to determine the complexity of each
method.

Probably need to add hooks to determine package names as well.

Regards,
Oliver

On Wed, Dec 16, 2009 at 00:01, Joao Morais <[email protected]> wrote:

> Hello List.
>
> I need to implement a new Checkstyle check which is based on the
> CyclomaticComplexityCheck class. The check need to verify the amount
> of methods of packages M[], whose CCN is between X and Y. The result
> cannot be more than Z% of the methods.
>
> There are at least two approaches. The first one, extending
> CyclomaticComplexityCheck or AbstractComplexityCheck, I don't know how
> (if possible) to persist the current result between visitor's calls.
> Otoh extend AbstractFileSetCheck sounds time and resource consuming.
>
> Are there other approaches or something I am missing?
>
> Thanks
>
> Joao Morais
>
>
> ------------------------------------------------------------------------------
> Return on Information:
> Google Enterprise Search pays you back
> Get the facts.
> http://p.sf.net/sfu/google-dev2dev
> _______________________________________________
> Checkstyle-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/checkstyle-user
>

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev

_______________________________________________
Checkstyle-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user