[java] Possibilty to ignore private methods in rule S00107?


(Oliver Goroll) #1

After lengthy discussions whether to limit the number of parameters or not, how many parameters to allow and whether to include constructors, we came to the decision to ignore private methods for now. Currently, the rule does not have a setting to exclude private methods from the check (or to include only public/protected methods) and I am undecided if this would be such a good idea.
The reasoning is, only public and protected methods are part of the API and should be limited, private methods are not visible for clients. Further, splitting large functions into many smaller ones and simultaneously limiting the number of parameters is deemed to difficult.
Would it be possible to include a flag similar to S1448 “Classes should not have too many methods”? If not, would you be willing to accept a patch implementing the rule?