Conversation
Add ESLint complexity rule to bin/ and scripts/ to prevent new functions from accumulating excessive branching. Starting threshold is 95 (current worst offender: setupNim in onboard.js). Ratchet plan: 95 → 40 → 25 → 15. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughEnabled ESLint Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Suppress 6 functions that exceed the threshold with eslint-disable comments so we can start enforcing at 20 instead of 95: - setupNim (95), setupPolicies (41), setupInference (22) in onboard.js - deploy (22), main IIFE (27) in nemoclaw.js - applyPreset (24) in policies.js Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
eslint.config.mjs (1)
42-44: LGTM! Well-structured incremental complexity enforcement.The rule syntax is correct, and documenting the ratchet plan inline is helpful. Starting at 95 to avoid blocking existing code while preventing new high-complexity functions is a pragmatic approach.
Optional: Consider creating a GitHub issue or adding a tracking mechanism to ensure the ratchet milestones (95 → 40 → 25 → 15) are actually followed through. Inline comments can be forgotten over time.
,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@eslint.config.mjs` around lines 42 - 44, The inline ratchet plan for the ESLint "complexity" rule is fine but needs a persistent tracking mechanism so milestones (95 → 40 → 25 → 15) aren't forgotten; add a tracking artifact (e.g., create a GitHub Issue or project board and reference the milestones) and link it from the eslint.config.mjs comment near the "complexity" rule so reviewers can find the plan (refer to the "complexity" rule entry in eslint.config.mjs); update the comment to include the issue/board URL and a brief cadence (e.g., quarterly reductions) to ensure the ratchet is followed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@eslint.config.mjs`:
- Around line 42-44: The inline ratchet plan for the ESLint "complexity" rule is
fine but needs a persistent tracking mechanism so milestones (95 → 40 → 25 → 15)
aren't forgotten; add a tracking artifact (e.g., create a GitHub Issue or
project board and reference the milestones) and link it from the
eslint.config.mjs comment near the "complexity" rule so reviewers can find the
plan (refer to the "complexity" rule entry in eslint.config.mjs); update the
comment to include the issue/board URL and a brief cadence (e.g., quarterly
reductions) to ensure the ratchet is followed.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: d1edef24-fe8c-4f56-8dac-a750e392d999
📒 Files selected for processing (1)
eslint.config.mjs
|
Looks good to me. Kindly review and merge |
Summary
complexityrule tobin/andscripts/as an error, threshold 20eslint-disable-next-line— these are tech debt that badly needs refactoring:setupNimonboard.jssetupPoliciesonboard.jsnemoclaw.jsapplyPresetpolicies.jsdeploynemoclaw.jssetupInferenceonboard.jsThese complexity scores are terrible.
setupNimat 95 is nearly unmaintainable — a single function with 95 independent code paths. These functions desperately need to be broken apart; the suppression comments are a stop-gap so we can enforce the rule on new code immediately while we plan the refactor.Target: ratchet to 15 as the suppressed functions get refactored.
Test plan
npx eslint bin/ scripts/passes clean at threshold 20🤖 Generated with Claude Code
Summary by CodeRabbit