Skip to content

Generic/NestingLevel: improve error message #763

Open
@rodrigoprimo

Description

@rodrigoprimo

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions