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

Template Conditional Complexity reports incorrect threshold #533

Closed
amandabot opened this issue Mar 5, 2018 · 2 comments · Fixed by #534
Closed

Template Conditional Complexity reports incorrect threshold #533

amandabot opened this issue Mar 5, 2018 · 2 comments · Fixed by #534

Comments

@amandabot
Copy link

When an error is reported, the default max complexity is always used:

let failureConfig: string[] = [String(complexity), String(Rule.COMPLEXITY_MAX)];

This leads to incorrect reporting:

"template-conditional-complexity": [true,1]
ERROR: The condition complexity (cost '2') exceeded the defined limit (cost '3').   
The conditional expression should be move in the component's template.

Somewhat related, the error message reads a bit awkward:
The conditional expression should be move in the component's template.

Maybe something like this?
The conditional expression should be moved from the component's template. /
The conditional expression should be moved into the component.

@wKoza
Copy link
Collaborator

wKoza commented Mar 5, 2018

Hi @AmandaFoster ,
good catch ! and yes,

the conditional expression should be moved into the component
seems to be more understandable

@mgechev mgechev added this to the 4.3.0 - Fred Brooks milestone Mar 5, 2018
@cexbrayat
Copy link
Contributor

@wKoza I think the same is true for template-cyclomatic-complexity

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

Successfully merging a pull request may close this issue.

4 participants