#84 check number of parameters

Oliver Burn

Provide a check for the a maximum number of
parameters. For example 6. Excessive parameters is a
sign of code that needs refactoring.


  • Vincent Massol

    Vincent Massol - 2002-07-18

    Logged In: YES


    I have noticed you have recently introduced a check for max
    number of parameters in method calls. I like this. However, it
    is causing me some trouble on Jakarta Cactus :

    [checkstyle] [...]AbstractPageContextWrapper.java:255:5:
    More than 5 parameters.

    The problem is that I have no choice! My
    AbstractPageContextWrapper is implementing the servlet
    PageContext interface and there is a method there that
    takes 6 parameters (initialize()).

    I guess I can turn this check off (although I haven't found the
    parameter to do so). But what I would like is to use the
    check but not for code that do not belong to me (i.e.
    interfaces, classes that are extended).


  • Oliver Burn

    Oliver Burn - 2002-07-21

    Logged In: YES

    I have increased the number to 7 on advise from Lars.

    As an aside, I think we need to have some mechanism to be
    able to turn off specific errors reporting by Checkstyle. This
    would a classic example of where it would be nice to turn the
    check off when implementing an interface where you have not
    control over the number of parameters.

    My current thought is to be able to specify a file that contains
    error messages to be supressed. The file format would the
    messages as output by the default logger.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks