Skip to content

ci: run cognitive complexity audit from very_good_workflows#520 - #1755

Draft
marcossevilla wants to merge 3 commits into
refactor/cc-mcp-serverfrom
test/cognitive-complexity
Draft

marcossevilla wants to merge 3 commits into
refactor/cc-mcp-serverfrom
test/cognitive-complexity

Conversation

@marcossevilla

@marcossevilla marcossevilla commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Status

HOLD

Draft. Do not merge until VeryGoodOpenSource/very_good_workflows#520 is merged and released in a tag.

Description

Tests the cognitive complexity step added in VeryGoodOpenSource/very_good_workflows#520 against the CLI's own code.

  • The build job points at flutter_package.yml@vgv-ai-bot/issue-519, enables run_cognitive_complexity, and grants pull-requests: write so the action can post its sticky comment.
  • Temporary: cognitive_complexity_diff_base is set to the root commit. On a pull request the action only scans functions the PR changes. Diffing against the root commit makes every file in lib count as changed, which simulates the full scan a push to main would run. Functions over the threshold of 15 get fixed in follow-up commits here, then the override is reverted so the final diff is the config we would ship.

Fixes for the full scan

The temporary full scan flagged 11 functions over 15. They are fixed in three PRs against main:

Once all three merge, this branch gets rebased, the full scan should pass, and the temporary override gets reverted.

Next steps

  • Repurpose this PR to fix issues found by running package:cognitive_complexity locally beyond the CI defaults, such as a lower threshold, --max-function-lines, or scanning bricks/test_optimizer/hooks.
  • Run package:undead to find dead code and clean it up here or in a follow-up.
  • Once CLI prompt for update, after you update #520 ships in a tag, point the workflow at that tag and decide whether to also enable cognitive_complexity_fail_on_increase.

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

📊 Cognitive Complexity Analysis

Tip

Status: Clean - no complexity regressions in the current diff.

Last checked: 6f046a1 (run).

@marcossevilla
marcossevilla force-pushed the test/cognitive-complexity branch from 4db367e to 6f046a1 Compare October 1, 2026 13:41
@marcossevilla
marcossevilla changed the base branch from main to refactor/cc-mcp-server October 1, 2026 13:41
@marcossevilla
marcossevilla added this pull request to stack #1759 October 1, 2026 13:41

This branch has not been deployed

No deployments
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.

1 participant