TCE-1548: Update default values for ccn issues#21
Conversation
Update the Cyclomatic Complexity (ccn) pattern defaults in
docs/patterns.json:
- ccn-minor: threshold 5 -> 10, enabled false -> true
- ccn-medium: threshold 8 -> 15, enabled true -> false
- ccn-critical: threshold 12 -> 20 (stays disabled)
Only ccn-minor is now enabled by default.
Keep the documentation in sync with the new defaults by updating the
ccn descriptions in docs/description/description.json and the per-pattern
files docs/description/ccn-{minor,medium,critical}.md. The .md files
previously carried stale values (4/7/10) that no longer matched
patterns.json; they are now aligned to 10/15/20.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request updates the default thresholds for the minor, medium, and critical cyclomatic complexity controls in both the documentation and configuration files, while also adjusting their default enabled states. The reviewer correctly noted that the phrasing 'If the threshold is not met' is misleading for cyclomatic complexity, as issues are raised when the complexity exceeds the threshold, and provided suggestions to correct this phrasing across all description files.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Pull Request Overview
The pull request synchronizes Cyclomatic Complexity (CCN) thresholds across configuration and documentation. Although the changes meet the stated acceptance criteria, the review surfaced a significant concern regarding pattern enablement in docs/patterns.json. By enabling ccn-minor while disabling ccn-medium and ccn-critical, the configuration deviates from repository standards seen in other tools (e.g., nloc). This results in high-complexity code (>= 15) being reported only as a 'Minor' issue, which may lead to significant logic complexity being overlooked during development. It is recommended to verify if this shift in severity strategy was intended.
About this PR
- The update enables 'Minor' complexity checks while disabling 'Medium' and 'Critical' tiers. This shift in severity strategy deviates from the established baseline in this repository where 'Medium' checks are typically enabled by default. Ensure this change is intentional as it impacts how complexity alerts are escalated.
Test suggestions
- Verify patterns.json schema and values for ccn-minor, ccn-medium, and ccn-critical\n- [x] Verify description.json matches the new default thresholds\n- [x] Verify markdown documentation files reflect the new default thresholds
TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback
| } | ||
| ], | ||
| "enabled": true | ||
| "enabled": false |
There was a problem hiding this comment.
🟡 MEDIUM RISK
The enabled status for ccn-medium should remain true. Disabling this pattern while updating its threshold results in code with high cyclomatic complexity (>= 15) being reported only as a 'Minor' issue rather than a 'Medium' warning. This is inconsistent with repository conventions for other complexity checks like nloc.\n\nsuggestion\n "enabled": true\n
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Summary
Updates the default values for the Cyclomatic Complexity (
ccn) issues indocs/patterns.jsonas requested in TCE-1548.ccn-minorccn-mediumccn-criticalOnly
ccn-minoris enabled by default now.Changes
docs/patterns.json— the canonical source of the defaults; thresholds andenabledflags updated as above.docs/description/description.json— the ccn pattern descriptions reference the default thresholds ("The default threshold is …"); updated 5→10, 8→15, 12→20 to stay in sync.docs/description/ccn-{minor,medium,critical}.md— same description text.patterns.json(5 / 8 / 12) — a pre-existing inconsistency. They are now aligned to the new defaults (10 / 15 / 20).The
docs/multiple-tests/all-patterns/patterns.xmlintegration fixture uses explicit thresholds (not the defaults), so it is intentionally left unchanged and the tests still pass.codacy-tools validation checklist
Step 1 — Dependency vulnerability scan (trivy)
Result: 0 HIGH/CRITICAL vulnerabilities in
package-lock.json. No new vulnerabilities introduced by this change.Step 2 — Pattern/docs generation
The
README.mddoes not document any pattern/docs generation command (the "Docs" section only links to external developer guides;package.jsonscripts arebuild/lint/test/upgradeonly). The docs underdocs/are hand-maintained, so this step has no command to run and was skipped.Step 3 — Integration test with codacy-plugins-test
Tool name (per README /
src/toolMetadata.ts):lizard. Built the docker image locally (codacy/codacy-lizard:latest) and ran the test suite:multiple:json(extra check, since the change touchespatterns.json+description.json):(The
file-nloc-*.md"could not read" lines are pre-existing — those description files do not exist — and are unrelated to this change; the test still passes.)🤖 Generated with Claude Code