New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPathComplexityCheck: set of tokens should not be customizable by user #3797

romani opened this Issue Feb 4, 2017 · 1 comment


None yet
2 participants

romani commented Feb 4, 2017

This check can not work with reliably if user can change set of TokenTypes, if user miss QUESTION in config, algorithm will work incorrectly. So user should now have ability to change this.

Current code is:

     public int[] getRequiredTokens() {
         return new int[] {

Looks like the intend was to let user control on what blocks of code to run Check: on methods, on ctors, on static initializations, or instance init. But in this case all other tokens should be hardcoded in Check and Check need to walk on them itself.

We should not continue that intend (code is not doing this even now) and user should not have ability to control tokens set, so all methods should call getAcceptableTokens.


This comment has been minimized.

Show comment
Hide comment

romani Feb 9, 2017


fix is merged


romani commented Feb 9, 2017

fix is merged

@romani romani closed this Feb 9, 2017

bamapookie added a commit to bamapookie/checkstyle that referenced this issue Feb 10, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment