Skip to content
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

StreamSpecificationSupport -- CyclomaticComplexity #67

Open
wprice opened this issue May 15, 2017 · 6 comments
Open

StreamSpecificationSupport -- CyclomaticComplexity #67

wprice opened this issue May 15, 2017 · 6 comments

Comments

@wprice
Copy link

wprice commented May 15, 2017

I have a branch that adds streams support to the Tables class with associated tests etc.
DynamoDB Streams

The issue I am having is that adding the support to the class violates the PMD CyclomaticComplexity rule threshold of 10 (with a count of 13). I don't want to disable the rule but I can't see any way to move past this issue without a great deal of work in rewriting the Tables class etc.

Any suggestions would be greatly appreciated.

@0crat
Copy link

0crat commented May 15, 2017

@yegor256 please, pay attention to this issue

@yegor256
Copy link
Member

@wprice just suppress the rule and add a @todo marker, for the future. Someone will do the refactoring later and remove the marker. Read more about it here: http://www.yegor256.com/2009/03/04/pdd.html

@wprice
Copy link
Author

wprice commented May 18, 2017

@yegor256 Thanks for the response.

The @todo is no problem, however I've tried various ways to suppress the rule with no luck. For clarification, running

mvn -X clean install -Pqulice

shows that it's a checkstyle error. Note it's already disabled in the PMD module at the Tables class level:

@SuppressWarnings
    (
        {
            "PMD.NPathComplexity",
            "PMD.CyclomaticComplexity",
            "PMD.StdCyclomaticComplexity",
            "PMD.ModifiedCyclomaticComplexity",
            "PMD.AvoidInstantiatingObjectsInLoops"
        }
    )

but any type of suppression I attempt to add

@SuppressWarnings("checkstyle:cyclomaticcomplexity")

or
@SuppressWarnings("CyclomaticComplexity")

at the method level don't seem to actually disable the check.

I'm sure I'm doing something stupid or missing something.

Again, any help in the right direction would be appreciated.

@wprice
Copy link
Author

wprice commented May 18, 2017

I also read the link you referenced but that seemed primarily about the @todo marker and not rule suppression.

@wprice
Copy link
Author

wprice commented May 23, 2017

bump

@yegor256
Copy link
Member

@wprice check this out: http://www.qulice.com/quality.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants