Skip to content

refactor: decompose high-CRAP functions in internal/analysis #234

Description

@yvonnedevlinrh

Context

Follow-up to #200 (decompose high-complexity CLI and analysis functions). After that work, gaze identifies three remaining high-CRAP functions in internal/analysis/ with [decompose] fix strategy:

# CRAP Function File Fix Strategy
1 24.2 detectASTPointerArgMutations internal/analysis/mutation.go:549 decompose
2 21.0 funcSignature internal/analysis/returns.go:200 decompose
3 17.3 findSSAFunction internal/analysis/mutation.go:92 decompose

Acceptance Criteria

  • CC ≤ 15 for all three functions
  • Extracted helpers have unit tests covering primary branches
  • All existing tests pass without modification
  • golangci-lint run clean
  • CRAPload does not increase

Prior Art

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions