[STYLE] Reduce Cyclomatic Complexity in gatherTemplates
Function
#15
Labels
style
Applies to issues or pull requests focusing on code style
gatherTemplates
Function
#15
Description
The cyclomatic complexity of the
gatherTemplates
function ininternal/adminpanel/templates.go
is currently 19, which exceeds the recommended threshold of 15. This high complexity can make the code difficult to maintain and test.Location
internal/adminpanel/templates.go
Expected Style
According to the project's guidelines, functions should aim for a cyclomatic complexity of 15 or lower to ensure maintainability and readability.
Current Style
The
gatherTemplates
function has a cyclomatic complexity of 19, indicating a high number of decision points which need simplification.Additional Context
Reducing cyclomatic complexity can enhance readability and maintainability. Code snippets are needed to identify specific points for refactoring.
Suggestions for Improvement
Consider refactoring the function by breaking it down into smaller, more manageable helper functions, or using design patterns that simplify decision structures.
Environment
All development environments
Checklist
The text was updated successfully, but these errors were encountered: