Skip to content

[STYLE] Simplify RegisterModel Function in App #16

@YidiDev

Description

@YidiDev

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    styleApplies to issues or pull requests focusing on code style

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions