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

[STYLE] Simplify RegisterModel Function in App #16

Open
2 tasks done
YidiDev opened this issue Oct 10, 2024 · 0 comments
Open
2 tasks done

[STYLE] Simplify RegisterModel Function in App #16

YidiDev opened this issue Oct 10, 2024 · 0 comments
Labels
style Applies to issues or pull requests focusing on code style

Comments

@YidiDev
Copy link
Member

YidiDev commented Oct 10, 2024

Description

The RegisterModel function in internal/adminpanel/app.go has a cyclomatic complexity of 84, far exceeding the recommended standard.

Location

  • File: internal/adminpanel/app.go
  • Line number(s): 34

Expected Style

Adherence to a cyclomatic complexity of 15 or below according to project standards.

Current Style

The current complexity of 84 suggests excessive decision-making processes embedded in the function.

Additional Context

High complexity indicates a potential need for significant design change.

Suggestions for Improvement

Refactoring could involve splitting the logic across multiple functions, simplifying loops, or using early returns to reduce nesting.

Environment

All development environments

Checklist

  • I have checked if this style is mentioned in the project's style guide.
  • I have checked previous issues for similar stylistic concerns.

@YidiDev YidiDev added the style Applies to issues or pull requests focusing on code style label Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
style Applies to issues or pull requests focusing on code style
Projects
None yet
Development

No branches or pull requests

1 participant