Skip to content

chore: regenerate CRAP baseline after scan target feature merge#504

Open
marcusburghardt wants to merge 1 commit into
complytime:mainfrom
marcusburghardt:fix/crapload-baseline-scan-target
Open

chore: regenerate CRAP baseline after scan target feature merge#504
marcusburghardt wants to merge 1 commit into
complytime:mainfrom
marcusburghardt:fix/crapload-baseline-scan-target

Conversation

@marcusburghardt
Copy link
Copy Markdown
Contributor

Summary

Regenerate .gaze/baseline.json to capture the CRAP score changes introduced by the scan target feature (eeaffe5b). The baseline was not updated at merge time, causing CRAP Load CI failures on subsequent PRs (e.g., #479).

Regressions Captured

All in cmd/complyctl/cli/scan.go, introduced by the positional target argument feature:

Function Previous Current Cause
scanCmd 11.25 12.99 Flag completion + positional arg handling
(*scanOptions).run 4 7 Target resolution branches (100% coverage)
(*scanOptions).scanPolicy 10.40 16.06 Target filtering + generation scoping

All scores remain under the CRAP threshold of 30. No new function violations.

Why baseline update (not tests)

  • run already has 100% coverage — CRAP increase is purely from added complexity
  • scanCmd uncovered paths are Cobra boilerplate (flag registration error handling)
  • scanPolicy coverage improvement requires dependency injection refactoring (calls package-level functions loadProviders, resolveVersionAndGraph directly) — tracked as a separate effort

Verification

make crapload-check
# PASS: No regressions detected

The scan target feature (eeaffe5) added branching logic to scanCmd,
run, and scanPolicy in cmd/complyctl/cli/scan.go. The CRAP baseline
was not updated at merge time, causing CI regressions:

- scanCmd: 11.25 -> 12.99 (flag completion + positional arg)
- run: 4 -> 7 (target resolution branches, 100% coverage)
- scanPolicy: 10.40 -> 16.06 (target filtering + generation scoping)

All scores remain under the 30 threshold. run already has 100%
coverage; scanPolicy coverage improvement requires dependency
injection refactoring (tracked separately).

Signed-off-by: Marcus Burghardt <marcus.burghardt@gmail.com>
Assisted-by: OpenCode (claude-opus-4-6)
@marcusburghardt marcusburghardt requested a review from a team as a code owner May 12, 2026 10:03
Copy link
Copy Markdown
Member

@gvauter gvauter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@marcusburghardt marcusburghardt enabled auto-merge (rebase) May 12, 2026 13:13
Copy link
Copy Markdown
Contributor

@sonupreetam sonupreetam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@marcusburghardt
Copy link
Copy Markdown
Contributor Author

Thanks @gvauter and @sonupreetam . Just saw there is a conflict to be resolved and this will likely require your approvals again. :( I ping you once I can work on it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants