·
Last changedVersion:
This version passed the hardening gate. Hardening updated the skill content and independently checked the resulting changes. Classified findings before hardening: 0. Classified findings closed: 0. Classified findings remaining: 0. Unclassified scanner findings remaining: 0. Review findings closed: 16. Review findings remaining: 1.
None
None
Expand | File | Group | Subtype | Severity | Status |
|---|
No findings available
0 findings
Refactor the target method to reduce its cognitive complexity to the target threshold or below, by extracting logic into focused helper methods.
Take the target method and the target threshold from the user's request:
Analyze the current method to identify sources of cognitive complexity:
Identify extraction opportunities:
Extract focused helper methods:
Validate* methodsSimplify the main method:
Preserve functionality:
Best practices (illustrative examples; follow the target language's idioms and the project's naming conventions):
The refactored method should:
Before running any command: identify the exact test and build commands from the project files, show them to the user, and run them only after the user approves. Prefer running them in a sandbox or container, in a minimal environment with secrets and tokens removed. If the user declines, or the repository is untrusted, leave the commands unrun and report clearly that tests and builds were not run; report the result as unverified rather than successful.
CRITICAL: After completing the refactoring, you MUST:
Get started with chainctlchainctl skill install public/github/refactor-method-complexity-reduce:latest
Bring Chainguard's hardening pipeline to your first-party skills — custom rulesets, automated remediation, full audit trail.
skills.cgr.dev/public/github.com/github/skills/refactor-method-complexity-reduce:latest
MIT
HARDENING.md
LICENSE
SKILL.md