Skip to content

audit: Code complexity and maintainability #41

@Snider

Description

@Snider

Audit: Code Complexity & Maintainability

Analyse code quality and identify maintainability issues.

Complexity Metrics

  1. Cyclomatic Complexity

    • Functions with complexity > 10
    • God classes/functions
    • Deeply nested conditionals
  2. Cognitive Complexity

    • Hard-to-understand code
    • Convoluted logic flows
    • Magic numbers/strings
  3. Code Duplication

    • Copy-paste code
    • Similar patterns that should be abstracted
    • DRY violations

Maintainability Issues

  1. Long Methods - Functions > 50 lines
  2. Large Classes - Classes > 500 lines
  3. Deep Nesting - > 4 levels
  4. Parameter Lists - > 5 parameters
  5. Dead Code - Unused functions/variables
  6. Commented Code - Should be deleted

Code Smells

  • Feature envy
  • Data clumps
  • Primitive obsession
  • Inappropriate intimacy
  • Refused bequest
  • Speculative generality

Recommendations

For each finding, suggest:

  • Refactoring approach
  • Design pattern to apply
  • Code example of improvement

Output

Save to AUDIT-COMPLEXITY.md

Prioritize by impact on maintenance burden.

Metadata

Metadata

Assignees

No one assigned

    Labels

    julesFor Jules AI to work onlang:phpPHP/Laravel

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions