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

Refactor com.vaadin.flow.router.internal.AbstractNavigationStateRenderer #20782

Open
mshabarov opened this issue Dec 23, 2024 · 0 comments
Open

Comments

@mshabarov
Copy link
Contributor

Describe your motivation

Code analysis highlights:

  • This file has 4 bumpy roads:
    pushHistoryStateIfNeeded(bumps = 3)
    handle(bumps = 2)
    sendBeforeEnterEvent(bumps = 2)
    getPreservedChain(bumps = 2)
    A Bumpy Road is a function that contains multiple chunks of nested conditional logic inside the same function. The deeper the nesting and the more bumps, the lower the code health.

  • 5 methods have high complexity.
    handle(cc = 19)
    handleTriggeredBeforeEvent(cc = 11)
    pushHistoryStateIfNeeded(cc = 10)
    getNavigationEvent(cc = 9)
    sendBeforeEnterEvent(cc = 9)

  • 4 methods have complex conditionals.
    handleTriggeredBeforeEvent:738(4 complex conditional expressions)
    pushHistoryStateIfNeeded:326(3 complex conditional expressions)
    getTargetParentLayouts:308(2 complex conditional expressions)
    handleTriggeredBeforeEvent:748(2 complex conditional expressions)
    getPreservedChain:1020(2 complex conditional expressions)

  • You have 1 functions that exceed the threshold.
    handle(LoC = 88 lines)

Additional context

See CodeScene analysis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Internal Backlog / Technical Debt
Development

No branches or pull requests

1 participant