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

Generic/NestingLevel: improve error message #763

Open
1 of 2 tasks
rodrigoprimo opened this issue Dec 9, 2024 · 1 comment
Open
1 of 2 tasks

Generic/NestingLevel: improve error message #763

rodrigoprimo opened this issue Dec 9, 2024 · 1 comment

Comments

@rodrigoprimo
Copy link
Contributor

Is your feature request related to a problem?

Similar to #743, both the warning and the error message displayed by the Generic.Metrics.NestingLevel sniff could be improved if they included the name of the function that caused the error.

Currently, the sniff displays the following messages:

  3 | WARNING | Function's nesting level (6) exceeds 5; consider refactoring the function (Generic.Metrics.NestingLevel.TooHigh)
 20 | ERROR   | Function's nesting level (11) exceeds allowed maximum of 10 (Generic.Metrics.NestingLevel.MaxExceeded)

I'm suggesting we update them to something like:

  3 | WARNING | Function nestingSix()'s nesting level (6) exceeds 5; consider refactoring the function (Generic.Metrics.NestingLevel.TooHigh)
 20 | ERROR   | Function nestingElevent()'s nesting level (11) exceeds allowed maximum of 10 (Generic.Metrics.NestingLevel.MaxExceeded)
@jrfnl
Copy link
Member

jrfnl commented Dec 10, 2024

Valid suggestion, low priority.

Note: this would become more complex if #761 gets implemented as anonymous functions don't have a name.

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

No branches or pull requests

2 participants