@kevinrabun/judges-cli 3.124.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/agents/accessibility.judge.md +44 -0
- package/agents/agent-instructions.judge.md +44 -0
- package/agents/ai-code-safety.judge.md +55 -0
- package/agents/api-contract.judge.md +37 -0
- package/agents/api-design.judge.md +55 -0
- package/agents/authentication.judge.md +61 -0
- package/agents/backwards-compatibility.judge.md +44 -0
- package/agents/caching.judge.md +44 -0
- package/agents/ci-cd.judge.md +44 -0
- package/agents/cloud-readiness.judge.md +51 -0
- package/agents/code-structure.judge.md +48 -0
- package/agents/compliance.judge.md +47 -0
- package/agents/concurrency.judge.md +46 -0
- package/agents/configuration-management.judge.md +44 -0
- package/agents/cost-effectiveness.judge.md +40 -0
- package/agents/cybersecurity.judge.md +61 -0
- package/agents/data-security.judge.md +48 -0
- package/agents/data-sovereignty.judge.md +58 -0
- package/agents/database.judge.md +49 -0
- package/agents/dependency-health.judge.md +46 -0
- package/agents/documentation.judge.md +53 -0
- package/agents/error-handling.judge.md +53 -0
- package/agents/ethics-bias.judge.md +46 -0
- package/agents/false-positive-review.judge.md +85 -0
- package/agents/framework-safety.judge.md +47 -0
- package/agents/hallucination-detection.judge.md +46 -0
- package/agents/iac-security.judge.md +45 -0
- package/agents/intent-alignment.judge.md +44 -0
- package/agents/internationalization.judge.md +42 -0
- package/agents/logging-privacy.judge.md +44 -0
- package/agents/logic-review.judge.md +34 -0
- package/agents/maintainability.judge.md +44 -0
- package/agents/model-fingerprint.judge.md +31 -0
- package/agents/multi-turn-coherence.judge.md +36 -0
- package/agents/observability.judge.md +52 -0
- package/agents/over-engineering.judge.md +48 -0
- package/agents/performance.judge.md +44 -0
- package/agents/portability.judge.md +44 -0
- package/agents/rate-limiting.judge.md +53 -0
- package/agents/reliability.judge.md +55 -0
- package/agents/scalability.judge.md +50 -0
- package/agents/security.judge.md +62 -0
- package/agents/software-practices.judge.md +54 -0
- package/agents/testing.judge.md +52 -0
- package/agents/ux.judge.md +44 -0
- package/bin/judges.js +8 -0
- package/dist/a2a-protocol.d.ts +136 -0
- package/dist/a2a-protocol.js +218 -0
- package/dist/agent-loader.d.ts +107 -0
- package/dist/agent-loader.js +260 -0
- package/dist/api.d.ts +169 -0
- package/dist/api.js +195 -0
- package/dist/ast/cross-file-taint.d.ts +42 -0
- package/dist/ast/cross-file-taint.js +679 -0
- package/dist/ast/index.d.ts +25 -0
- package/dist/ast/index.js +148 -0
- package/dist/ast/structural-parser.d.ts +2 -0
- package/dist/ast/structural-parser.js +756 -0
- package/dist/ast/taint-tracker.d.ts +48 -0
- package/dist/ast/taint-tracker.js +1033 -0
- package/dist/ast/tree-sitter-ast.d.ts +33 -0
- package/dist/ast/tree-sitter-ast.js +1164 -0
- package/dist/ast/types.d.ts +50 -0
- package/dist/ast/types.js +7 -0
- package/dist/audit-trail.d.ts +245 -0
- package/dist/audit-trail.js +257 -0
- package/dist/auto-tune.d.ts +146 -0
- package/dist/auto-tune.js +373 -0
- package/dist/cache.d.ts +53 -0
- package/dist/cache.js +86 -0
- package/dist/calibration.d.ts +108 -0
- package/dist/calibration.js +219 -0
- package/dist/cli-dispatch.d.ts +7 -0
- package/dist/cli-dispatch.js +654 -0
- package/dist/cli-formatters.d.ts +6 -0
- package/dist/cli-formatters.js +186 -0
- package/dist/cli-helpers.d.ts +29 -0
- package/dist/cli-helpers.js +129 -0
- package/dist/cli.d.ts +30 -0
- package/dist/cli.js +1487 -0
- package/dist/commands/adoption-report.d.ts +7 -0
- package/dist/commands/adoption-report.js +218 -0
- package/dist/commands/adoption-track.d.ts +4 -0
- package/dist/commands/adoption-track.js +246 -0
- package/dist/commands/ai-gate.d.ts +7 -0
- package/dist/commands/ai-gate.js +212 -0
- package/dist/commands/ai-model-trust.d.ts +16 -0
- package/dist/commands/ai-model-trust.js +234 -0
- package/dist/commands/ai-output-compare.d.ts +8 -0
- package/dist/commands/ai-output-compare.js +202 -0
- package/dist/commands/ai-pattern-trend.d.ts +8 -0
- package/dist/commands/ai-pattern-trend.js +223 -0
- package/dist/commands/ai-prompt-audit.d.ts +22 -0
- package/dist/commands/ai-prompt-audit.js +254 -0
- package/dist/commands/ai-provenance.d.ts +4 -0
- package/dist/commands/ai-provenance.js +247 -0
- package/dist/commands/api-audit.d.ts +8 -0
- package/dist/commands/api-audit.js +359 -0
- package/dist/commands/api-misuse.d.ts +4 -0
- package/dist/commands/api-misuse.js +260 -0
- package/dist/commands/api-versioning-audit.d.ts +5 -0
- package/dist/commands/api-versioning-audit.js +233 -0
- package/dist/commands/approve-chain.d.ts +7 -0
- package/dist/commands/approve-chain.js +234 -0
- package/dist/commands/arch-audit.d.ts +8 -0
- package/dist/commands/arch-audit.js +283 -0
- package/dist/commands/assertion-density.d.ts +4 -0
- package/dist/commands/assertion-density.js +263 -0
- package/dist/commands/assign-findings.d.ts +36 -0
- package/dist/commands/assign-findings.js +177 -0
- package/dist/commands/async-safety.d.ts +4 -0
- package/dist/commands/async-safety.js +266 -0
- package/dist/commands/audit-bundle.d.ts +28 -0
- package/dist/commands/audit-bundle.js +234 -0
- package/dist/commands/audit-trail.d.ts +17 -0
- package/dist/commands/audit-trail.js +154 -0
- package/dist/commands/auto-approve.d.ts +4 -0
- package/dist/commands/auto-approve.js +188 -0
- package/dist/commands/auto-calibrate.d.ts +14 -0
- package/dist/commands/auto-calibrate.js +106 -0
- package/dist/commands/auto-detect.d.ts +61 -0
- package/dist/commands/auto-detect.js +328 -0
- package/dist/commands/auto-fix.d.ts +17 -0
- package/dist/commands/auto-fix.js +240 -0
- package/dist/commands/auto-triage.d.ts +31 -0
- package/dist/commands/auto-triage.js +125 -0
- package/dist/commands/baseline.d.ts +47 -0
- package/dist/commands/baseline.js +353 -0
- package/dist/commands/batch-review.d.ts +4 -0
- package/dist/commands/batch-review.js +180 -0
- package/dist/commands/benchmark-advanced.d.ts +14 -0
- package/dist/commands/benchmark-advanced.js +5057 -0
- package/dist/commands/benchmark-ai-agents.d.ts +8 -0
- package/dist/commands/benchmark-ai-agents.js +4123 -0
- package/dist/commands/benchmark-ai-output.d.ts +9 -0
- package/dist/commands/benchmark-ai-output.js +365 -0
- package/dist/commands/benchmark-compliance-ethics.d.ts +8 -0
- package/dist/commands/benchmark-compliance-ethics.js +3060 -0
- package/dist/commands/benchmark-expanded-2.d.ts +12 -0
- package/dist/commands/benchmark-expanded-2.js +5530 -0
- package/dist/commands/benchmark-expanded.d.ts +12 -0
- package/dist/commands/benchmark-expanded.js +2599 -0
- package/dist/commands/benchmark-infrastructure.d.ts +8 -0
- package/dist/commands/benchmark-infrastructure.js +2882 -0
- package/dist/commands/benchmark-languages.d.ts +8 -0
- package/dist/commands/benchmark-languages.js +1963 -0
- package/dist/commands/benchmark-quality-ops.d.ts +8 -0
- package/dist/commands/benchmark-quality-ops.js +3415 -0
- package/dist/commands/benchmark-security-deep.d.ts +9 -0
- package/dist/commands/benchmark-security-deep.js +2335 -0
- package/dist/commands/benchmark.d.ts +233 -0
- package/dist/commands/benchmark.js +3214 -0
- package/dist/commands/blame-review.d.ts +4 -0
- package/dist/commands/blame-review.js +266 -0
- package/dist/commands/boundary-enforce.d.ts +5 -0
- package/dist/commands/boundary-enforce.js +255 -0
- package/dist/commands/build-optimize.d.ts +6 -0
- package/dist/commands/build-optimize.js +256 -0
- package/dist/commands/burndown.d.ts +26 -0
- package/dist/commands/burndown.js +179 -0
- package/dist/commands/cache-audit.d.ts +4 -0
- package/dist/commands/cache-audit.js +219 -0
- package/dist/commands/calibration-dashboard.d.ts +1 -0
- package/dist/commands/calibration-dashboard.js +294 -0
- package/dist/commands/calibration-share.d.ts +30 -0
- package/dist/commands/calibration-share.js +182 -0
- package/dist/commands/chat-notify.d.ts +8 -0
- package/dist/commands/chat-notify.js +258 -0
- package/dist/commands/ci-template.d.ts +14 -0
- package/dist/commands/ci-template.js +211 -0
- package/dist/commands/ci-templates.d.ts +9 -0
- package/dist/commands/ci-templates.js +89 -0
- package/dist/commands/clarity-score.d.ts +8 -0
- package/dist/commands/clarity-score.js +260 -0
- package/dist/commands/clone-detect.d.ts +4 -0
- package/dist/commands/clone-detect.js +232 -0
- package/dist/commands/coach-mode.d.ts +7 -0
- package/dist/commands/coach-mode.js +229 -0
- package/dist/commands/code-health.d.ts +4 -0
- package/dist/commands/code-health.js +195 -0
- package/dist/commands/code-owner-suggest.d.ts +16 -0
- package/dist/commands/code-owner-suggest.js +214 -0
- package/dist/commands/code-similarity.d.ts +8 -0
- package/dist/commands/code-similarity.js +231 -0
- package/dist/commands/comment-drift.d.ts +4 -0
- package/dist/commands/comment-drift.js +228 -0
- package/dist/commands/commit-hygiene.d.ts +5 -0
- package/dist/commands/commit-hygiene.js +175 -0
- package/dist/commands/community-patterns.d.ts +1 -0
- package/dist/commands/community-patterns.js +131 -0
- package/dist/commands/compare-runs.d.ts +37 -0
- package/dist/commands/compare-runs.js +228 -0
- package/dist/commands/completion-audit.d.ts +4 -0
- package/dist/commands/completion-audit.js +296 -0
- package/dist/commands/completions.d.ts +1 -0
- package/dist/commands/completions.js +257 -0
- package/dist/commands/compliance-map.d.ts +8 -0
- package/dist/commands/compliance-map.js +374 -0
- package/dist/commands/compliance-report.d.ts +34 -0
- package/dist/commands/compliance-report.js +161 -0
- package/dist/commands/compliance-weight.d.ts +8 -0
- package/dist/commands/compliance-weight.js +272 -0
- package/dist/commands/config-drift.d.ts +24 -0
- package/dist/commands/config-drift.js +213 -0
- package/dist/commands/config-lint.d.ts +4 -0
- package/dist/commands/config-lint.js +187 -0
- package/dist/commands/config-migrate.d.ts +43 -0
- package/dist/commands/config-migrate.js +240 -0
- package/dist/commands/config-share.d.ts +95 -0
- package/dist/commands/config-share.js +406 -0
- package/dist/commands/context-blind.d.ts +4 -0
- package/dist/commands/context-blind.js +272 -0
- package/dist/commands/context-inject.d.ts +8 -0
- package/dist/commands/context-inject.js +211 -0
- package/dist/commands/contract-verify.d.ts +4 -0
- package/dist/commands/contract-verify.js +316 -0
- package/dist/commands/correlate.d.ts +27 -0
- package/dist/commands/correlate.js +241 -0
- package/dist/commands/cost-forecast.d.ts +18 -0
- package/dist/commands/cost-forecast.js +193 -0
- package/dist/commands/coverage-map.d.ts +22 -0
- package/dist/commands/coverage-map.js +222 -0
- package/dist/commands/coverage.d.ts +40 -0
- package/dist/commands/coverage.js +147 -0
- package/dist/commands/cross-file-consistency.d.ts +4 -0
- package/dist/commands/cross-file-consistency.js +254 -0
- package/dist/commands/cross-pr-regression.d.ts +8 -0
- package/dist/commands/cross-pr-regression.js +297 -0
- package/dist/commands/custom-rule.d.ts +4 -0
- package/dist/commands/custom-rule.js +210 -0
- package/dist/commands/dead-code-detect.d.ts +4 -0
- package/dist/commands/dead-code-detect.js +255 -0
- package/dist/commands/dedup-report.d.ts +12 -0
- package/dist/commands/dedup-report.js +137 -0
- package/dist/commands/dep-audit.d.ts +52 -0
- package/dist/commands/dep-audit.js +277 -0
- package/dist/commands/dep-correlate.d.ts +8 -0
- package/dist/commands/dep-correlate.js +207 -0
- package/dist/commands/deploy-readiness.d.ts +5 -0
- package/dist/commands/deploy-readiness.js +211 -0
- package/dist/commands/deprecated.d.ts +47 -0
- package/dist/commands/deprecated.js +201 -0
- package/dist/commands/deps.d.ts +5 -0
- package/dist/commands/deps.js +122 -0
- package/dist/commands/design-audit.d.ts +8 -0
- package/dist/commands/design-audit.js +301 -0
- package/dist/commands/dev-score.d.ts +36 -0
- package/dist/commands/dev-score.js +203 -0
- package/dist/commands/diff-explain.d.ts +4 -0
- package/dist/commands/diff-explain.js +142 -0
- package/dist/commands/diff-only.d.ts +33 -0
- package/dist/commands/diff-only.js +151 -0
- package/dist/commands/diff-review.d.ts +4 -0
- package/dist/commands/diff-review.js +190 -0
- package/dist/commands/diff.d.ts +6 -0
- package/dist/commands/diff.js +449 -0
- package/dist/commands/digest.d.ts +19 -0
- package/dist/commands/digest.js +221 -0
- package/dist/commands/doc-drift.d.ts +8 -0
- package/dist/commands/doc-drift.js +258 -0
- package/dist/commands/doc-gen.d.ts +7 -0
- package/dist/commands/doc-gen.js +208 -0
- package/dist/commands/docs.d.ts +1 -0
- package/dist/commands/docs.js +156 -0
- package/dist/commands/doctor.d.ts +55 -0
- package/dist/commands/doctor.js +362 -0
- package/dist/commands/encoding-safety.d.ts +4 -0
- package/dist/commands/encoding-safety.js +275 -0
- package/dist/commands/error-taxonomy.d.ts +5 -0
- package/dist/commands/error-taxonomy.js +226 -0
- package/dist/commands/error-ux.d.ts +4 -0
- package/dist/commands/error-ux.js +252 -0
- package/dist/commands/event-leak.d.ts +4 -0
- package/dist/commands/event-leak.js +262 -0
- package/dist/commands/evidence-chain.d.ts +4 -0
- package/dist/commands/evidence-chain.js +309 -0
- package/dist/commands/example-leak.d.ts +4 -0
- package/dist/commands/example-leak.js +232 -0
- package/dist/commands/exception-consistency.d.ts +6 -0
- package/dist/commands/exception-consistency.js +192 -0
- package/dist/commands/exec-report.d.ts +8 -0
- package/dist/commands/exec-report.js +271 -0
- package/dist/commands/explain-finding.d.ts +7 -0
- package/dist/commands/explain-finding.js +278 -0
- package/dist/commands/false-negatives.d.ts +34 -0
- package/dist/commands/false-negatives.js +165 -0
- package/dist/commands/feedback-rules.d.ts +28 -0
- package/dist/commands/feedback-rules.js +173 -0
- package/dist/commands/feedback.d.ts +182 -0
- package/dist/commands/feedback.js +550 -0
- package/dist/commands/finding-age-analysis.d.ts +4 -0
- package/dist/commands/finding-age-analysis.js +144 -0
- package/dist/commands/finding-age-report.d.ts +4 -0
- package/dist/commands/finding-age-report.js +154 -0
- package/dist/commands/finding-age-tracker.d.ts +7 -0
- package/dist/commands/finding-age-tracker.js +152 -0
- package/dist/commands/finding-age.d.ts +4 -0
- package/dist/commands/finding-age.js +145 -0
- package/dist/commands/finding-ancestry-trace.d.ts +1 -0
- package/dist/commands/finding-ancestry-trace.js +69 -0
- package/dist/commands/finding-annotation-export.d.ts +1 -0
- package/dist/commands/finding-annotation-export.js +97 -0
- package/dist/commands/finding-annotation-layer.d.ts +4 -0
- package/dist/commands/finding-annotation-layer.js +128 -0
- package/dist/commands/finding-auto-categorize.d.ts +1 -0
- package/dist/commands/finding-auto-categorize.js +109 -0
- package/dist/commands/finding-auto-fix-suggest.d.ts +1 -0
- package/dist/commands/finding-auto-fix-suggest.js +76 -0
- package/dist/commands/finding-auto-fix.d.ts +4 -0
- package/dist/commands/finding-auto-fix.js +188 -0
- package/dist/commands/finding-auto-group.d.ts +4 -0
- package/dist/commands/finding-auto-group.js +108 -0
- package/dist/commands/finding-auto-label.d.ts +4 -0
- package/dist/commands/finding-auto-label.js +220 -0
- package/dist/commands/finding-auto-priority.d.ts +1 -0
- package/dist/commands/finding-auto-priority.js +100 -0
- package/dist/commands/finding-auto-suppress.d.ts +4 -0
- package/dist/commands/finding-auto-suppress.js +126 -0
- package/dist/commands/finding-auto-tag.d.ts +4 -0
- package/dist/commands/finding-auto-tag.js +113 -0
- package/dist/commands/finding-auto-triage.d.ts +4 -0
- package/dist/commands/finding-auto-triage.js +108 -0
- package/dist/commands/finding-autofix-preview.d.ts +4 -0
- package/dist/commands/finding-autofix-preview.js +86 -0
- package/dist/commands/finding-batch-resolve.d.ts +4 -0
- package/dist/commands/finding-batch-resolve.js +165 -0
- package/dist/commands/finding-batch-suppress.d.ts +4 -0
- package/dist/commands/finding-batch-suppress.js +85 -0
- package/dist/commands/finding-batch-triage.d.ts +1 -0
- package/dist/commands/finding-batch-triage.js +90 -0
- package/dist/commands/finding-blast-radius.d.ts +4 -0
- package/dist/commands/finding-blast-radius.js +91 -0
- package/dist/commands/finding-budget.d.ts +4 -0
- package/dist/commands/finding-budget.js +232 -0
- package/dist/commands/finding-category-map.d.ts +4 -0
- package/dist/commands/finding-category-map.js +103 -0
- package/dist/commands/finding-category-stats.d.ts +4 -0
- package/dist/commands/finding-category-stats.js +104 -0
- package/dist/commands/finding-category.d.ts +4 -0
- package/dist/commands/finding-category.js +109 -0
- package/dist/commands/finding-change-impact.d.ts +4 -0
- package/dist/commands/finding-change-impact.js +107 -0
- package/dist/commands/finding-cluster-analysis.d.ts +4 -0
- package/dist/commands/finding-cluster-analysis.js +133 -0
- package/dist/commands/finding-cluster-group.d.ts +4 -0
- package/dist/commands/finding-cluster-group.js +105 -0
- package/dist/commands/finding-cluster-summary.d.ts +1 -0
- package/dist/commands/finding-cluster-summary.js +85 -0
- package/dist/commands/finding-cluster.d.ts +4 -0
- package/dist/commands/finding-cluster.js +157 -0
- package/dist/commands/finding-code-context.d.ts +4 -0
- package/dist/commands/finding-code-context.js +96 -0
- package/dist/commands/finding-code-smell.d.ts +4 -0
- package/dist/commands/finding-code-smell.js +113 -0
- package/dist/commands/finding-compare-runs.d.ts +4 -0
- package/dist/commands/finding-compare-runs.js +105 -0
- package/dist/commands/finding-compliance-tag.d.ts +1 -0
- package/dist/commands/finding-compliance-tag.js +106 -0
- package/dist/commands/finding-confidence-boost.d.ts +1 -0
- package/dist/commands/finding-confidence-boost.js +88 -0
- package/dist/commands/finding-confidence-calibrate.d.ts +4 -0
- package/dist/commands/finding-confidence-calibrate.js +111 -0
- package/dist/commands/finding-confidence-filter.d.ts +4 -0
- package/dist/commands/finding-confidence-filter.js +77 -0
- package/dist/commands/finding-contest.d.ts +7 -0
- package/dist/commands/finding-contest.js +192 -0
- package/dist/commands/finding-context-enrich.d.ts +4 -0
- package/dist/commands/finding-context-enrich.js +89 -0
- package/dist/commands/finding-context-expand.d.ts +4 -0
- package/dist/commands/finding-context-expand.js +102 -0
- package/dist/commands/finding-context-link.d.ts +1 -0
- package/dist/commands/finding-context-link.js +94 -0
- package/dist/commands/finding-context-summary.d.ts +1 -0
- package/dist/commands/finding-context-summary.js +85 -0
- package/dist/commands/finding-context-window.d.ts +4 -0
- package/dist/commands/finding-context-window.js +126 -0
- package/dist/commands/finding-context.d.ts +4 -0
- package/dist/commands/finding-context.js +140 -0
- package/dist/commands/finding-correlate.d.ts +4 -0
- package/dist/commands/finding-correlate.js +88 -0
- package/dist/commands/finding-correlation-map.d.ts +4 -0
- package/dist/commands/finding-correlation-map.js +101 -0
- package/dist/commands/finding-correlation.d.ts +4 -0
- package/dist/commands/finding-correlation.js +103 -0
- package/dist/commands/finding-cross-file-link.d.ts +1 -0
- package/dist/commands/finding-cross-file-link.js +101 -0
- package/dist/commands/finding-cross-ref.d.ts +4 -0
- package/dist/commands/finding-cross-ref.js +98 -0
- package/dist/commands/finding-cve-lookup.d.ts +4 -0
- package/dist/commands/finding-cve-lookup.js +97 -0
- package/dist/commands/finding-cwe-lookup.d.ts +4 -0
- package/dist/commands/finding-cwe-lookup.js +148 -0
- package/dist/commands/finding-cwe-map.d.ts +4 -0
- package/dist/commands/finding-cwe-map.js +133 -0
- package/dist/commands/finding-dedup-cross-file.d.ts +4 -0
- package/dist/commands/finding-dedup-cross-file.js +95 -0
- package/dist/commands/finding-dedup-cross.d.ts +4 -0
- package/dist/commands/finding-dedup-cross.js +90 -0
- package/dist/commands/finding-dedup-merge.d.ts +1 -0
- package/dist/commands/finding-dedup-merge.js +107 -0
- package/dist/commands/finding-dedup-report.d.ts +4 -0
- package/dist/commands/finding-dedup-report.js +101 -0
- package/dist/commands/finding-dedup-smart.d.ts +1 -0
- package/dist/commands/finding-dedup-smart.js +109 -0
- package/dist/commands/finding-deduplicate.d.ts +4 -0
- package/dist/commands/finding-deduplicate.js +141 -0
- package/dist/commands/finding-dependency-check.d.ts +4 -0
- package/dist/commands/finding-dependency-check.js +119 -0
- package/dist/commands/finding-dependency-impact.d.ts +1 -0
- package/dist/commands/finding-dependency-impact.js +97 -0
- package/dist/commands/finding-dependency-link.d.ts +4 -0
- package/dist/commands/finding-dependency-link.js +73 -0
- package/dist/commands/finding-dependency-risk.d.ts +4 -0
- package/dist/commands/finding-dependency-risk.js +117 -0
- package/dist/commands/finding-dependency-tree.d.ts +4 -0
- package/dist/commands/finding-dependency-tree.js +116 -0
- package/dist/commands/finding-diff-highlight.d.ts +4 -0
- package/dist/commands/finding-diff-highlight.js +107 -0
- package/dist/commands/finding-dismiss-workflow.d.ts +4 -0
- package/dist/commands/finding-dismiss-workflow.js +119 -0
- package/dist/commands/finding-duplicate-detect.d.ts +4 -0
- package/dist/commands/finding-duplicate-detect.js +113 -0
- package/dist/commands/finding-duplicate-rule.d.ts +4 -0
- package/dist/commands/finding-duplicate-rule.js +103 -0
- package/dist/commands/finding-effort-rank.d.ts +1 -0
- package/dist/commands/finding-effort-rank.js +93 -0
- package/dist/commands/finding-evidence-chain.d.ts +4 -0
- package/dist/commands/finding-evidence-chain.js +147 -0
- package/dist/commands/finding-evidence-collect.d.ts +4 -0
- package/dist/commands/finding-evidence-collect.js +114 -0
- package/dist/commands/finding-explain.d.ts +4 -0
- package/dist/commands/finding-explain.js +93 -0
- package/dist/commands/finding-export-csv.d.ts +4 -0
- package/dist/commands/finding-export-csv.js +78 -0
- package/dist/commands/finding-false-neg-check.d.ts +8 -0
- package/dist/commands/finding-false-neg-check.js +139 -0
- package/dist/commands/finding-false-positive-learn.d.ts +4 -0
- package/dist/commands/finding-false-positive-learn.js +85 -0
- package/dist/commands/finding-false-positive-log.d.ts +4 -0
- package/dist/commands/finding-false-positive-log.js +150 -0
- package/dist/commands/finding-false-positive.d.ts +4 -0
- package/dist/commands/finding-false-positive.js +134 -0
- package/dist/commands/finding-filter-view.d.ts +4 -0
- package/dist/commands/finding-filter-view.js +107 -0
- package/dist/commands/finding-fix-chain.d.ts +1 -0
- package/dist/commands/finding-fix-chain.js +78 -0
- package/dist/commands/finding-fix-estimate.d.ts +1 -0
- package/dist/commands/finding-fix-estimate.js +95 -0
- package/dist/commands/finding-fix-playbook.d.ts +1 -0
- package/dist/commands/finding-fix-playbook.js +110 -0
- package/dist/commands/finding-fix-priority.d.ts +4 -0
- package/dist/commands/finding-fix-priority.js +98 -0
- package/dist/commands/finding-fix-rate.d.ts +4 -0
- package/dist/commands/finding-fix-rate.js +141 -0
- package/dist/commands/finding-fix-suggest.d.ts +4 -0
- package/dist/commands/finding-fix-suggest.js +88 -0
- package/dist/commands/finding-fix-validation.d.ts +4 -0
- package/dist/commands/finding-fix-validation.js +115 -0
- package/dist/commands/finding-fix-verify.d.ts +4 -0
- package/dist/commands/finding-fix-verify.js +198 -0
- package/dist/commands/finding-group-by.d.ts +4 -0
- package/dist/commands/finding-group-by.js +86 -0
- package/dist/commands/finding-group.d.ts +15 -0
- package/dist/commands/finding-group.js +164 -0
- package/dist/commands/finding-groupby-file.d.ts +4 -0
- package/dist/commands/finding-groupby-file.js +94 -0
- package/dist/commands/finding-hotfix-suggest.d.ts +7 -0
- package/dist/commands/finding-hotfix-suggest.js +170 -0
- package/dist/commands/finding-hotspot-detect.d.ts +1 -0
- package/dist/commands/finding-hotspot-detect.js +120 -0
- package/dist/commands/finding-hotspot-map.d.ts +4 -0
- package/dist/commands/finding-hotspot-map.js +106 -0
- package/dist/commands/finding-hotspot.d.ts +4 -0
- package/dist/commands/finding-hotspot.js +115 -0
- package/dist/commands/finding-impact-radius.d.ts +1 -0
- package/dist/commands/finding-impact-radius.js +94 -0
- package/dist/commands/finding-impact-rank.d.ts +4 -0
- package/dist/commands/finding-impact-rank.js +85 -0
- package/dist/commands/finding-impact-score.d.ts +4 -0
- package/dist/commands/finding-impact-score.js +123 -0
- package/dist/commands/finding-impact.d.ts +4 -0
- package/dist/commands/finding-impact.js +135 -0
- package/dist/commands/finding-line-blame.d.ts +7 -0
- package/dist/commands/finding-line-blame.js +129 -0
- package/dist/commands/finding-link-graph.d.ts +4 -0
- package/dist/commands/finding-link-graph.js +144 -0
- package/dist/commands/finding-link.d.ts +4 -0
- package/dist/commands/finding-link.js +128 -0
- package/dist/commands/finding-merge-results.d.ts +4 -0
- package/dist/commands/finding-merge-results.js +110 -0
- package/dist/commands/finding-merge-strategy.d.ts +1 -0
- package/dist/commands/finding-merge-strategy.js +84 -0
- package/dist/commands/finding-metadata-enrich.d.ts +4 -0
- package/dist/commands/finding-metadata-enrich.js +92 -0
- package/dist/commands/finding-noise-filter.d.ts +7 -0
- package/dist/commands/finding-noise-filter.js +140 -0
- package/dist/commands/finding-noise-reduce.d.ts +1 -0
- package/dist/commands/finding-noise-reduce.js +81 -0
- package/dist/commands/finding-noise-score.d.ts +1 -0
- package/dist/commands/finding-noise-score.js +93 -0
- package/dist/commands/finding-owner-assign.d.ts +4 -0
- package/dist/commands/finding-owner-assign.js +133 -0
- package/dist/commands/finding-owner-notify.d.ts +1 -0
- package/dist/commands/finding-owner-notify.js +121 -0
- package/dist/commands/finding-ownership-assign.d.ts +4 -0
- package/dist/commands/finding-ownership-assign.js +101 -0
- package/dist/commands/finding-ownership-map.d.ts +4 -0
- package/dist/commands/finding-ownership-map.js +118 -0
- package/dist/commands/finding-patch-chain.d.ts +1 -0
- package/dist/commands/finding-patch-chain.js +90 -0
- package/dist/commands/finding-patch-preview.d.ts +4 -0
- package/dist/commands/finding-patch-preview.js +103 -0
- package/dist/commands/finding-pattern-detect.d.ts +4 -0
- package/dist/commands/finding-pattern-detect.js +127 -0
- package/dist/commands/finding-pattern-library.d.ts +4 -0
- package/dist/commands/finding-pattern-library.js +145 -0
- package/dist/commands/finding-pattern-match.d.ts +4 -0
- package/dist/commands/finding-pattern-match.js +165 -0
- package/dist/commands/finding-prioritize.d.ts +4 -0
- package/dist/commands/finding-prioritize.js +119 -0
- package/dist/commands/finding-priority-matrix.d.ts +4 -0
- package/dist/commands/finding-priority-matrix.js +102 -0
- package/dist/commands/finding-priority-queue.d.ts +4 -0
- package/dist/commands/finding-priority-queue.js +131 -0
- package/dist/commands/finding-priority-rank.d.ts +1 -0
- package/dist/commands/finding-priority-rank.js +82 -0
- package/dist/commands/finding-quality-gate.d.ts +4 -0
- package/dist/commands/finding-quality-gate.js +107 -0
- package/dist/commands/finding-rank.d.ts +4 -0
- package/dist/commands/finding-rank.js +138 -0
- package/dist/commands/finding-reachability-check.d.ts +4 -0
- package/dist/commands/finding-reachability-check.js +102 -0
- package/dist/commands/finding-reachability.d.ts +4 -0
- package/dist/commands/finding-reachability.js +131 -0
- package/dist/commands/finding-recurrence-check.d.ts +1 -0
- package/dist/commands/finding-recurrence-check.js +103 -0
- package/dist/commands/finding-recurrence-detect.d.ts +4 -0
- package/dist/commands/finding-recurrence-detect.js +77 -0
- package/dist/commands/finding-recurrence.d.ts +4 -0
- package/dist/commands/finding-recurrence.js +135 -0
- package/dist/commands/finding-regression-check.d.ts +4 -0
- package/dist/commands/finding-regression-check.js +112 -0
- package/dist/commands/finding-regression-detect.d.ts +1 -0
- package/dist/commands/finding-regression-detect.js +86 -0
- package/dist/commands/finding-related-rules.d.ts +4 -0
- package/dist/commands/finding-related-rules.js +151 -0
- package/dist/commands/finding-remediation-cost.d.ts +1 -0
- package/dist/commands/finding-remediation-cost.js +79 -0
- package/dist/commands/finding-remediation-plan.d.ts +4 -0
- package/dist/commands/finding-remediation-plan.js +107 -0
- package/dist/commands/finding-reopen-detect.d.ts +1 -0
- package/dist/commands/finding-reopen-detect.js +77 -0
- package/dist/commands/finding-repeat-detect.d.ts +1 -0
- package/dist/commands/finding-repeat-detect.js +92 -0
- package/dist/commands/finding-resolution-track.d.ts +4 -0
- package/dist/commands/finding-resolution-track.js +150 -0
- package/dist/commands/finding-resolution-tracker.d.ts +4 -0
- package/dist/commands/finding-resolution-tracker.js +163 -0
- package/dist/commands/finding-resolution-workflow.d.ts +1 -0
- package/dist/commands/finding-resolution-workflow.js +91 -0
- package/dist/commands/finding-resolution.d.ts +4 -0
- package/dist/commands/finding-resolution.js +142 -0
- package/dist/commands/finding-risk-label.d.ts +1 -0
- package/dist/commands/finding-risk-label.js +72 -0
- package/dist/commands/finding-risk-matrix.d.ts +4 -0
- package/dist/commands/finding-risk-matrix.js +126 -0
- package/dist/commands/finding-risk-score.d.ts +4 -0
- package/dist/commands/finding-risk-score.js +95 -0
- package/dist/commands/finding-root-cause.d.ts +4 -0
- package/dist/commands/finding-root-cause.js +184 -0
- package/dist/commands/finding-rule-explain.d.ts +4 -0
- package/dist/commands/finding-rule-explain.js +140 -0
- package/dist/commands/finding-scope-filter.d.ts +1 -0
- package/dist/commands/finding-scope-filter.js +77 -0
- package/dist/commands/finding-scope-impact.d.ts +1 -0
- package/dist/commands/finding-scope-impact.js +83 -0
- package/dist/commands/finding-search-index.d.ts +4 -0
- package/dist/commands/finding-search-index.js +99 -0
- package/dist/commands/finding-security-hotspot.d.ts +4 -0
- package/dist/commands/finding-security-hotspot.js +175 -0
- package/dist/commands/finding-severity-dist.d.ts +4 -0
- package/dist/commands/finding-severity-dist.js +105 -0
- package/dist/commands/finding-severity-drift.d.ts +4 -0
- package/dist/commands/finding-severity-drift.js +92 -0
- package/dist/commands/finding-severity-heatmap.d.ts +4 -0
- package/dist/commands/finding-severity-heatmap.js +108 -0
- package/dist/commands/finding-severity-histogram.d.ts +4 -0
- package/dist/commands/finding-severity-histogram.js +66 -0
- package/dist/commands/finding-severity-override.d.ts +4 -0
- package/dist/commands/finding-severity-override.js +131 -0
- package/dist/commands/finding-severity-rebalance.d.ts +1 -0
- package/dist/commands/finding-severity-rebalance.js +108 -0
- package/dist/commands/finding-severity-trend.d.ts +4 -0
- package/dist/commands/finding-severity-trend.js +127 -0
- package/dist/commands/finding-similar-match.d.ts +1 -0
- package/dist/commands/finding-similar-match.js +112 -0
- package/dist/commands/finding-snippet.d.ts +4 -0
- package/dist/commands/finding-snippet.js +102 -0
- package/dist/commands/finding-summary-digest.d.ts +7 -0
- package/dist/commands/finding-summary-digest.js +145 -0
- package/dist/commands/finding-suppress-pattern.d.ts +4 -0
- package/dist/commands/finding-suppress-pattern.js +148 -0
- package/dist/commands/finding-suppress.d.ts +4 -0
- package/dist/commands/finding-suppress.js +164 -0
- package/dist/commands/finding-suppression-audit.d.ts +4 -0
- package/dist/commands/finding-suppression-audit.js +137 -0
- package/dist/commands/finding-suppression-list.d.ts +4 -0
- package/dist/commands/finding-suppression-list.js +119 -0
- package/dist/commands/finding-suppression-log.d.ts +4 -0
- package/dist/commands/finding-suppression-log.js +174 -0
- package/dist/commands/finding-time-to-fix.d.ts +1 -0
- package/dist/commands/finding-time-to-fix.js +98 -0
- package/dist/commands/finding-timeline-view.d.ts +4 -0
- package/dist/commands/finding-timeline-view.js +98 -0
- package/dist/commands/finding-timeline.d.ts +4 -0
- package/dist/commands/finding-timeline.js +143 -0
- package/dist/commands/finding-top-offender.d.ts +1 -0
- package/dist/commands/finding-top-offender.js +75 -0
- package/dist/commands/finding-trace.d.ts +4 -0
- package/dist/commands/finding-trace.js +118 -0
- package/dist/commands/finding-trend-alert.d.ts +1 -0
- package/dist/commands/finding-trend-alert.js +126 -0
- package/dist/commands/finding-trend-analysis.d.ts +4 -0
- package/dist/commands/finding-trend-analysis.js +95 -0
- package/dist/commands/finding-trend-forecast.d.ts +4 -0
- package/dist/commands/finding-trend-forecast.js +106 -0
- package/dist/commands/finding-trend-report.d.ts +4 -0
- package/dist/commands/finding-trend-report.js +107 -0
- package/dist/commands/finding-trend.d.ts +4 -0
- package/dist/commands/finding-trend.js +118 -0
- package/dist/commands/fix-pr.d.ts +22 -0
- package/dist/commands/fix-pr.js +286 -0
- package/dist/commands/fix-suggest.d.ts +4 -0
- package/dist/commands/fix-suggest.js +171 -0
- package/dist/commands/fix-verify.d.ts +4 -0
- package/dist/commands/fix-verify.js +123 -0
- package/dist/commands/fix.d.ts +117 -0
- package/dist/commands/fix.js +445 -0
- package/dist/commands/focus-area.d.ts +5 -0
- package/dist/commands/focus-area.js +192 -0
- package/dist/commands/generate.d.ts +7 -0
- package/dist/commands/generate.js +403 -0
- package/dist/commands/governance.d.ts +31 -0
- package/dist/commands/governance.js +202 -0
- package/dist/commands/group-findings.d.ts +22 -0
- package/dist/commands/group-findings.js +154 -0
- package/dist/commands/guided-tour.d.ts +8 -0
- package/dist/commands/guided-tour.js +287 -0
- package/dist/commands/habit-tracker.d.ts +7 -0
- package/dist/commands/habit-tracker.js +194 -0
- package/dist/commands/hallucination-detect.d.ts +4 -0
- package/dist/commands/hallucination-detect.js +350 -0
- package/dist/commands/hallucination-score.d.ts +8 -0
- package/dist/commands/hallucination-score.js +316 -0
- package/dist/commands/help.d.ts +7 -0
- package/dist/commands/help.js +302 -0
- package/dist/commands/hook-install.d.ts +21 -0
- package/dist/commands/hook-install.js +142 -0
- package/dist/commands/hook.d.ts +8 -0
- package/dist/commands/hook.js +145 -0
- package/dist/commands/iac-lint.d.ts +7 -0
- package/dist/commands/iac-lint.js +312 -0
- package/dist/commands/idempotency-audit.d.ts +4 -0
- package/dist/commands/idempotency-audit.js +222 -0
- package/dist/commands/ignore-list.d.ts +18 -0
- package/dist/commands/ignore-list.js +152 -0
- package/dist/commands/impact-scan.d.ts +8 -0
- package/dist/commands/impact-scan.js +281 -0
- package/dist/commands/incident-response.d.ts +7 -0
- package/dist/commands/incident-response.js +254 -0
- package/dist/commands/incremental-review.d.ts +4 -0
- package/dist/commands/incremental-review.js +236 -0
- package/dist/commands/init.d.ts +10 -0
- package/dist/commands/init.js +265 -0
- package/dist/commands/input-guard.d.ts +4 -0
- package/dist/commands/input-guard.js +255 -0
- package/dist/commands/interactive-fix.d.ts +22 -0
- package/dist/commands/interactive-fix.js +139 -0
- package/dist/commands/judge-author.d.ts +7 -0
- package/dist/commands/judge-author.js +260 -0
- package/dist/commands/judge-config.d.ts +4 -0
- package/dist/commands/judge-config.js +151 -0
- package/dist/commands/judge-learn.d.ts +8 -0
- package/dist/commands/judge-learn.js +217 -0
- package/dist/commands/judge-reputation.d.ts +28 -0
- package/dist/commands/judge-reputation.js +198 -0
- package/dist/commands/kb.d.ts +40 -0
- package/dist/commands/kb.js +228 -0
- package/dist/commands/language-packs.d.ts +42 -0
- package/dist/commands/language-packs.js +150 -0
- package/dist/commands/learn.d.ts +26 -0
- package/dist/commands/learn.js +288 -0
- package/dist/commands/learning-path.d.ts +8 -0
- package/dist/commands/learning-path.js +325 -0
- package/dist/commands/license-scan.d.ts +8 -0
- package/dist/commands/license-scan.js +183 -0
- package/dist/commands/llm-benchmark-optimizer.d.ts +78 -0
- package/dist/commands/llm-benchmark-optimizer.js +241 -0
- package/dist/commands/llm-benchmark.d.ts +156 -0
- package/dist/commands/llm-benchmark.js +670 -0
- package/dist/commands/log-quality.d.ts +5 -0
- package/dist/commands/log-quality.js +211 -0
- package/dist/commands/logic-lint.d.ts +4 -0
- package/dist/commands/logic-lint.js +255 -0
- package/dist/commands/lsp.d.ts +23 -0
- package/dist/commands/lsp.js +285 -0
- package/dist/commands/merge-verdict.d.ts +4 -0
- package/dist/commands/merge-verdict.js +287 -0
- package/dist/commands/metrics-dashboard.d.ts +21 -0
- package/dist/commands/metrics-dashboard.js +334 -0
- package/dist/commands/metrics.d.ts +57 -0
- package/dist/commands/metrics.js +241 -0
- package/dist/commands/migration-safety.d.ts +5 -0
- package/dist/commands/migration-safety.js +256 -0
- package/dist/commands/model-report.d.ts +8 -0
- package/dist/commands/model-report.js +194 -0
- package/dist/commands/model-risk.d.ts +27 -0
- package/dist/commands/model-risk.js +220 -0
- package/dist/commands/monorepo.d.ts +37 -0
- package/dist/commands/monorepo.js +232 -0
- package/dist/commands/multi-lang-review.d.ts +4 -0
- package/dist/commands/multi-lang-review.js +230 -0
- package/dist/commands/noise-advisor.d.ts +29 -0
- package/dist/commands/noise-advisor.js +170 -0
- package/dist/commands/notify.d.ts +78 -0
- package/dist/commands/notify.js +324 -0
- package/dist/commands/null-safety-audit.d.ts +5 -0
- package/dist/commands/null-safety-audit.js +221 -0
- package/dist/commands/observability-gap.d.ts +5 -0
- package/dist/commands/observability-gap.js +211 -0
- package/dist/commands/onboard.d.ts +12 -0
- package/dist/commands/onboard.js +178 -0
- package/dist/commands/org-metrics.d.ts +23 -0
- package/dist/commands/org-metrics.js +237 -0
- package/dist/commands/org-policy.d.ts +7 -0
- package/dist/commands/org-policy.js +207 -0
- package/dist/commands/over-abstraction.d.ts +4 -0
- package/dist/commands/over-abstraction.js +307 -0
- package/dist/commands/override.d.ts +61 -0
- package/dist/commands/override.js +268 -0
- package/dist/commands/ownership-map.d.ts +5 -0
- package/dist/commands/ownership-map.js +217 -0
- package/dist/commands/parity.d.ts +30 -0
- package/dist/commands/parity.js +212 -0
- package/dist/commands/pattern-registry.d.ts +22 -0
- package/dist/commands/pattern-registry.js +226 -0
- package/dist/commands/perf-compare.d.ts +8 -0
- package/dist/commands/perf-compare.js +245 -0
- package/dist/commands/perf-hotspot.d.ts +7 -0
- package/dist/commands/perf-hotspot.js +273 -0
- package/dist/commands/phantom-import.d.ts +4 -0
- package/dist/commands/phantom-import.js +260 -0
- package/dist/commands/pii-scan.d.ts +7 -0
- package/dist/commands/pii-scan.js +299 -0
- package/dist/commands/plugin-search.d.ts +39 -0
- package/dist/commands/plugin-search.js +327 -0
- package/dist/commands/plugins.d.ts +12 -0
- package/dist/commands/plugins.js +104 -0
- package/dist/commands/policy-audit.d.ts +52 -0
- package/dist/commands/policy-audit.js +160 -0
- package/dist/commands/pr-quality-gate.d.ts +28 -0
- package/dist/commands/pr-quality-gate.js +207 -0
- package/dist/commands/pr-summary.d.ts +25 -0
- package/dist/commands/pr-summary.js +187 -0
- package/dist/commands/predict.d.ts +7 -0
- package/dist/commands/predict.js +218 -0
- package/dist/commands/privilege-path.d.ts +4 -0
- package/dist/commands/privilege-path.js +233 -0
- package/dist/commands/profile.d.ts +37 -0
- package/dist/commands/profile.js +101 -0
- package/dist/commands/prompt-replay.d.ts +7 -0
- package/dist/commands/prompt-replay.js +176 -0
- package/dist/commands/quality-gate.d.ts +69 -0
- package/dist/commands/quality-gate.js +252 -0
- package/dist/commands/query.d.ts +19 -0
- package/dist/commands/query.js +229 -0
- package/dist/commands/quick-check.d.ts +4 -0
- package/dist/commands/quick-check.js +173 -0
- package/dist/commands/recommend.d.ts +20 -0
- package/dist/commands/recommend.js +282 -0
- package/dist/commands/refactor-safety.d.ts +8 -0
- package/dist/commands/refactor-safety.js +273 -0
- package/dist/commands/reg-watch.d.ts +20 -0
- package/dist/commands/reg-watch.js +219 -0
- package/dist/commands/regression-alert.d.ts +31 -0
- package/dist/commands/regression-alert.js +215 -0
- package/dist/commands/remediation-lib.d.ts +8 -0
- package/dist/commands/remediation-lib.js +265 -0
- package/dist/commands/remediation.d.ts +20 -0
- package/dist/commands/remediation.js +256 -0
- package/dist/commands/report-template.d.ts +16 -0
- package/dist/commands/report-template.js +290 -0
- package/dist/commands/report.d.ts +12 -0
- package/dist/commands/report.js +139 -0
- package/dist/commands/resource-cleanup.d.ts +6 -0
- package/dist/commands/resource-cleanup.js +235 -0
- package/dist/commands/retro.d.ts +22 -0
- package/dist/commands/retro.js +211 -0
- package/dist/commands/retry-pattern-audit.d.ts +5 -0
- package/dist/commands/retry-pattern-audit.js +215 -0
- package/dist/commands/review-ab-test.d.ts +4 -0
- package/dist/commands/review-ab-test.js +224 -0
- package/dist/commands/review-access-log.d.ts +4 -0
- package/dist/commands/review-access-log.js +65 -0
- package/dist/commands/review-action-item-gen.d.ts +1 -0
- package/dist/commands/review-action-item-gen.js +72 -0
- package/dist/commands/review-adoption-metrics.d.ts +4 -0
- package/dist/commands/review-adoption-metrics.js +95 -0
- package/dist/commands/review-adoption-score.d.ts +1 -0
- package/dist/commands/review-adoption-score.js +181 -0
- package/dist/commands/review-ai-feedback-loop.d.ts +1 -0
- package/dist/commands/review-ai-feedback-loop.js +116 -0
- package/dist/commands/review-annotate.d.ts +4 -0
- package/dist/commands/review-annotate.js +122 -0
- package/dist/commands/review-annotation-export.d.ts +4 -0
- package/dist/commands/review-annotation-export.js +105 -0
- package/dist/commands/review-annotation.d.ts +4 -0
- package/dist/commands/review-annotation.js +133 -0
- package/dist/commands/review-api-export.d.ts +4 -0
- package/dist/commands/review-api-export.js +98 -0
- package/dist/commands/review-approval-criteria.d.ts +1 -0
- package/dist/commands/review-approval-criteria.js +99 -0
- package/dist/commands/review-approval-gate.d.ts +7 -0
- package/dist/commands/review-approval-gate.js +190 -0
- package/dist/commands/review-approval.d.ts +4 -0
- package/dist/commands/review-approval.js +133 -0
- package/dist/commands/review-archive-search.d.ts +4 -0
- package/dist/commands/review-archive-search.js +70 -0
- package/dist/commands/review-archive.d.ts +4 -0
- package/dist/commands/review-archive.js +135 -0
- package/dist/commands/review-audit-export.d.ts +4 -0
- package/dist/commands/review-audit-export.js +93 -0
- package/dist/commands/review-audit-log.d.ts +4 -0
- package/dist/commands/review-audit-log.js +140 -0
- package/dist/commands/review-audit-trail.d.ts +4 -0
- package/dist/commands/review-audit-trail.js +96 -0
- package/dist/commands/review-auto-merge.d.ts +4 -0
- package/dist/commands/review-auto-merge.js +175 -0
- package/dist/commands/review-badge.d.ts +4 -0
- package/dist/commands/review-badge.js +152 -0
- package/dist/commands/review-batch-files.d.ts +4 -0
- package/dist/commands/review-batch-files.js +82 -0
- package/dist/commands/review-batch-mode.d.ts +4 -0
- package/dist/commands/review-batch-mode.js +97 -0
- package/dist/commands/review-batch-run.d.ts +4 -0
- package/dist/commands/review-batch-run.js +149 -0
- package/dist/commands/review-benchmark-self.d.ts +4 -0
- package/dist/commands/review-benchmark-self.js +140 -0
- package/dist/commands/review-blame-map.d.ts +4 -0
- package/dist/commands/review-blame-map.js +100 -0
- package/dist/commands/review-branch-compare.d.ts +4 -0
- package/dist/commands/review-branch-compare.js +108 -0
- package/dist/commands/review-branch-policy.d.ts +4 -0
- package/dist/commands/review-branch-policy.js +102 -0
- package/dist/commands/review-bulk-action.d.ts +4 -0
- package/dist/commands/review-bulk-action.js +109 -0
- package/dist/commands/review-bulk-apply.d.ts +4 -0
- package/dist/commands/review-bulk-apply.js +102 -0
- package/dist/commands/review-cache-clear.d.ts +4 -0
- package/dist/commands/review-cache-clear.js +160 -0
- package/dist/commands/review-cache-warm.d.ts +4 -0
- package/dist/commands/review-cache-warm.js +70 -0
- package/dist/commands/review-cache.d.ts +22 -0
- package/dist/commands/review-cache.js +134 -0
- package/dist/commands/review-changelog-entry.d.ts +7 -0
- package/dist/commands/review-changelog-entry.js +109 -0
- package/dist/commands/review-changelog-gen.d.ts +4 -0
- package/dist/commands/review-changelog-gen.js +117 -0
- package/dist/commands/review-changelog-impact.d.ts +1 -0
- package/dist/commands/review-changelog-impact.js +89 -0
- package/dist/commands/review-checklist.d.ts +4 -0
- package/dist/commands/review-checklist.js +144 -0
- package/dist/commands/review-checkpoint.d.ts +4 -0
- package/dist/commands/review-checkpoint.js +163 -0
- package/dist/commands/review-ci-gate.d.ts +4 -0
- package/dist/commands/review-ci-gate.js +114 -0
- package/dist/commands/review-ci-insight.d.ts +1 -0
- package/dist/commands/review-ci-insight.js +100 -0
- package/dist/commands/review-ci-integration.d.ts +4 -0
- package/dist/commands/review-ci-integration.js +125 -0
- package/dist/commands/review-ci-status.d.ts +4 -0
- package/dist/commands/review-ci-status.js +200 -0
- package/dist/commands/review-cicd-integrate.d.ts +4 -0
- package/dist/commands/review-cicd-integrate.js +122 -0
- package/dist/commands/review-code-health-score.d.ts +1 -0
- package/dist/commands/review-code-health-score.js +100 -0
- package/dist/commands/review-code-owner.d.ts +7 -0
- package/dist/commands/review-code-owner.js +164 -0
- package/dist/commands/review-code-ownership.d.ts +1 -0
- package/dist/commands/review-code-ownership.js +88 -0
- package/dist/commands/review-comment.d.ts +4 -0
- package/dist/commands/review-comment.js +165 -0
- package/dist/commands/review-commit-hook.d.ts +7 -0
- package/dist/commands/review-commit-hook.js +134 -0
- package/dist/commands/review-commit-quality.d.ts +1 -0
- package/dist/commands/review-commit-quality.js +94 -0
- package/dist/commands/review-comparative.d.ts +4 -0
- package/dist/commands/review-comparative.js +149 -0
- package/dist/commands/review-compare-version.d.ts +4 -0
- package/dist/commands/review-compare-version.js +108 -0
- package/dist/commands/review-compare.d.ts +4 -0
- package/dist/commands/review-compare.js +200 -0
- package/dist/commands/review-compliance-check.d.ts +4 -0
- package/dist/commands/review-compliance-check.js +202 -0
- package/dist/commands/review-compliance-gate.d.ts +4 -0
- package/dist/commands/review-compliance-gate.js +151 -0
- package/dist/commands/review-compliance-map.d.ts +4 -0
- package/dist/commands/review-compliance-map.js +110 -0
- package/dist/commands/review-compliance-report.d.ts +4 -0
- package/dist/commands/review-compliance-report.js +127 -0
- package/dist/commands/review-confidence-explain.d.ts +1 -0
- package/dist/commands/review-confidence-explain.js +99 -0
- package/dist/commands/review-config-diff.d.ts +4 -0
- package/dist/commands/review-config-diff.js +108 -0
- package/dist/commands/review-config-export.d.ts +4 -0
- package/dist/commands/review-config-export.js +124 -0
- package/dist/commands/review-config-health.d.ts +1 -0
- package/dist/commands/review-config-health.js +172 -0
- package/dist/commands/review-config-migrate.d.ts +4 -0
- package/dist/commands/review-config-migrate.js +123 -0
- package/dist/commands/review-config-template.d.ts +4 -0
- package/dist/commands/review-config-template.js +112 -0
- package/dist/commands/review-config-validate.d.ts +4 -0
- package/dist/commands/review-config-validate.js +110 -0
- package/dist/commands/review-contract.d.ts +4 -0
- package/dist/commands/review-contract.js +199 -0
- package/dist/commands/review-coverage-gap.d.ts +4 -0
- package/dist/commands/review-coverage-gap.js +120 -0
- package/dist/commands/review-coverage-map.d.ts +4 -0
- package/dist/commands/review-coverage-map.js +194 -0
- package/dist/commands/review-custom-judge-config.d.ts +4 -0
- package/dist/commands/review-custom-judge-config.js +103 -0
- package/dist/commands/review-custom-judge.d.ts +4 -0
- package/dist/commands/review-custom-judge.js +182 -0
- package/dist/commands/review-custom-prompt.d.ts +4 -0
- package/dist/commands/review-custom-prompt.js +170 -0
- package/dist/commands/review-custom-rule.d.ts +4 -0
- package/dist/commands/review-custom-rule.js +169 -0
- package/dist/commands/review-dashboard-data.d.ts +4 -0
- package/dist/commands/review-dashboard-data.js +142 -0
- package/dist/commands/review-dashboard.d.ts +4 -0
- package/dist/commands/review-dashboard.js +140 -0
- package/dist/commands/review-data-retention.d.ts +4 -0
- package/dist/commands/review-data-retention.js +119 -0
- package/dist/commands/review-dependency-graph.d.ts +4 -0
- package/dist/commands/review-dependency-graph.js +94 -0
- package/dist/commands/review-dependency-review.d.ts +1 -0
- package/dist/commands/review-dependency-review.js +104 -0
- package/dist/commands/review-deployment-gate.d.ts +4 -0
- package/dist/commands/review-deployment-gate.js +94 -0
- package/dist/commands/review-depth.d.ts +4 -0
- package/dist/commands/review-depth.js +142 -0
- package/dist/commands/review-diff-annotate.d.ts +4 -0
- package/dist/commands/review-diff-annotate.js +104 -0
- package/dist/commands/review-diff-context.d.ts +4 -0
- package/dist/commands/review-diff-context.js +158 -0
- package/dist/commands/review-diff-highlight.d.ts +4 -0
- package/dist/commands/review-diff-highlight.js +179 -0
- package/dist/commands/review-diff-stats.d.ts +4 -0
- package/dist/commands/review-diff-stats.js +90 -0
- package/dist/commands/review-diff-summary.d.ts +4 -0
- package/dist/commands/review-diff-summary.js +154 -0
- package/dist/commands/review-digest-gen.d.ts +1 -0
- package/dist/commands/review-digest-gen.js +100 -0
- package/dist/commands/review-digest.d.ts +4 -0
- package/dist/commands/review-digest.js +265 -0
- package/dist/commands/review-dry-run.d.ts +4 -0
- package/dist/commands/review-dry-run.js +120 -0
- package/dist/commands/review-engagement-score.d.ts +1 -0
- package/dist/commands/review-engagement-score.js +111 -0
- package/dist/commands/review-env-check.d.ts +4 -0
- package/dist/commands/review-env-check.js +115 -0
- package/dist/commands/review-environment-config.d.ts +4 -0
- package/dist/commands/review-environment-config.js +102 -0
- package/dist/commands/review-escalation-path.d.ts +1 -0
- package/dist/commands/review-escalation-path.js +86 -0
- package/dist/commands/review-exclude-vendor.d.ts +4 -0
- package/dist/commands/review-exclude-vendor.js +158 -0
- package/dist/commands/review-explain.d.ts +5 -0
- package/dist/commands/review-explain.js +194 -0
- package/dist/commands/review-export-pdf.d.ts +7 -0
- package/dist/commands/review-export-pdf.js +131 -0
- package/dist/commands/review-export.d.ts +4 -0
- package/dist/commands/review-export.js +179 -0
- package/dist/commands/review-feedback-loop.d.ts +4 -0
- package/dist/commands/review-feedback-loop.js +113 -0
- package/dist/commands/review-feedback-summary.d.ts +1 -0
- package/dist/commands/review-feedback-summary.js +130 -0
- package/dist/commands/review-feedback.d.ts +4 -0
- package/dist/commands/review-feedback.js +145 -0
- package/dist/commands/review-file-complexity.d.ts +4 -0
- package/dist/commands/review-file-complexity.js +137 -0
- package/dist/commands/review-file-filter.d.ts +4 -0
- package/dist/commands/review-file-filter.js +121 -0
- package/dist/commands/review-file-stats.d.ts +4 -0
- package/dist/commands/review-file-stats.js +130 -0
- package/dist/commands/review-filter.d.ts +4 -0
- package/dist/commands/review-filter.js +161 -0
- package/dist/commands/review-finding-link.d.ts +7 -0
- package/dist/commands/review-finding-link.js +115 -0
- package/dist/commands/review-focus-area.d.ts +1 -0
- package/dist/commands/review-focus-area.js +96 -0
- package/dist/commands/review-focus.d.ts +4 -0
- package/dist/commands/review-focus.js +196 -0
- package/dist/commands/review-gate-config.d.ts +4 -0
- package/dist/commands/review-gate-config.js +153 -0
- package/dist/commands/review-gate.d.ts +4 -0
- package/dist/commands/review-gate.js +212 -0
- package/dist/commands/review-goal-track.d.ts +1 -0
- package/dist/commands/review-goal-track.js +123 -0
- package/dist/commands/review-guardrail.d.ts +4 -0
- package/dist/commands/review-guardrail.js +155 -0
- package/dist/commands/review-handoff.d.ts +4 -0
- package/dist/commands/review-handoff.js +208 -0
- package/dist/commands/review-health-check.d.ts +4 -0
- package/dist/commands/review-health-check.js +148 -0
- package/dist/commands/review-health-trend.d.ts +1 -0
- package/dist/commands/review-health-trend.js +107 -0
- package/dist/commands/review-history-compare.d.ts +4 -0
- package/dist/commands/review-history-compare.js +93 -0
- package/dist/commands/review-history-search.d.ts +4 -0
- package/dist/commands/review-history-search.js +214 -0
- package/dist/commands/review-ide-sync.d.ts +4 -0
- package/dist/commands/review-ide-sync.js +91 -0
- package/dist/commands/review-ignore-path.d.ts +4 -0
- package/dist/commands/review-ignore-path.js +147 -0
- package/dist/commands/review-ignore-pattern.d.ts +5 -0
- package/dist/commands/review-ignore-pattern.js +138 -0
- package/dist/commands/review-incident-link.d.ts +4 -0
- package/dist/commands/review-incident-link.js +93 -0
- package/dist/commands/review-incremental.d.ts +4 -0
- package/dist/commands/review-incremental.js +128 -0
- package/dist/commands/review-integration-health.d.ts +4 -0
- package/dist/commands/review-integration-health.js +84 -0
- package/dist/commands/review-integration-test.d.ts +4 -0
- package/dist/commands/review-integration-test.js +145 -0
- package/dist/commands/review-integration.d.ts +4 -0
- package/dist/commands/review-integration.js +236 -0
- package/dist/commands/review-interactive.d.ts +4 -0
- package/dist/commands/review-interactive.js +85 -0
- package/dist/commands/review-knowledge-capture.d.ts +1 -0
- package/dist/commands/review-knowledge-capture.js +94 -0
- package/dist/commands/review-language-profile.d.ts +4 -0
- package/dist/commands/review-language-profile.js +72 -0
- package/dist/commands/review-language-stats.d.ts +4 -0
- package/dist/commands/review-language-stats.js +152 -0
- package/dist/commands/review-lock-file.d.ts +4 -0
- package/dist/commands/review-lock-file.js +153 -0
- package/dist/commands/review-lock.d.ts +4 -0
- package/dist/commands/review-lock.js +107 -0
- package/dist/commands/review-log.d.ts +22 -0
- package/dist/commands/review-log.js +164 -0
- package/dist/commands/review-mentor-suggest.d.ts +1 -0
- package/dist/commands/review-mentor-suggest.js +112 -0
- package/dist/commands/review-merge-check.d.ts +4 -0
- package/dist/commands/review-merge-check.js +101 -0
- package/dist/commands/review-merge-config.d.ts +4 -0
- package/dist/commands/review-merge-config.js +119 -0
- package/dist/commands/review-merge-readiness.d.ts +1 -0
- package/dist/commands/review-merge-readiness.js +90 -0
- package/dist/commands/review-merge-request.d.ts +4 -0
- package/dist/commands/review-merge-request.js +95 -0
- package/dist/commands/review-merge.d.ts +4 -0
- package/dist/commands/review-merge.js +145 -0
- package/dist/commands/review-metric-export.d.ts +4 -0
- package/dist/commands/review-metric-export.js +62 -0
- package/dist/commands/review-milestone.d.ts +4 -0
- package/dist/commands/review-milestone.js +136 -0
- package/dist/commands/review-multi-repo-sync.d.ts +4 -0
- package/dist/commands/review-multi-repo-sync.js +115 -0
- package/dist/commands/review-multi-repo.d.ts +4 -0
- package/dist/commands/review-multi-repo.js +145 -0
- package/dist/commands/review-note.d.ts +4 -0
- package/dist/commands/review-note.js +104 -0
- package/dist/commands/review-notification-config.d.ts +4 -0
- package/dist/commands/review-notification-config.js +122 -0
- package/dist/commands/review-notification-digest.d.ts +4 -0
- package/dist/commands/review-notification-digest.js +64 -0
- package/dist/commands/review-notification.d.ts +4 -0
- package/dist/commands/review-notification.js +126 -0
- package/dist/commands/review-notify.d.ts +4 -0
- package/dist/commands/review-notify.js +143 -0
- package/dist/commands/review-offline.d.ts +4 -0
- package/dist/commands/review-offline.js +125 -0
- package/dist/commands/review-onboard-checklist.d.ts +4 -0
- package/dist/commands/review-onboard-checklist.js +119 -0
- package/dist/commands/review-onboard-wizard.d.ts +4 -0
- package/dist/commands/review-onboard-wizard.js +92 -0
- package/dist/commands/review-onboard.d.ts +4 -0
- package/dist/commands/review-onboard.js +154 -0
- package/dist/commands/review-onboarding-check.d.ts +1 -0
- package/dist/commands/review-onboarding-check.js +93 -0
- package/dist/commands/review-org-dashboard.d.ts +4 -0
- package/dist/commands/review-org-dashboard.js +68 -0
- package/dist/commands/review-output-filter.d.ts +4 -0
- package/dist/commands/review-output-filter.js +112 -0
- package/dist/commands/review-output-format.d.ts +4 -0
- package/dist/commands/review-output-format.js +144 -0
- package/dist/commands/review-output-transform.d.ts +4 -0
- package/dist/commands/review-output-transform.js +119 -0
- package/dist/commands/review-owner.d.ts +4 -0
- package/dist/commands/review-owner.js +129 -0
- package/dist/commands/review-parallel-diff.d.ts +4 -0
- package/dist/commands/review-parallel-diff.js +146 -0
- package/dist/commands/review-parallel-files.d.ts +7 -0
- package/dist/commands/review-parallel-files.js +134 -0
- package/dist/commands/review-parallel-run.d.ts +4 -0
- package/dist/commands/review-parallel-run.js +116 -0
- package/dist/commands/review-parallel.d.ts +4 -0
- package/dist/commands/review-parallel.js +164 -0
- package/dist/commands/review-perf-profile.d.ts +4 -0
- package/dist/commands/review-perf-profile.js +98 -0
- package/dist/commands/review-permission-model.d.ts +4 -0
- package/dist/commands/review-permission-model.js +149 -0
- package/dist/commands/review-pipeline-status.d.ts +4 -0
- package/dist/commands/review-pipeline-status.js +54 -0
- package/dist/commands/review-plugin-config.d.ts +4 -0
- package/dist/commands/review-plugin-config.js +167 -0
- package/dist/commands/review-plugin-list.d.ts +4 -0
- package/dist/commands/review-plugin-list.js +99 -0
- package/dist/commands/review-plugin-manage.d.ts +4 -0
- package/dist/commands/review-plugin-manage.js +137 -0
- package/dist/commands/review-plugin-status.d.ts +4 -0
- package/dist/commands/review-plugin-status.js +53 -0
- package/dist/commands/review-policy-enforce.d.ts +1 -0
- package/dist/commands/review-policy-enforce.js +92 -0
- package/dist/commands/review-policy-engine.d.ts +4 -0
- package/dist/commands/review-policy-engine.js +135 -0
- package/dist/commands/review-pr-comment-gen.d.ts +4 -0
- package/dist/commands/review-pr-comment-gen.js +62 -0
- package/dist/commands/review-pr-comment.d.ts +4 -0
- package/dist/commands/review-pr-comment.js +106 -0
- package/dist/commands/review-pr-label-suggest.d.ts +1 -0
- package/dist/commands/review-pr-label-suggest.js +77 -0
- package/dist/commands/review-pr-size-check.d.ts +1 -0
- package/dist/commands/review-pr-size-check.js +98 -0
- package/dist/commands/review-pr-template.d.ts +4 -0
- package/dist/commands/review-pr-template.js +104 -0
- package/dist/commands/review-preset-save.d.ts +4 -0
- package/dist/commands/review-preset-save.js +159 -0
- package/dist/commands/review-priority.d.ts +4 -0
- package/dist/commands/review-priority.js +157 -0
- package/dist/commands/review-profile.d.ts +4 -0
- package/dist/commands/review-profile.js +168 -0
- package/dist/commands/review-progress-bar.d.ts +4 -0
- package/dist/commands/review-progress-bar.js +157 -0
- package/dist/commands/review-progress-report.d.ts +1 -0
- package/dist/commands/review-progress-report.js +95 -0
- package/dist/commands/review-progress-track.d.ts +4 -0
- package/dist/commands/review-progress-track.js +94 -0
- package/dist/commands/review-quality-baseline.d.ts +1 -0
- package/dist/commands/review-quality-baseline.js +134 -0
- package/dist/commands/review-quality-gate.d.ts +1 -0
- package/dist/commands/review-quality-gate.js +86 -0
- package/dist/commands/review-quality-score.d.ts +4 -0
- package/dist/commands/review-quality-score.js +127 -0
- package/dist/commands/review-quality-trend.d.ts +4 -0
- package/dist/commands/review-quality-trend.js +57 -0
- package/dist/commands/review-queue.d.ts +33 -0
- package/dist/commands/review-queue.js +225 -0
- package/dist/commands/review-quickstart.d.ts +4 -0
- package/dist/commands/review-quickstart.js +107 -0
- package/dist/commands/review-quota-check.d.ts +4 -0
- package/dist/commands/review-quota-check.js +97 -0
- package/dist/commands/review-quota.d.ts +4 -0
- package/dist/commands/review-quota.js +126 -0
- package/dist/commands/review-rate-limit.d.ts +4 -0
- package/dist/commands/review-rate-limit.js +130 -0
- package/dist/commands/review-readiness-check.d.ts +1 -0
- package/dist/commands/review-readiness-check.js +98 -0
- package/dist/commands/review-receipt.d.ts +4 -0
- package/dist/commands/review-receipt.js +220 -0
- package/dist/commands/review-release-gate.d.ts +1 -0
- package/dist/commands/review-release-gate.js +81 -0
- package/dist/commands/review-replay.d.ts +8 -0
- package/dist/commands/review-replay.js +264 -0
- package/dist/commands/review-repo-onboard.d.ts +4 -0
- package/dist/commands/review-repo-onboard.js +114 -0
- package/dist/commands/review-report-archive.d.ts +4 -0
- package/dist/commands/review-report-archive.js +100 -0
- package/dist/commands/review-report-merge.d.ts +4 -0
- package/dist/commands/review-report-merge.js +90 -0
- package/dist/commands/review-report-pdf.d.ts +4 -0
- package/dist/commands/review-report-pdf.js +163 -0
- package/dist/commands/review-report-schedule.d.ts +4 -0
- package/dist/commands/review-report-schedule.js +96 -0
- package/dist/commands/review-retrospective.d.ts +1 -0
- package/dist/commands/review-retrospective.js +118 -0
- package/dist/commands/review-retry.d.ts +4 -0
- package/dist/commands/review-retry.js +91 -0
- package/dist/commands/review-review-cadence.d.ts +1 -0
- package/dist/commands/review-review-cadence.js +85 -0
- package/dist/commands/review-review-comments.d.ts +4 -0
- package/dist/commands/review-review-comments.js +84 -0
- package/dist/commands/review-reviewer-match.d.ts +1 -0
- package/dist/commands/review-reviewer-match.js +108 -0
- package/dist/commands/review-risk-matrix.d.ts +1 -0
- package/dist/commands/review-risk-matrix.js +96 -0
- package/dist/commands/review-risk-score.d.ts +4 -0
- package/dist/commands/review-risk-score.js +156 -0
- package/dist/commands/review-role-assignment.d.ts +4 -0
- package/dist/commands/review-role-assignment.js +98 -0
- package/dist/commands/review-rollback.d.ts +4 -0
- package/dist/commands/review-rollback.js +171 -0
- package/dist/commands/review-rollout-plan.d.ts +4 -0
- package/dist/commands/review-rollout-plan.js +123 -0
- package/dist/commands/review-rule-filter.d.ts +4 -0
- package/dist/commands/review-rule-filter.js +116 -0
- package/dist/commands/review-rule-stats.d.ts +4 -0
- package/dist/commands/review-rule-stats.js +161 -0
- package/dist/commands/review-sandbox.d.ts +4 -0
- package/dist/commands/review-sandbox.js +191 -0
- package/dist/commands/review-schedule.d.ts +4 -0
- package/dist/commands/review-schedule.js +169 -0
- package/dist/commands/review-scope-limit.d.ts +4 -0
- package/dist/commands/review-scope-limit.js +100 -0
- package/dist/commands/review-scope-lock.d.ts +7 -0
- package/dist/commands/review-scope-lock.js +138 -0
- package/dist/commands/review-scope-select.d.ts +4 -0
- package/dist/commands/review-scope-select.js +98 -0
- package/dist/commands/review-scope-suggest.d.ts +1 -0
- package/dist/commands/review-scope-suggest.js +112 -0
- package/dist/commands/review-scope.d.ts +4 -0
- package/dist/commands/review-scope.js +197 -0
- package/dist/commands/review-score-history.d.ts +4 -0
- package/dist/commands/review-score-history.js +137 -0
- package/dist/commands/review-security-posture.d.ts +1 -0
- package/dist/commands/review-security-posture.js +105 -0
- package/dist/commands/review-session-replay.d.ts +4 -0
- package/dist/commands/review-session-replay.js +81 -0
- package/dist/commands/review-session-save.d.ts +4 -0
- package/dist/commands/review-session-save.js +173 -0
- package/dist/commands/review-session.d.ts +4 -0
- package/dist/commands/review-session.js +150 -0
- package/dist/commands/review-skip-list.d.ts +4 -0
- package/dist/commands/review-skip-list.js +135 -0
- package/dist/commands/review-skip-rule.d.ts +4 -0
- package/dist/commands/review-skip-rule.js +105 -0
- package/dist/commands/review-sla-config.d.ts +4 -0
- package/dist/commands/review-sla-config.js +88 -0
- package/dist/commands/review-slack-format.d.ts +4 -0
- package/dist/commands/review-slack-format.js +113 -0
- package/dist/commands/review-snapshot-diff.d.ts +4 -0
- package/dist/commands/review-snapshot-diff.js +100 -0
- package/dist/commands/review-sprint-plan.d.ts +1 -0
- package/dist/commands/review-sprint-plan.js +79 -0
- package/dist/commands/review-stakeholder-notify.d.ts +1 -0
- package/dist/commands/review-stakeholder-notify.js +134 -0
- package/dist/commands/review-stakeholder-report.d.ts +4 -0
- package/dist/commands/review-stakeholder-report.js +75 -0
- package/dist/commands/review-stale-finding-clean.d.ts +1 -0
- package/dist/commands/review-stale-finding-clean.js +81 -0
- package/dist/commands/review-standup.d.ts +4 -0
- package/dist/commands/review-standup.js +95 -0
- package/dist/commands/review-stats.d.ts +4 -0
- package/dist/commands/review-stats.js +175 -0
- package/dist/commands/review-status-badge.d.ts +4 -0
- package/dist/commands/review-status-badge.js +120 -0
- package/dist/commands/review-streak.d.ts +4 -0
- package/dist/commands/review-streak.js +150 -0
- package/dist/commands/review-summary-dashboard.d.ts +4 -0
- package/dist/commands/review-summary-dashboard.js +96 -0
- package/dist/commands/review-summary-email.d.ts +4 -0
- package/dist/commands/review-summary-email.js +102 -0
- package/dist/commands/review-summary.d.ts +4 -0
- package/dist/commands/review-summary.js +174 -0
- package/dist/commands/review-tag-manager.d.ts +4 -0
- package/dist/commands/review-tag-manager.js +128 -0
- package/dist/commands/review-tag.d.ts +4 -0
- package/dist/commands/review-tag.js +136 -0
- package/dist/commands/review-team-analytics.d.ts +1 -0
- package/dist/commands/review-team-analytics.js +94 -0
- package/dist/commands/review-team-assign.d.ts +7 -0
- package/dist/commands/review-team-assign.js +211 -0
- package/dist/commands/review-team-coverage.d.ts +1 -0
- package/dist/commands/review-team-coverage.js +95 -0
- package/dist/commands/review-team-dashboard.d.ts +4 -0
- package/dist/commands/review-team-dashboard.js +98 -0
- package/dist/commands/review-team-rotation.d.ts +1 -0
- package/dist/commands/review-team-rotation.js +99 -0
- package/dist/commands/review-team-skill-map.d.ts +1 -0
- package/dist/commands/review-team-skill-map.js +102 -0
- package/dist/commands/review-team-stats.d.ts +4 -0
- package/dist/commands/review-team-stats.js +97 -0
- package/dist/commands/review-team-summary.d.ts +4 -0
- package/dist/commands/review-team-summary.js +155 -0
- package/dist/commands/review-team-velocity.d.ts +1 -0
- package/dist/commands/review-team-velocity.js +103 -0
- package/dist/commands/review-template-export.d.ts +4 -0
- package/dist/commands/review-template-export.js +146 -0
- package/dist/commands/review-template-library.d.ts +4 -0
- package/dist/commands/review-template-library.js +155 -0
- package/dist/commands/review-template-suggest.d.ts +1 -0
- package/dist/commands/review-template-suggest.js +119 -0
- package/dist/commands/review-template.d.ts +4 -0
- package/dist/commands/review-template.js +212 -0
- package/dist/commands/review-tenant-config.d.ts +4 -0
- package/dist/commands/review-tenant-config.js +116 -0
- package/dist/commands/review-threshold-tune.d.ts +4 -0
- package/dist/commands/review-threshold-tune.js +135 -0
- package/dist/commands/review-timeline.d.ts +4 -0
- package/dist/commands/review-timeline.js +76 -0
- package/dist/commands/review-token-budget.d.ts +4 -0
- package/dist/commands/review-token-budget.js +117 -0
- package/dist/commands/review-velocity-track.d.ts +1 -0
- package/dist/commands/review-velocity-track.js +94 -0
- package/dist/commands/review-watch-mode.d.ts +7 -0
- package/dist/commands/review-watch-mode.js +132 -0
- package/dist/commands/review-webhook-dispatch.d.ts +4 -0
- package/dist/commands/review-webhook-dispatch.js +99 -0
- package/dist/commands/review-webhook-notify.d.ts +4 -0
- package/dist/commands/review-webhook-notify.js +145 -0
- package/dist/commands/review-webhook.d.ts +4 -0
- package/dist/commands/review-webhook.js +140 -0
- package/dist/commands/review-whitelist.d.ts +4 -0
- package/dist/commands/review-whitelist.js +150 -0
- package/dist/commands/review-workflow-suggest.d.ts +1 -0
- package/dist/commands/review-workflow-suggest.js +129 -0
- package/dist/commands/review-workload-balance.d.ts +1 -0
- package/dist/commands/review-workload-balance.js +86 -0
- package/dist/commands/review-workspace-init.d.ts +4 -0
- package/dist/commands/review-workspace-init.js +104 -0
- package/dist/commands/review-workspace-scan.d.ts +4 -0
- package/dist/commands/review-workspace-scan.js +144 -0
- package/dist/commands/review.d.ts +155 -0
- package/dist/commands/review.js +1114 -0
- package/dist/commands/risk-heatmap.d.ts +7 -0
- package/dist/commands/risk-heatmap.js +223 -0
- package/dist/commands/rollback-safety.d.ts +4 -0
- package/dist/commands/rollback-safety.js +191 -0
- package/dist/commands/rule-catalog.d.ts +4 -0
- package/dist/commands/rule-catalog.js +128 -0
- package/dist/commands/rule-metrics.d.ts +43 -0
- package/dist/commands/rule-metrics.js +113 -0
- package/dist/commands/rule-owner.d.ts +30 -0
- package/dist/commands/rule-owner.js +181 -0
- package/dist/commands/rule-share.d.ts +34 -0
- package/dist/commands/rule-share.js +202 -0
- package/dist/commands/rule-test.d.ts +4 -0
- package/dist/commands/rule-test.js +201 -0
- package/dist/commands/rule.d.ts +114 -0
- package/dist/commands/rule.js +295 -0
- package/dist/commands/sbom-export.d.ts +7 -0
- package/dist/commands/sbom-export.js +161 -0
- package/dist/commands/scaffold-plugin.d.ts +15 -0
- package/dist/commands/scaffold-plugin.js +270 -0
- package/dist/commands/secret-age.d.ts +5 -0
- package/dist/commands/secret-age.js +214 -0
- package/dist/commands/secret-scan.d.ts +7 -0
- package/dist/commands/secret-scan.js +244 -0
- package/dist/commands/security-maturity.d.ts +7 -0
- package/dist/commands/security-maturity.js +312 -0
- package/dist/commands/security-theater.d.ts +4 -0
- package/dist/commands/security-theater.js +278 -0
- package/dist/commands/setup-wizard.d.ts +4 -0
- package/dist/commands/setup-wizard.js +174 -0
- package/dist/commands/severity-tune.d.ts +4 -0
- package/dist/commands/severity-tune.js +208 -0
- package/dist/commands/sla-track.d.ts +56 -0
- package/dist/commands/sla-track.js +268 -0
- package/dist/commands/smart-output.d.ts +38 -0
- package/dist/commands/smart-output.js +175 -0
- package/dist/commands/smart-select.d.ts +26 -0
- package/dist/commands/smart-select.js +345 -0
- package/dist/commands/snapshot.d.ts +139 -0
- package/dist/commands/snapshot.js +478 -0
- package/dist/commands/snippet-eval.d.ts +7 -0
- package/dist/commands/snippet-eval.js +223 -0
- package/dist/commands/spec-conform.d.ts +4 -0
- package/dist/commands/spec-conform.js +304 -0
- package/dist/commands/stale-pattern.d.ts +4 -0
- package/dist/commands/stale-pattern.js +293 -0
- package/dist/commands/state-integrity.d.ts +4 -0
- package/dist/commands/state-integrity.js +283 -0
- package/dist/commands/suppress.d.ts +39 -0
- package/dist/commands/suppress.js +203 -0
- package/dist/commands/team-config.d.ts +4 -0
- package/dist/commands/team-config.js +234 -0
- package/dist/commands/team-leaderboard.d.ts +24 -0
- package/dist/commands/team-leaderboard.js +227 -0
- package/dist/commands/team-rules-sync.d.ts +7 -0
- package/dist/commands/team-rules-sync.js +250 -0
- package/dist/commands/team-trust.d.ts +7 -0
- package/dist/commands/team-trust.js +174 -0
- package/dist/commands/test-correlate.d.ts +7 -0
- package/dist/commands/test-correlate.js +221 -0
- package/dist/commands/test-isolation.d.ts +5 -0
- package/dist/commands/test-isolation.js +234 -0
- package/dist/commands/test-quality.d.ts +5 -0
- package/dist/commands/test-quality.js +160 -0
- package/dist/commands/test-suggest.d.ts +8 -0
- package/dist/commands/test-suggest.js +247 -0
- package/dist/commands/ticket-sync.d.ts +25 -0
- package/dist/commands/ticket-sync.js +235 -0
- package/dist/commands/timeout-audit.d.ts +4 -0
- package/dist/commands/timeout-audit.js +210 -0
- package/dist/commands/trace.d.ts +64 -0
- package/dist/commands/trace.js +245 -0
- package/dist/commands/trend-report.d.ts +4 -0
- package/dist/commands/trend-report.js +148 -0
- package/dist/commands/triage.d.ts +15 -0
- package/dist/commands/triage.js +171 -0
- package/dist/commands/trust-adaptive.d.ts +8 -0
- package/dist/commands/trust-adaptive.js +193 -0
- package/dist/commands/trust-ramp.d.ts +29 -0
- package/dist/commands/trust-ramp.js +189 -0
- package/dist/commands/tune.d.ts +24 -0
- package/dist/commands/tune.js +380 -0
- package/dist/commands/type-boundary.d.ts +4 -0
- package/dist/commands/type-boundary.js +235 -0
- package/dist/commands/upload.d.ts +13 -0
- package/dist/commands/upload.js +172 -0
- package/dist/commands/validate-config.d.ts +16 -0
- package/dist/commands/validate-config.js +267 -0
- package/dist/commands/vendor-lock-detect.d.ts +7 -0
- package/dist/commands/vendor-lock-detect.js +288 -0
- package/dist/commands/vote.d.ts +31 -0
- package/dist/commands/vote.js +200 -0
- package/dist/commands/warm-cache.d.ts +30 -0
- package/dist/commands/warm-cache.js +165 -0
- package/dist/commands/watch-judge.d.ts +7 -0
- package/dist/commands/watch-judge.js +179 -0
- package/dist/commands/watch.d.ts +22 -0
- package/dist/commands/watch.js +147 -0
- package/dist/comparison.d.ts +67 -0
- package/dist/comparison.js +253 -0
- package/dist/config.d.ts +108 -0
- package/dist/config.js +694 -0
- package/dist/context/context-snippets.d.ts +15 -0
- package/dist/context/context-snippets.js +36 -0
- package/dist/context/embedding-cache.d.ts +30 -0
- package/dist/context/embedding-cache.js +48 -0
- package/dist/data-adapter.d.ts +123 -0
- package/dist/data-adapter.js +212 -0
- package/dist/dedup.d.ts +105 -0
- package/dist/dedup.js +606 -0
- package/dist/disk-cache.d.ts +59 -0
- package/dist/disk-cache.js +236 -0
- package/dist/errors.d.ts +43 -0
- package/dist/errors.js +63 -0
- package/dist/escalation.d.ts +100 -0
- package/dist/escalation.js +292 -0
- package/dist/evaluation-session.d.ts +74 -0
- package/dist/evaluation-session.js +152 -0
- package/dist/evaluators/accessibility.d.ts +2 -0
- package/dist/evaluators/accessibility.js +559 -0
- package/dist/evaluators/agent-instructions.d.ts +2 -0
- package/dist/evaluators/agent-instructions.js +214 -0
- package/dist/evaluators/ai-code-safety.d.ts +8 -0
- package/dist/evaluators/ai-code-safety.js +410 -0
- package/dist/evaluators/api-contract.d.ts +9 -0
- package/dist/evaluators/api-contract.js +203 -0
- package/dist/evaluators/api-design.d.ts +2 -0
- package/dist/evaluators/api-design.js +260 -0
- package/dist/evaluators/app-builder.d.ts +33 -0
- package/dist/evaluators/app-builder.js +155 -0
- package/dist/evaluators/authentication.d.ts +2 -0
- package/dist/evaluators/authentication.js +455 -0
- package/dist/evaluators/backwards-compatibility.d.ts +2 -0
- package/dist/evaluators/backwards-compatibility.js +168 -0
- package/dist/evaluators/caching.d.ts +2 -0
- package/dist/evaluators/caching.js +171 -0
- package/dist/evaluators/ci-cd.d.ts +2 -0
- package/dist/evaluators/ci-cd.js +218 -0
- package/dist/evaluators/cloud-readiness.d.ts +2 -0
- package/dist/evaluators/cloud-readiness.js +231 -0
- package/dist/evaluators/code-structure.d.ts +21 -0
- package/dist/evaluators/code-structure.js +195 -0
- package/dist/evaluators/compliance.d.ts +2 -0
- package/dist/evaluators/compliance.js +329 -0
- package/dist/evaluators/concurrency.d.ts +2 -0
- package/dist/evaluators/concurrency.js +307 -0
- package/dist/evaluators/configuration-management.d.ts +2 -0
- package/dist/evaluators/configuration-management.js +232 -0
- package/dist/evaluators/cost-effectiveness.d.ts +2 -0
- package/dist/evaluators/cost-effectiveness.js +418 -0
- package/dist/evaluators/cybersecurity.d.ts +2 -0
- package/dist/evaluators/cybersecurity.js +1197 -0
- package/dist/evaluators/data-security.d.ts +2 -0
- package/dist/evaluators/data-security.js +467 -0
- package/dist/evaluators/data-sovereignty.d.ts +2 -0
- package/dist/evaluators/data-sovereignty.js +495 -0
- package/dist/evaluators/database.d.ts +2 -0
- package/dist/evaluators/database.js +240 -0
- package/dist/evaluators/dependencies.d.ts +5 -0
- package/dist/evaluators/dependencies.js +228 -0
- package/dist/evaluators/dependency-health.d.ts +2 -0
- package/dist/evaluators/dependency-health.js +477 -0
- package/dist/evaluators/documentation.d.ts +2 -0
- package/dist/evaluators/documentation.js +432 -0
- package/dist/evaluators/error-handling.d.ts +2 -0
- package/dist/evaluators/error-handling.js +426 -0
- package/dist/evaluators/ethics-bias.d.ts +2 -0
- package/dist/evaluators/ethics-bias.js +263 -0
- package/dist/evaluators/false-positive-review.d.ts +21 -0
- package/dist/evaluators/false-positive-review.js +1246 -0
- package/dist/evaluators/framework-rules.d.ts +58 -0
- package/dist/evaluators/framework-rules.js +291 -0
- package/dist/evaluators/framework-safety.d.ts +12 -0
- package/dist/evaluators/framework-safety.js +1205 -0
- package/dist/evaluators/hallucination-detection.d.ts +2 -0
- package/dist/evaluators/hallucination-detection.js +1250 -0
- package/dist/evaluators/iac-security.d.ts +8 -0
- package/dist/evaluators/iac-security.js +701 -0
- package/dist/evaluators/index.d.ts +167 -0
- package/dist/evaluators/index.js +994 -0
- package/dist/evaluators/intent-alignment.d.ts +18 -0
- package/dist/evaluators/intent-alignment.js +405 -0
- package/dist/evaluators/internationalization.d.ts +2 -0
- package/dist/evaluators/internationalization.js +287 -0
- package/dist/evaluators/judge-selector.d.ts +19 -0
- package/dist/evaluators/judge-selector.js +141 -0
- package/dist/evaluators/logging-privacy.d.ts +2 -0
- package/dist/evaluators/logging-privacy.js +190 -0
- package/dist/evaluators/logic-review.d.ts +2 -0
- package/dist/evaluators/logic-review.js +289 -0
- package/dist/evaluators/maintainability.d.ts +2 -0
- package/dist/evaluators/maintainability.js +430 -0
- package/dist/evaluators/model-fingerprint.d.ts +2 -0
- package/dist/evaluators/model-fingerprint.js +151 -0
- package/dist/evaluators/multi-turn-coherence.d.ts +13 -0
- package/dist/evaluators/multi-turn-coherence.js +149 -0
- package/dist/evaluators/observability.d.ts +2 -0
- package/dist/evaluators/observability.js +238 -0
- package/dist/evaluators/over-engineering.d.ts +2 -0
- package/dist/evaluators/over-engineering.js +160 -0
- package/dist/evaluators/performance.d.ts +2 -0
- package/dist/evaluators/performance.js +649 -0
- package/dist/evaluators/portability.d.ts +2 -0
- package/dist/evaluators/portability.js +254 -0
- package/dist/evaluators/project.d.ts +48 -0
- package/dist/evaluators/project.js +817 -0
- package/dist/evaluators/rate-limiting.d.ts +2 -0
- package/dist/evaluators/rate-limiting.js +193 -0
- package/dist/evaluators/recall-boost.d.ts +27 -0
- package/dist/evaluators/recall-boost.js +409 -0
- package/dist/evaluators/reliability.d.ts +2 -0
- package/dist/evaluators/reliability.js +245 -0
- package/dist/evaluators/scalability.d.ts +2 -0
- package/dist/evaluators/scalability.js +230 -0
- package/dist/evaluators/security.d.ts +12 -0
- package/dist/evaluators/security.js +1013 -0
- package/dist/evaluators/shared.d.ts +219 -0
- package/dist/evaluators/shared.js +1169 -0
- package/dist/evaluators/software-practices.d.ts +2 -0
- package/dist/evaluators/software-practices.js +395 -0
- package/dist/evaluators/suppressions.d.ts +49 -0
- package/dist/evaluators/suppressions.js +185 -0
- package/dist/evaluators/testing.d.ts +2 -0
- package/dist/evaluators/testing.js +348 -0
- package/dist/evaluators/ux.d.ts +2 -0
- package/dist/evaluators/ux.js +309 -0
- package/dist/evaluators/v2.d.ts +26 -0
- package/dist/evaluators/v2.js +354 -0
- package/dist/ext-to-lang.d.ts +16 -0
- package/dist/ext-to-lang.js +60 -0
- package/dist/feedback-loop.d.ts +62 -0
- package/dist/feedback-loop.js +179 -0
- package/dist/finding-lifecycle.d.ts +215 -0
- package/dist/finding-lifecycle.js +547 -0
- package/dist/fingerprint.d.ts +39 -0
- package/dist/fingerprint.js +179 -0
- package/dist/fix-history.d.ts +103 -0
- package/dist/fix-history.js +164 -0
- package/dist/formatters/badge.d.ts +16 -0
- package/dist/formatters/badge.js +78 -0
- package/dist/formatters/codeclimate.d.ts +24 -0
- package/dist/formatters/codeclimate.js +80 -0
- package/dist/formatters/csv.d.ts +16 -0
- package/dist/formatters/csv.js +53 -0
- package/dist/formatters/diagnostics.d.ts +81 -0
- package/dist/formatters/diagnostics.js +152 -0
- package/dist/formatters/github-actions.d.ts +6 -0
- package/dist/formatters/github-actions.js +68 -0
- package/dist/formatters/html.d.ts +12 -0
- package/dist/formatters/html.js +194 -0
- package/dist/formatters/junit.d.ts +6 -0
- package/dist/formatters/junit.js +68 -0
- package/dist/formatters/pdf.d.ts +12 -0
- package/dist/formatters/pdf.js +114 -0
- package/dist/formatters/sarif.d.ts +92 -0
- package/dist/formatters/sarif.js +256 -0
- package/dist/formatters/shared.d.ts +4 -0
- package/dist/formatters/shared.js +29 -0
- package/dist/git-diff.d.ts +62 -0
- package/dist/git-diff.js +282 -0
- package/dist/github-app.d.ts +152 -0
- package/dist/github-app.js +716 -0
- package/dist/import-resolver.d.ts +51 -0
- package/dist/import-resolver.js +213 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +38 -0
- package/dist/judge-registry.d.ts +156 -0
- package/dist/judge-registry.js +272 -0
- package/dist/judges/accessibility.d.ts +2 -0
- package/dist/judges/accessibility.js +46 -0
- package/dist/judges/agent-instructions.d.ts +2 -0
- package/dist/judges/agent-instructions.js +46 -0
- package/dist/judges/ai-code-safety.d.ts +2 -0
- package/dist/judges/ai-code-safety.js +57 -0
- package/dist/judges/api-contract.d.ts +2 -0
- package/dist/judges/api-contract.js +40 -0
- package/dist/judges/api-design.d.ts +2 -0
- package/dist/judges/api-design.js +57 -0
- package/dist/judges/authentication.d.ts +2 -0
- package/dist/judges/authentication.js +63 -0
- package/dist/judges/backwards-compatibility.d.ts +2 -0
- package/dist/judges/backwards-compatibility.js +46 -0
- package/dist/judges/caching.d.ts +2 -0
- package/dist/judges/caching.js +46 -0
- package/dist/judges/ci-cd.d.ts +2 -0
- package/dist/judges/ci-cd.js +46 -0
- package/dist/judges/cloud-readiness.d.ts +2 -0
- package/dist/judges/cloud-readiness.js +53 -0
- package/dist/judges/code-structure.d.ts +2 -0
- package/dist/judges/code-structure.js +50 -0
- package/dist/judges/compliance.d.ts +2 -0
- package/dist/judges/compliance.js +49 -0
- package/dist/judges/concurrency.d.ts +2 -0
- package/dist/judges/concurrency.js +48 -0
- package/dist/judges/configuration-management.d.ts +2 -0
- package/dist/judges/configuration-management.js +46 -0
- package/dist/judges/cost-effectiveness.d.ts +2 -0
- package/dist/judges/cost-effectiveness.js +42 -0
- package/dist/judges/cybersecurity.d.ts +2 -0
- package/dist/judges/cybersecurity.js +63 -0
- package/dist/judges/data-security.d.ts +2 -0
- package/dist/judges/data-security.js +50 -0
- package/dist/judges/data-sovereignty.d.ts +2 -0
- package/dist/judges/data-sovereignty.js +60 -0
- package/dist/judges/database.d.ts +2 -0
- package/dist/judges/database.js +51 -0
- package/dist/judges/dependency-health.d.ts +2 -0
- package/dist/judges/dependency-health.js +48 -0
- package/dist/judges/documentation.d.ts +2 -0
- package/dist/judges/documentation.js +55 -0
- package/dist/judges/error-handling.d.ts +2 -0
- package/dist/judges/error-handling.js +55 -0
- package/dist/judges/ethics-bias.d.ts +2 -0
- package/dist/judges/ethics-bias.js +48 -0
- package/dist/judges/false-positive-review.d.ts +2 -0
- package/dist/judges/false-positive-review.js +85 -0
- package/dist/judges/framework-safety.d.ts +2 -0
- package/dist/judges/framework-safety.js +49 -0
- package/dist/judges/hallucination-detection.d.ts +2 -0
- package/dist/judges/hallucination-detection.js +48 -0
- package/dist/judges/iac-security.d.ts +2 -0
- package/dist/judges/iac-security.js +47 -0
- package/dist/judges/index.d.ts +88 -0
- package/dist/judges/index.js +128 -0
- package/dist/judges/intent-alignment.d.ts +2 -0
- package/dist/judges/intent-alignment.js +46 -0
- package/dist/judges/internationalization.d.ts +2 -0
- package/dist/judges/internationalization.js +44 -0
- package/dist/judges/logging-privacy.d.ts +2 -0
- package/dist/judges/logging-privacy.js +46 -0
- package/dist/judges/logic-review.d.ts +2 -0
- package/dist/judges/logic-review.js +36 -0
- package/dist/judges/maintainability.d.ts +2 -0
- package/dist/judges/maintainability.js +46 -0
- package/dist/judges/model-fingerprint.d.ts +2 -0
- package/dist/judges/model-fingerprint.js +35 -0
- package/dist/judges/multi-turn-coherence.d.ts +2 -0
- package/dist/judges/multi-turn-coherence.js +39 -0
- package/dist/judges/observability.d.ts +2 -0
- package/dist/judges/observability.js +54 -0
- package/dist/judges/over-engineering.d.ts +2 -0
- package/dist/judges/over-engineering.js +50 -0
- package/dist/judges/performance.d.ts +2 -0
- package/dist/judges/performance.js +46 -0
- package/dist/judges/portability.d.ts +2 -0
- package/dist/judges/portability.js +46 -0
- package/dist/judges/rate-limiting.d.ts +2 -0
- package/dist/judges/rate-limiting.js +55 -0
- package/dist/judges/reliability.d.ts +2 -0
- package/dist/judges/reliability.js +57 -0
- package/dist/judges/scalability.d.ts +2 -0
- package/dist/judges/scalability.js +52 -0
- package/dist/judges/security.d.ts +2 -0
- package/dist/judges/security.js +64 -0
- package/dist/judges/software-practices.d.ts +2 -0
- package/dist/judges/software-practices.js +56 -0
- package/dist/judges/testing.d.ts +2 -0
- package/dist/judges/testing.js +54 -0
- package/dist/judges/ux.d.ts +2 -0
- package/dist/judges/ux.js +46 -0
- package/dist/language-patterns.d.ts +653 -0
- package/dist/language-patterns.js +851 -0
- package/dist/parallel.d.ts +52 -0
- package/dist/parallel.js +157 -0
- package/dist/patches/apply.d.ts +15 -0
- package/dist/patches/apply.js +37 -0
- package/dist/patches/index.d.ts +9 -0
- package/dist/patches/index.js +2544 -0
- package/dist/plugins.d.ts +59 -0
- package/dist/plugins.js +76 -0
- package/dist/presets.d.ts +35 -0
- package/dist/presets.js +406 -0
- package/dist/probabilistic/llm-response-validator.d.ts +26 -0
- package/dist/probabilistic/llm-response-validator.js +122 -0
- package/dist/reports/public-repo-report.d.ts +42 -0
- package/dist/reports/public-repo-report.js +579 -0
- package/dist/review-conversation.d.ts +87 -0
- package/dist/review-conversation.js +307 -0
- package/dist/sast-integration.d.ts +112 -0
- package/dist/sast-integration.js +215 -0
- package/dist/scoring.d.ts +36 -0
- package/dist/scoring.js +437 -0
- package/dist/security-ids.d.ts +23 -0
- package/dist/security-ids.js +239 -0
- package/dist/skill-loader.d.ts +33 -0
- package/dist/skill-loader.js +167 -0
- package/dist/tools/command-safety.d.ts +13 -0
- package/dist/tools/command-safety.js +95 -0
- package/dist/tools/deep-review.d.ts +38 -0
- package/dist/tools/deep-review.js +302 -0
- package/dist/tools/prompts.d.ts +27 -0
- package/dist/tools/prompts.js +122 -0
- package/dist/tools/register-evaluation.d.ts +6 -0
- package/dist/tools/register-evaluation.js +587 -0
- package/dist/tools/register-fix.d.ts +5 -0
- package/dist/tools/register-fix.js +175 -0
- package/dist/tools/register-resources.d.ts +6 -0
- package/dist/tools/register-resources.js +177 -0
- package/dist/tools/register-review.d.ts +6 -0
- package/dist/tools/register-review.js +564 -0
- package/dist/tools/register-scaffold.d.ts +2 -0
- package/dist/tools/register-scaffold.js +398 -0
- package/dist/tools/register-workflow.d.ts +6 -0
- package/dist/tools/register-workflow.js +1037 -0
- package/dist/tools/register-workspace.d.ts +2 -0
- package/dist/tools/register-workspace.js +214 -0
- package/dist/tools/register.d.ts +6 -0
- package/dist/tools/register.js +21 -0
- package/dist/tools/schemas.d.ts +25 -0
- package/dist/tools/schemas.js +41 -0
- package/dist/tools/validation.d.ts +13 -0
- package/dist/tools/validation.js +77 -0
- package/dist/types.d.ts +898 -0
- package/dist/types.js +1 -0
- package/package.json +54 -0
- package/skills/ai-code-review.skill.md +57 -0
- package/skills/release-gate.skill.md +27 -0
- package/skills/security-review.skill.md +32 -0
|
@@ -0,0 +1,1963 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multi-language benchmark cases exercising judges across Go, Rust, Kotlin,
|
|
3
|
+
* Swift, PHP, Ruby, C#, Java, C++, and Python with language-idiomatic patterns.
|
|
4
|
+
*
|
|
5
|
+
* Covers various judge prefixes in non-TypeScript languages.
|
|
6
|
+
*/
|
|
7
|
+
export const BENCHMARK_LANGUAGES = [
|
|
8
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
9
|
+
// Go-specific patterns
|
|
10
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
11
|
+
{
|
|
12
|
+
id: "lang-go-goroutine-leak",
|
|
13
|
+
description: "Go goroutine leak from unbuffered channel with no receiver",
|
|
14
|
+
language: "go",
|
|
15
|
+
code: `package main
|
|
16
|
+
|
|
17
|
+
import "net/http"
|
|
18
|
+
|
|
19
|
+
func handleRequest(w http.ResponseWriter, r *http.Request) {
|
|
20
|
+
ch := make(chan string)
|
|
21
|
+
go func() {
|
|
22
|
+
result := heavyComputation(r.URL.Query().Get("input"))
|
|
23
|
+
ch <- result
|
|
24
|
+
}()
|
|
25
|
+
select {
|
|
26
|
+
case res := <-ch:
|
|
27
|
+
w.Write([]byte(res))
|
|
28
|
+
case <-time.After(1 * time.Second):
|
|
29
|
+
w.WriteHeader(504)
|
|
30
|
+
}
|
|
31
|
+
}`,
|
|
32
|
+
expectedRuleIds: ["CONC-001"],
|
|
33
|
+
category: "concurrency",
|
|
34
|
+
difficulty: "hard",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: "lang-go-defer-in-loop",
|
|
38
|
+
description: "Go defer inside loop causing resource leak",
|
|
39
|
+
language: "go",
|
|
40
|
+
code: `package main
|
|
41
|
+
|
|
42
|
+
import (
|
|
43
|
+
"database/sql"
|
|
44
|
+
"os"
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
func processFiles(paths []string) error {
|
|
48
|
+
for _, path := range paths {
|
|
49
|
+
f, err := os.Open(path)
|
|
50
|
+
if err != nil {
|
|
51
|
+
return err
|
|
52
|
+
}
|
|
53
|
+
defer f.Close()
|
|
54
|
+
data := make([]byte, 1024)
|
|
55
|
+
f.Read(data)
|
|
56
|
+
processData(data)
|
|
57
|
+
}
|
|
58
|
+
return nil
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
func queryAll(db *sql.DB, ids []int) ([]Record, error) {
|
|
62
|
+
var results []Record
|
|
63
|
+
for _, id := range ids {
|
|
64
|
+
rows, err := db.Query("SELECT * FROM records WHERE id = ?", id)
|
|
65
|
+
if err != nil {
|
|
66
|
+
return nil, err
|
|
67
|
+
}
|
|
68
|
+
defer rows.Close()
|
|
69
|
+
for rows.Next() {
|
|
70
|
+
var r Record
|
|
71
|
+
rows.Scan(&r.ID, &r.Name)
|
|
72
|
+
results = append(results, r)
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return results, nil
|
|
76
|
+
}`,
|
|
77
|
+
expectedRuleIds: ["DB-001"],
|
|
78
|
+
category: "performance",
|
|
79
|
+
difficulty: "medium",
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: "lang-go-fmt-errorf-no-wrap",
|
|
83
|
+
description: "Go error creation without wrapping for chain inspection",
|
|
84
|
+
language: "go",
|
|
85
|
+
code: `package service
|
|
86
|
+
|
|
87
|
+
import (
|
|
88
|
+
"fmt"
|
|
89
|
+
"os"
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
func ReadConfig(path string) (*Config, error) {
|
|
93
|
+
data, err := os.ReadFile(path)
|
|
94
|
+
if err != nil {
|
|
95
|
+
return nil, fmt.Errorf("failed to read config: %s", err)
|
|
96
|
+
}
|
|
97
|
+
var cfg Config
|
|
98
|
+
if err := json.Unmarshal(data, &cfg); err != nil {
|
|
99
|
+
return nil, fmt.Errorf("failed to parse config: %s", err)
|
|
100
|
+
}
|
|
101
|
+
if err := cfg.Validate(); err != nil {
|
|
102
|
+
return nil, fmt.Errorf("invalid config: %s", err)
|
|
103
|
+
}
|
|
104
|
+
return &cfg, nil
|
|
105
|
+
}`,
|
|
106
|
+
expectedRuleIds: ["ERR-001"],
|
|
107
|
+
category: "error-handling",
|
|
108
|
+
difficulty: "medium",
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: "lang-go-hardcoded-tls-config",
|
|
112
|
+
description: "Go server with hardcoded TLS config and insecure settings",
|
|
113
|
+
language: "go",
|
|
114
|
+
code: `package main
|
|
115
|
+
|
|
116
|
+
import (
|
|
117
|
+
"crypto/tls"
|
|
118
|
+
"net/http"
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
func main() {
|
|
122
|
+
tlsConfig := &tls.Config{
|
|
123
|
+
InsecureSkipVerify: true,
|
|
124
|
+
MinVersion: tls.VersionTLS10,
|
|
125
|
+
CipherSuites: []uint16{
|
|
126
|
+
tls.TLS_RSA_WITH_RC4_128_SHA,
|
|
127
|
+
tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA,
|
|
128
|
+
},
|
|
129
|
+
}
|
|
130
|
+
client := &http.Client{Transport: &http.Transport{TLSClientConfig: tlsConfig}}
|
|
131
|
+
resp, _ := client.Get("https://api.internal.example.com/data")
|
|
132
|
+
defer resp.Body.Close()
|
|
133
|
+
}`,
|
|
134
|
+
expectedRuleIds: ["SEC-001", "CYBER-001"],
|
|
135
|
+
category: "security",
|
|
136
|
+
difficulty: "medium",
|
|
137
|
+
},
|
|
138
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
139
|
+
// Rust-specific patterns
|
|
140
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
141
|
+
{
|
|
142
|
+
id: "lang-rust-unwrap-production",
|
|
143
|
+
description: "Rust production code littered with unwrap() calls",
|
|
144
|
+
language: "rust",
|
|
145
|
+
code: `use std::fs;
|
|
146
|
+
use std::collections::HashMap;
|
|
147
|
+
|
|
148
|
+
fn load_users(path: &str) -> Vec<User> {
|
|
149
|
+
let content = fs::read_to_string(path).unwrap();
|
|
150
|
+
let users: Vec<User> = serde_json::from_str(&content).unwrap();
|
|
151
|
+
users
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
fn get_config_value(config: &HashMap<String, String>, key: &str) -> String {
|
|
155
|
+
config.get(key).unwrap().clone()
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
fn connect_database(url: &str) -> Connection {
|
|
159
|
+
let conn = Connection::establish(url).unwrap();
|
|
160
|
+
conn.execute("SET timezone = 'UTC'").unwrap();
|
|
161
|
+
conn
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
fn parse_request(body: &[u8]) -> Request {
|
|
165
|
+
let text = std::str::from_utf8(body).unwrap();
|
|
166
|
+
serde_json::from_str(text).unwrap()
|
|
167
|
+
}`,
|
|
168
|
+
expectedRuleIds: ["ERR-001"],
|
|
169
|
+
category: "error-handling",
|
|
170
|
+
difficulty: "easy",
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
id: "lang-rust-unsafe-transmute",
|
|
174
|
+
description: "Rust code using unsafe transmute and raw pointer dereference",
|
|
175
|
+
language: "rust",
|
|
176
|
+
code: `use std::mem;
|
|
177
|
+
|
|
178
|
+
fn reinterpret_bytes(data: &[u8]) -> &[f32] {
|
|
179
|
+
unsafe {
|
|
180
|
+
let ptr = data.as_ptr() as *const f32;
|
|
181
|
+
let len = data.len() / mem::size_of::<f32>();
|
|
182
|
+
std::slice::from_raw_parts(ptr, len)
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
fn cast_value<T, U>(val: T) -> U {
|
|
187
|
+
unsafe { mem::transmute_copy(&val) }
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
fn modify_through_pointer(data: &[u8], offset: usize, value: u8) {
|
|
191
|
+
unsafe {
|
|
192
|
+
let ptr = data.as_ptr() as *mut u8;
|
|
193
|
+
*ptr.add(offset) = value;
|
|
194
|
+
}
|
|
195
|
+
}`,
|
|
196
|
+
expectedRuleIds: ["SEC-001"],
|
|
197
|
+
category: "security",
|
|
198
|
+
difficulty: "hard",
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
id: "lang-rust-sql-format",
|
|
202
|
+
description: "Rust web handler building SQL query with format!",
|
|
203
|
+
language: "rust",
|
|
204
|
+
code: `use actix_web::{web, HttpResponse};
|
|
205
|
+
use sqlx::PgPool;
|
|
206
|
+
|
|
207
|
+
async fn search_users(
|
|
208
|
+
pool: web::Data<PgPool>,
|
|
209
|
+
query: web::Query<SearchParams>,
|
|
210
|
+
) -> HttpResponse {
|
|
211
|
+
let sql = format!(
|
|
212
|
+
"SELECT * FROM users WHERE name LIKE '%{}%' AND role = '{}'",
|
|
213
|
+
query.name,
|
|
214
|
+
query.role
|
|
215
|
+
);
|
|
216
|
+
let rows = sqlx::query(&sql)
|
|
217
|
+
.fetch_all(pool.get_ref())
|
|
218
|
+
.await
|
|
219
|
+
.unwrap();
|
|
220
|
+
HttpResponse::Ok().json(rows)
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
async fn delete_user(
|
|
224
|
+
pool: web::Data<PgPool>,
|
|
225
|
+
path: web::Path<String>,
|
|
226
|
+
) -> HttpResponse {
|
|
227
|
+
let sql = format!("DELETE FROM users WHERE id = '{}'", path.into_inner());
|
|
228
|
+
sqlx::query(&sql).execute(pool.get_ref()).await.unwrap();
|
|
229
|
+
HttpResponse::Ok().finish()
|
|
230
|
+
}`,
|
|
231
|
+
expectedRuleIds: ["CYBER-001", "SEC-001"],
|
|
232
|
+
category: "security",
|
|
233
|
+
difficulty: "medium",
|
|
234
|
+
},
|
|
235
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
236
|
+
// Kotlin-specific patterns
|
|
237
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
238
|
+
{
|
|
239
|
+
id: "lang-kotlin-lateinit-abuse",
|
|
240
|
+
description: "Kotlin lateinit vars used without initialization checks",
|
|
241
|
+
language: "kotlin",
|
|
242
|
+
code: `class OrderService {
|
|
243
|
+
lateinit var database: Database
|
|
244
|
+
lateinit var emailService: EmailService
|
|
245
|
+
lateinit var paymentGateway: PaymentGateway
|
|
246
|
+
lateinit var logger: Logger
|
|
247
|
+
|
|
248
|
+
fun processOrder(order: Order): OrderResult {
|
|
249
|
+
logger.info("Processing order \${order.id}")
|
|
250
|
+
val payment = paymentGateway.charge(order.total)
|
|
251
|
+
database.save(order.copy(status = "paid"))
|
|
252
|
+
emailService.sendConfirmation(order)
|
|
253
|
+
return OrderResult(success = true)
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
fun cancelOrder(orderId: String) {
|
|
257
|
+
val order = database.findById(orderId)!!
|
|
258
|
+
paymentGateway.refund(order.paymentId!!)
|
|
259
|
+
database.save(order.copy(status = "cancelled"))
|
|
260
|
+
emailService.sendCancellation(order)
|
|
261
|
+
}
|
|
262
|
+
}`,
|
|
263
|
+
expectedRuleIds: ["ERR-001"],
|
|
264
|
+
category: "error-handling",
|
|
265
|
+
difficulty: "medium",
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
id: "lang-kotlin-sql-template",
|
|
269
|
+
description: "Kotlin Spring Boot with SQL string templates",
|
|
270
|
+
language: "kotlin",
|
|
271
|
+
code: `@RestController
|
|
272
|
+
class UserController(private val jdbc: JdbcTemplate) {
|
|
273
|
+
|
|
274
|
+
@GetMapping("/search")
|
|
275
|
+
fun searchUsers(@RequestParam name: String, @RequestParam role: String): List<Map<String, Any>> {
|
|
276
|
+
val sql = "SELECT * FROM users WHERE name = '$name' AND role = '$role'"
|
|
277
|
+
return jdbc.queryForList(sql)
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
@DeleteMapping("/users/{id}")
|
|
281
|
+
fun deleteUser(@PathVariable id: String): ResponseEntity<Void> {
|
|
282
|
+
jdbc.execute("DELETE FROM users WHERE id = '$id'")
|
|
283
|
+
return ResponseEntity.noContent().build()
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
@PutMapping("/users/{id}/role")
|
|
287
|
+
fun updateRole(@PathVariable id: String, @RequestBody body: Map<String, String>): ResponseEntity<Void> {
|
|
288
|
+
val role = body["role"] ?: "user"
|
|
289
|
+
jdbc.execute("UPDATE users SET role = '$role' WHERE id = '$id'")
|
|
290
|
+
return ResponseEntity.ok().build()
|
|
291
|
+
}
|
|
292
|
+
}`,
|
|
293
|
+
expectedRuleIds: ["CYBER-001", "SEC-001"],
|
|
294
|
+
category: "security",
|
|
295
|
+
difficulty: "easy",
|
|
296
|
+
},
|
|
297
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
298
|
+
// Swift-specific patterns
|
|
299
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
300
|
+
{
|
|
301
|
+
id: "lang-swift-force-unwrap",
|
|
302
|
+
description: "Swift code with excessive force unwrapping",
|
|
303
|
+
language: "swift",
|
|
304
|
+
code: `class UserManager {
|
|
305
|
+
var currentUser: User?
|
|
306
|
+
var session: Session?
|
|
307
|
+
|
|
308
|
+
func displayProfile() {
|
|
309
|
+
let name = currentUser!.name
|
|
310
|
+
let email = currentUser!.email!
|
|
311
|
+
let avatar = currentUser!.profile!.avatarURL!
|
|
312
|
+
let token = session!.authToken!
|
|
313
|
+
print("User: \\(name), Email: \\(email)")
|
|
314
|
+
loadImage(from: URL(string: avatar)!)
|
|
315
|
+
fetchData(token: token)
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
func processPayment(amount: Double) {
|
|
319
|
+
let card = currentUser!.paymentMethods!.first!
|
|
320
|
+
let response = paymentGateway.charge(card: card, amount: amount)
|
|
321
|
+
let receipt = response!.receipt!
|
|
322
|
+
saveReceipt(receipt)
|
|
323
|
+
}
|
|
324
|
+
}`,
|
|
325
|
+
expectedRuleIds: ["CYBER-001"],
|
|
326
|
+
category: "error-handling",
|
|
327
|
+
difficulty: "easy",
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
id: "lang-swift-insecure-storage",
|
|
331
|
+
description: "Swift storing sensitive data in UserDefaults instead of Keychain",
|
|
332
|
+
language: "swift",
|
|
333
|
+
code: `import Foundation
|
|
334
|
+
|
|
335
|
+
class AuthManager {
|
|
336
|
+
func saveCredentials(username: String, password: String, token: String) {
|
|
337
|
+
UserDefaults.standard.set(username, forKey: "username")
|
|
338
|
+
UserDefaults.standard.set(password, forKey: "password")
|
|
339
|
+
UserDefaults.standard.set(token, forKey: "authToken")
|
|
340
|
+
UserDefaults.standard.set(Date(), forKey: "loginDate")
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
func getToken() -> String? {
|
|
344
|
+
return UserDefaults.standard.string(forKey: "authToken")
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
func saveApiKey(_ key: String) {
|
|
348
|
+
UserDefaults.standard.set(key, forKey: "apiKey")
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
func clearCredentials() {
|
|
352
|
+
UserDefaults.standard.removeObject(forKey: "username")
|
|
353
|
+
UserDefaults.standard.removeObject(forKey: "password")
|
|
354
|
+
UserDefaults.standard.removeObject(forKey: "authToken")
|
|
355
|
+
}
|
|
356
|
+
}`,
|
|
357
|
+
expectedRuleIds: ["CYBER-001"],
|
|
358
|
+
category: "security",
|
|
359
|
+
difficulty: "medium",
|
|
360
|
+
},
|
|
361
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
362
|
+
// PHP-specific patterns
|
|
363
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
364
|
+
{
|
|
365
|
+
id: "lang-php-sql-concat",
|
|
366
|
+
description: "PHP SQL with string concatenation in PDO",
|
|
367
|
+
language: "php",
|
|
368
|
+
code: `<?php
|
|
369
|
+
class UserRepository {
|
|
370
|
+
private PDO $pdo;
|
|
371
|
+
|
|
372
|
+
public function search(string $name, string $role): array {
|
|
373
|
+
$sql = "SELECT * FROM users WHERE name LIKE '%" . $name . "%' AND role = '" . $role . "'";
|
|
374
|
+
return $this->pdo->query($sql)->fetchAll();
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
public function updateEmail(string $id, string $email): void {
|
|
378
|
+
$sql = "UPDATE users SET email = '" . $email . "' WHERE id = " . $id;
|
|
379
|
+
$this->pdo->exec($sql);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
public function deleteByName(string $name): int {
|
|
383
|
+
$sql = "DELETE FROM users WHERE name = '" . $name . "'";
|
|
384
|
+
return $this->pdo->exec($sql);
|
|
385
|
+
}
|
|
386
|
+
}`,
|
|
387
|
+
expectedRuleIds: ["CYBER-001", "SEC-001"],
|
|
388
|
+
category: "security",
|
|
389
|
+
difficulty: "easy",
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
id: "lang-php-deserialization",
|
|
393
|
+
description: "PHP unserializing untrusted user input",
|
|
394
|
+
language: "php",
|
|
395
|
+
code: `<?php
|
|
396
|
+
class SessionHandler {
|
|
397
|
+
public function restoreSession(): void {
|
|
398
|
+
if (isset($_COOKIE['session_data'])) {
|
|
399
|
+
$data = base64_decode($_COOKIE['session_data']);
|
|
400
|
+
$session = unserialize($data);
|
|
401
|
+
$_SESSION = array_merge($_SESSION, $session);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
public function importConfig(): void {
|
|
406
|
+
$raw = file_get_contents('php://input');
|
|
407
|
+
$config = unserialize($raw);
|
|
408
|
+
$this->applyConfig($config);
|
|
409
|
+
}
|
|
410
|
+
}`,
|
|
411
|
+
expectedRuleIds: ["CYBER-001", "SEC-001"],
|
|
412
|
+
category: "security",
|
|
413
|
+
difficulty: "medium",
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
id: "lang-php-md5-password",
|
|
417
|
+
description: "PHP using MD5 for password hashing",
|
|
418
|
+
language: "php",
|
|
419
|
+
code: `<?php
|
|
420
|
+
class AuthService {
|
|
421
|
+
private PDO $db;
|
|
422
|
+
|
|
423
|
+
public function register(string $username, string $password): bool {
|
|
424
|
+
$hash = md5($password);
|
|
425
|
+
$stmt = $this->db->prepare("INSERT INTO users (username, password) VALUES (?, ?)");
|
|
426
|
+
return $stmt->execute([$username, $hash]);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
public function login(string $username, string $password): ?array {
|
|
430
|
+
$hash = md5($password);
|
|
431
|
+
$stmt = $this->db->prepare("SELECT * FROM users WHERE username = ? AND password = ?");
|
|
432
|
+
$stmt->execute([$username, $hash]);
|
|
433
|
+
return $stmt->fetch() ?: null;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
public function generateApiKey(string $userId): string {
|
|
437
|
+
return md5($userId . time());
|
|
438
|
+
}
|
|
439
|
+
}`,
|
|
440
|
+
expectedRuleIds: ["AUTH-001", "CYBER-001"],
|
|
441
|
+
category: "auth",
|
|
442
|
+
difficulty: "easy",
|
|
443
|
+
},
|
|
444
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
445
|
+
// Ruby-specific patterns
|
|
446
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
447
|
+
{
|
|
448
|
+
id: "lang-ruby-eval-user-input",
|
|
449
|
+
description: "Ruby eval on user-provided input in Sinatra app",
|
|
450
|
+
language: "ruby",
|
|
451
|
+
code: `require 'sinatra'
|
|
452
|
+
|
|
453
|
+
get '/calculate' do
|
|
454
|
+
expression = params[:expr]
|
|
455
|
+
result = eval(expression)
|
|
456
|
+
{ result: result }.to_json
|
|
457
|
+
end
|
|
458
|
+
|
|
459
|
+
post '/transform' do
|
|
460
|
+
code = JSON.parse(request.body.read)['code']
|
|
461
|
+
eval(code)
|
|
462
|
+
end
|
|
463
|
+
|
|
464
|
+
get '/config/:key' do
|
|
465
|
+
key = params[:key]
|
|
466
|
+
value = eval("CONFIG.#{key}")
|
|
467
|
+
{ key: key, value: value }.to_json
|
|
468
|
+
end`,
|
|
469
|
+
expectedRuleIds: ["CYBER-001", "SEC-001"],
|
|
470
|
+
category: "security",
|
|
471
|
+
difficulty: "easy",
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
id: "lang-ruby-open-uri",
|
|
475
|
+
description: "Ruby using open-uri with user-controlled URL (SSRF)",
|
|
476
|
+
language: "ruby",
|
|
477
|
+
code: `require 'open-uri'
|
|
478
|
+
require 'sinatra'
|
|
479
|
+
require 'json'
|
|
480
|
+
|
|
481
|
+
get '/fetch' do
|
|
482
|
+
url = params[:url]
|
|
483
|
+
content = URI.open(url).read
|
|
484
|
+
{ content: content }.to_json
|
|
485
|
+
end
|
|
486
|
+
|
|
487
|
+
get '/preview' do
|
|
488
|
+
image_url = params[:image_url]
|
|
489
|
+
data = URI.open(image_url).read
|
|
490
|
+
content_type 'image/png'
|
|
491
|
+
data
|
|
492
|
+
end
|
|
493
|
+
|
|
494
|
+
post '/webhook' do
|
|
495
|
+
payload = JSON.parse(request.body.read)
|
|
496
|
+
response = URI.open(payload['callback_url']).read
|
|
497
|
+
{ status: 'delivered', response: response }.to_json
|
|
498
|
+
end`,
|
|
499
|
+
expectedRuleIds: ["SEC-001"],
|
|
500
|
+
category: "security",
|
|
501
|
+
difficulty: "medium",
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
id: "lang-ruby-system-call",
|
|
505
|
+
description: "Ruby command injection via system call with user input",
|
|
506
|
+
language: "ruby",
|
|
507
|
+
code: `require 'sinatra'
|
|
508
|
+
|
|
509
|
+
post '/convert' do
|
|
510
|
+
filename = params[:filename]
|
|
511
|
+
format = params[:format]
|
|
512
|
+
system("convert uploads/#{filename} -resize 800x600 output/#{filename}.#{format}")
|
|
513
|
+
send_file "output/#{filename}.#{format}"
|
|
514
|
+
end
|
|
515
|
+
|
|
516
|
+
get '/ping' do
|
|
517
|
+
host = params[:host]
|
|
518
|
+
output = \`ping -c 3 #{host}\`
|
|
519
|
+
{ result: output }.to_json
|
|
520
|
+
end
|
|
521
|
+
|
|
522
|
+
post '/backup' do
|
|
523
|
+
db_name = params[:database]
|
|
524
|
+
system("pg_dump #{db_name} > /backups/#{db_name}_#{Time.now.to_i}.sql")
|
|
525
|
+
{ status: 'backup created' }.to_json
|
|
526
|
+
end`,
|
|
527
|
+
expectedRuleIds: ["CYBER-001", "SEC-001"],
|
|
528
|
+
category: "security",
|
|
529
|
+
difficulty: "easy",
|
|
530
|
+
},
|
|
531
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
532
|
+
// C# / .NET-specific patterns
|
|
533
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
534
|
+
{
|
|
535
|
+
id: "lang-csharp-sql-concat-ado",
|
|
536
|
+
description: "C# ADO.NET with string concatenation in SQL queries",
|
|
537
|
+
language: "csharp",
|
|
538
|
+
code: `using System.Data.SqlClient;
|
|
539
|
+
|
|
540
|
+
public class UserRepository
|
|
541
|
+
{
|
|
542
|
+
private readonly string _connectionString;
|
|
543
|
+
|
|
544
|
+
public User GetUser(string username)
|
|
545
|
+
{
|
|
546
|
+
using var conn = new SqlConnection(_connectionString);
|
|
547
|
+
conn.Open();
|
|
548
|
+
var cmd = new SqlCommand(
|
|
549
|
+
"SELECT * FROM Users WHERE Username = '" + username + "'", conn);
|
|
550
|
+
using var reader = cmd.ExecuteReader();
|
|
551
|
+
if (reader.Read())
|
|
552
|
+
return new User { Id = (int)reader["Id"], Name = (string)reader["Username"] };
|
|
553
|
+
return null;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
public void DeleteUser(string userId)
|
|
557
|
+
{
|
|
558
|
+
using var conn = new SqlConnection(_connectionString);
|
|
559
|
+
conn.Open();
|
|
560
|
+
var cmd = new SqlCommand("DELETE FROM Users WHERE Id = " + userId, conn);
|
|
561
|
+
cmd.ExecuteNonQuery();
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
public List<User> Search(string term, string role)
|
|
565
|
+
{
|
|
566
|
+
using var conn = new SqlConnection(_connectionString);
|
|
567
|
+
conn.Open();
|
|
568
|
+
var cmd = new SqlCommand(
|
|
569
|
+
$"SELECT * FROM Users WHERE Name LIKE '%{term}%' AND Role = '{role}'", conn);
|
|
570
|
+
// ...
|
|
571
|
+
}
|
|
572
|
+
}`,
|
|
573
|
+
expectedRuleIds: ["CYBER-001", "SEC-001"],
|
|
574
|
+
category: "security",
|
|
575
|
+
difficulty: "easy",
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
id: "lang-csharp-insecure-deserialization",
|
|
579
|
+
description: "C# BinaryFormatter deserialization of untrusted data",
|
|
580
|
+
language: "csharp",
|
|
581
|
+
code: `using System.Runtime.Serialization.Formatters.Binary;
|
|
582
|
+
|
|
583
|
+
public class SessionManager
|
|
584
|
+
{
|
|
585
|
+
public object DeserializeSession(byte[] data)
|
|
586
|
+
{
|
|
587
|
+
var formatter = new BinaryFormatter();
|
|
588
|
+
using var stream = new MemoryStream(data);
|
|
589
|
+
return formatter.Deserialize(stream);
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
public object LoadFromFile(string path)
|
|
593
|
+
{
|
|
594
|
+
var formatter = new BinaryFormatter();
|
|
595
|
+
using var stream = File.OpenRead(path);
|
|
596
|
+
return formatter.Deserialize(stream);
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
public byte[] Serialize(object obj)
|
|
600
|
+
{
|
|
601
|
+
var formatter = new BinaryFormatter();
|
|
602
|
+
using var stream = new MemoryStream();
|
|
603
|
+
formatter.Serialize(stream, obj);
|
|
604
|
+
return stream.ToArray();
|
|
605
|
+
}
|
|
606
|
+
}`,
|
|
607
|
+
expectedRuleIds: ["SEC-001"],
|
|
608
|
+
category: "security",
|
|
609
|
+
difficulty: "medium",
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
id: "lang-csharp-controller-no-auth",
|
|
613
|
+
description: "C# ASP.NET controller with no authorization attributes",
|
|
614
|
+
language: "csharp",
|
|
615
|
+
code: `[ApiController]
|
|
616
|
+
[Route("api/[controller]")]
|
|
617
|
+
public class AdminController : ControllerBase
|
|
618
|
+
{
|
|
619
|
+
private readonly IUserService _userService;
|
|
620
|
+
|
|
621
|
+
[HttpGet("users")]
|
|
622
|
+
public async Task<IActionResult> GetAllUsers()
|
|
623
|
+
{
|
|
624
|
+
var users = await _userService.GetAll();
|
|
625
|
+
return Ok(users);
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
[HttpDelete("users/{id}")]
|
|
629
|
+
public async Task<IActionResult> DeleteUser(int id)
|
|
630
|
+
{
|
|
631
|
+
await _userService.Delete(id);
|
|
632
|
+
return NoContent();
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
[HttpPost("users/{id}/role")]
|
|
636
|
+
public async Task<IActionResult> ChangeRole(int id, [FromBody] RoleChangeRequest request)
|
|
637
|
+
{
|
|
638
|
+
await _userService.ChangeRole(id, request.Role);
|
|
639
|
+
return Ok();
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
[HttpGet("audit-log")]
|
|
643
|
+
public async Task<IActionResult> GetAuditLog()
|
|
644
|
+
{
|
|
645
|
+
var logs = await _auditService.GetAll();
|
|
646
|
+
return Ok(logs);
|
|
647
|
+
}
|
|
648
|
+
}`,
|
|
649
|
+
expectedRuleIds: ["AUTH-001"],
|
|
650
|
+
category: "auth",
|
|
651
|
+
difficulty: "medium",
|
|
652
|
+
},
|
|
653
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
654
|
+
// Java-specific patterns
|
|
655
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
656
|
+
{
|
|
657
|
+
id: "lang-java-thread-unsafe-singleton",
|
|
658
|
+
description: "Java thread-unsafe singleton with lazy initialization",
|
|
659
|
+
language: "java",
|
|
660
|
+
code: `public class DatabasePool {
|
|
661
|
+
private static DatabasePool instance;
|
|
662
|
+
private Connection[] connections;
|
|
663
|
+
private int currentIndex = 0;
|
|
664
|
+
|
|
665
|
+
private DatabasePool() {
|
|
666
|
+
connections = new Connection[10];
|
|
667
|
+
for (int i = 0; i < 10; i++) {
|
|
668
|
+
connections[i] = DriverManager.getConnection(DB_URL);
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
public static DatabasePool getInstance() {
|
|
673
|
+
if (instance == null) {
|
|
674
|
+
instance = new DatabasePool();
|
|
675
|
+
}
|
|
676
|
+
return instance;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
public Connection getConnection() {
|
|
680
|
+
Connection conn = connections[currentIndex];
|
|
681
|
+
currentIndex = (currentIndex + 1) % connections.length;
|
|
682
|
+
return conn;
|
|
683
|
+
}
|
|
684
|
+
}`,
|
|
685
|
+
expectedRuleIds: ["CONC-001"],
|
|
686
|
+
category: "concurrency",
|
|
687
|
+
difficulty: "medium",
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
id: "lang-java-resource-leak",
|
|
691
|
+
description: "Java code not using try-with-resources for AutoCloseable",
|
|
692
|
+
language: "java",
|
|
693
|
+
code: `public class FileProcessor {
|
|
694
|
+
public String readFile(String path) throws IOException {
|
|
695
|
+
FileInputStream fis = new FileInputStream(path);
|
|
696
|
+
BufferedReader reader = new BufferedReader(new InputStreamReader(fis));
|
|
697
|
+
StringBuilder sb = new StringBuilder();
|
|
698
|
+
String line;
|
|
699
|
+
while ((line = reader.readLine()) != null) {
|
|
700
|
+
sb.append(line).append("\\n");
|
|
701
|
+
}
|
|
702
|
+
return sb.toString();
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
public void copyFile(String src, String dst) throws IOException {
|
|
706
|
+
FileInputStream in = new FileInputStream(src);
|
|
707
|
+
FileOutputStream out = new FileOutputStream(dst);
|
|
708
|
+
byte[] buffer = new byte[4096];
|
|
709
|
+
int bytesRead;
|
|
710
|
+
while ((bytesRead = in.read(buffer)) != -1) {
|
|
711
|
+
out.write(buffer, 0, bytesRead);
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
public List<String> queryDatabase(String sql) throws SQLException {
|
|
716
|
+
Connection conn = DriverManager.getConnection(DB_URL);
|
|
717
|
+
Statement stmt = conn.createStatement();
|
|
718
|
+
ResultSet rs = stmt.executeQuery(sql);
|
|
719
|
+
List<String> results = new ArrayList<>();
|
|
720
|
+
while (rs.next()) {
|
|
721
|
+
results.add(rs.getString(1));
|
|
722
|
+
}
|
|
723
|
+
return results;
|
|
724
|
+
}
|
|
725
|
+
}`,
|
|
726
|
+
expectedRuleIds: ["ERR-001", "PERF-001"],
|
|
727
|
+
category: "error-handling",
|
|
728
|
+
difficulty: "medium",
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
id: "lang-java-xxe-transformer",
|
|
732
|
+
description: "Java XML parsing vulnerable to XXE via TransformerFactory",
|
|
733
|
+
language: "java",
|
|
734
|
+
code: `import javax.xml.transform.*;
|
|
735
|
+
import javax.xml.transform.stream.*;
|
|
736
|
+
|
|
737
|
+
public class XmlService {
|
|
738
|
+
public String transformXml(String xmlInput, String xsltPath) throws Exception {
|
|
739
|
+
TransformerFactory factory = TransformerFactory.newInstance();
|
|
740
|
+
Source xslt = new StreamSource(new File(xsltPath));
|
|
741
|
+
Transformer transformer = factory.newTransformer(xslt);
|
|
742
|
+
|
|
743
|
+
Source xmlSource = new StreamSource(new StringReader(xmlInput));
|
|
744
|
+
StringWriter writer = new StringWriter();
|
|
745
|
+
transformer.transform(xmlSource, new StreamResult(writer));
|
|
746
|
+
return writer.toString();
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
public Document parseXml(String xml) throws Exception {
|
|
750
|
+
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
|
751
|
+
DocumentBuilder builder = factory.newDocumentBuilder();
|
|
752
|
+
return builder.parse(new InputSource(new StringReader(xml)));
|
|
753
|
+
}
|
|
754
|
+
}`,
|
|
755
|
+
expectedRuleIds: ["CYBER-001", "SEC-001"],
|
|
756
|
+
category: "security",
|
|
757
|
+
difficulty: "hard",
|
|
758
|
+
},
|
|
759
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
760
|
+
// Python-specific patterns
|
|
761
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
762
|
+
{
|
|
763
|
+
id: "lang-python-mutable-default",
|
|
764
|
+
description: "Python mutable default arguments causing shared state",
|
|
765
|
+
language: "python",
|
|
766
|
+
code: `def add_item(item, items=[]):
|
|
767
|
+
items.append(item)
|
|
768
|
+
return items
|
|
769
|
+
|
|
770
|
+
def create_user(name, roles=[], metadata={}):
|
|
771
|
+
metadata['created'] = time.time()
|
|
772
|
+
roles.append('user')
|
|
773
|
+
return {'name': name, 'roles': roles, 'metadata': metadata}
|
|
774
|
+
|
|
775
|
+
class TaskQueue:
|
|
776
|
+
def __init__(self, tasks=[], config={}):
|
|
777
|
+
self.tasks = tasks
|
|
778
|
+
self.config = config
|
|
779
|
+
|
|
780
|
+
def add_task(self, task):
|
|
781
|
+
self.tasks.append(task)
|
|
782
|
+
|
|
783
|
+
def set_config(self, key, value):
|
|
784
|
+
self.config[key] = value`,
|
|
785
|
+
expectedRuleIds: ["SWDEV-001"],
|
|
786
|
+
category: "concurrency",
|
|
787
|
+
difficulty: "medium",
|
|
788
|
+
},
|
|
789
|
+
{
|
|
790
|
+
id: "lang-python-pickle-load",
|
|
791
|
+
description: "Python loading pickle from untrusted source",
|
|
792
|
+
language: "python",
|
|
793
|
+
code: `import pickle
|
|
794
|
+
import flask
|
|
795
|
+
|
|
796
|
+
app = flask.Flask(__name__)
|
|
797
|
+
|
|
798
|
+
@app.route('/load-model', methods=['POST'])
|
|
799
|
+
def load_model():
|
|
800
|
+
model_data = flask.request.get_data()
|
|
801
|
+
model = pickle.loads(model_data)
|
|
802
|
+
return flask.jsonify(model.predict([1, 2, 3]))
|
|
803
|
+
|
|
804
|
+
@app.route('/import-data', methods=['POST'])
|
|
805
|
+
def import_data():
|
|
806
|
+
file = flask.request.files['data']
|
|
807
|
+
data = pickle.load(file.stream)
|
|
808
|
+
return flask.jsonify({'rows': len(data)})
|
|
809
|
+
|
|
810
|
+
def load_cache(path):
|
|
811
|
+
with open(path, 'rb') as f:
|
|
812
|
+
return pickle.load(f)`,
|
|
813
|
+
expectedRuleIds: ["CYBER-001", "SEC-001"],
|
|
814
|
+
category: "security",
|
|
815
|
+
difficulty: "medium",
|
|
816
|
+
},
|
|
817
|
+
{
|
|
818
|
+
id: "lang-python-global-state-flask",
|
|
819
|
+
description: "Python Flask app using module-level mutable global state",
|
|
820
|
+
language: "python",
|
|
821
|
+
code: `from flask import Flask, request, jsonify
|
|
822
|
+
|
|
823
|
+
app = Flask(__name__)
|
|
824
|
+
|
|
825
|
+
request_count = 0
|
|
826
|
+
users_cache = {}
|
|
827
|
+
active_sessions = []
|
|
828
|
+
|
|
829
|
+
@app.route('/users/<user_id>')
|
|
830
|
+
def get_user(user_id):
|
|
831
|
+
global request_count
|
|
832
|
+
request_count += 1
|
|
833
|
+
if user_id in users_cache:
|
|
834
|
+
return jsonify(users_cache[user_id])
|
|
835
|
+
user = db.find_user(user_id)
|
|
836
|
+
users_cache[user_id] = user
|
|
837
|
+
return jsonify(user)
|
|
838
|
+
|
|
839
|
+
@app.route('/login', methods=['POST'])
|
|
840
|
+
def login():
|
|
841
|
+
global request_count
|
|
842
|
+
request_count += 1
|
|
843
|
+
session = create_session(request.json)
|
|
844
|
+
active_sessions.append(session)
|
|
845
|
+
return jsonify(session)
|
|
846
|
+
|
|
847
|
+
@app.route('/stats')
|
|
848
|
+
def stats():
|
|
849
|
+
return jsonify({
|
|
850
|
+
'requests': request_count,
|
|
851
|
+
'cached_users': len(users_cache),
|
|
852
|
+
'active_sessions': len(active_sessions)
|
|
853
|
+
})`,
|
|
854
|
+
expectedRuleIds: ["CYBER-001", "OBS-001"],
|
|
855
|
+
category: "concurrency",
|
|
856
|
+
difficulty: "medium",
|
|
857
|
+
},
|
|
858
|
+
{
|
|
859
|
+
id: "lang-python-assert-validation",
|
|
860
|
+
description: "Python using assert for input validation (removed with -O)",
|
|
861
|
+
language: "python",
|
|
862
|
+
code: `def transfer_funds(from_account, to_account, amount):
|
|
863
|
+
assert amount > 0, "Amount must be positive"
|
|
864
|
+
assert from_account != to_account, "Cannot transfer to same account"
|
|
865
|
+
assert from_account.balance >= amount, "Insufficient funds"
|
|
866
|
+
from_account.balance -= amount
|
|
867
|
+
to_account.balance += amount
|
|
868
|
+
|
|
869
|
+
def create_user(username, email, age):
|
|
870
|
+
assert len(username) >= 3, "Username too short"
|
|
871
|
+
assert '@' in email, "Invalid email"
|
|
872
|
+
assert 0 < age < 150, "Invalid age"
|
|
873
|
+
return User(username=username, email=email, age=age)
|
|
874
|
+
|
|
875
|
+
def process_order(items, discount_code=None):
|
|
876
|
+
assert len(items) > 0, "Order must have items"
|
|
877
|
+
assert all(item['qty'] > 0 for item in items), "Quantities must be positive"
|
|
878
|
+
if discount_code:
|
|
879
|
+
assert len(discount_code) == 8, "Invalid discount code"`,
|
|
880
|
+
expectedRuleIds: ["ERR-001"],
|
|
881
|
+
category: "error-handling",
|
|
882
|
+
difficulty: "medium",
|
|
883
|
+
},
|
|
884
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
885
|
+
// C++ patterns
|
|
886
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
887
|
+
{
|
|
888
|
+
id: "lang-cpp-buffer-overflow",
|
|
889
|
+
description: "C++ buffer overflow with strcpy and gets",
|
|
890
|
+
language: "cpp",
|
|
891
|
+
code: `#include <cstring>
|
|
892
|
+
#include <cstdio>
|
|
893
|
+
|
|
894
|
+
void processInput(const char* input) {
|
|
895
|
+
char buffer[64];
|
|
896
|
+
strcpy(buffer, input);
|
|
897
|
+
printf("Processed: %s\\n", buffer);
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
void readUserName() {
|
|
901
|
+
char name[32];
|
|
902
|
+
printf("Enter name: ");
|
|
903
|
+
gets(name);
|
|
904
|
+
printf("Hello, %s\\n", name);
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
void copyData(const char* src) {
|
|
908
|
+
char dest[128];
|
|
909
|
+
sprintf(dest, "Data: %s (processed at %s)", src, __TIME__);
|
|
910
|
+
processOutput(dest);
|
|
911
|
+
}`,
|
|
912
|
+
expectedRuleIds: ["SEC-001"],
|
|
913
|
+
category: "security",
|
|
914
|
+
difficulty: "easy",
|
|
915
|
+
},
|
|
916
|
+
{
|
|
917
|
+
id: "lang-cpp-use-after-free",
|
|
918
|
+
description: "C++ use-after-free with raw pointers",
|
|
919
|
+
language: "cpp",
|
|
920
|
+
code: `#include <vector>
|
|
921
|
+
#include <string>
|
|
922
|
+
|
|
923
|
+
class ConnectionPool {
|
|
924
|
+
std::vector<Connection*> connections;
|
|
925
|
+
public:
|
|
926
|
+
Connection* getConnection() {
|
|
927
|
+
if (connections.empty()) return nullptr;
|
|
928
|
+
Connection* conn = connections.back();
|
|
929
|
+
connections.pop_back();
|
|
930
|
+
return conn;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
void releaseConnection(Connection* conn) {
|
|
934
|
+
delete conn;
|
|
935
|
+
connections.push_back(conn); // use-after-free
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
void cleanup() {
|
|
939
|
+
for (auto* conn : connections) {
|
|
940
|
+
delete conn;
|
|
941
|
+
}
|
|
942
|
+
// connections still holds dangling pointers
|
|
943
|
+
for (auto* conn : connections) {
|
|
944
|
+
conn->reset(); // use-after-free
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
};`,
|
|
948
|
+
expectedRuleIds: ["SEC-001"],
|
|
949
|
+
category: "security",
|
|
950
|
+
difficulty: "hard",
|
|
951
|
+
},
|
|
952
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
953
|
+
// Multi-language Database patterns
|
|
954
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
955
|
+
{
|
|
956
|
+
id: "lang-python-django-raw-sql",
|
|
957
|
+
description: "Django model using raw SQL instead of ORM",
|
|
958
|
+
language: "python",
|
|
959
|
+
code: `from django.db import connection, models
|
|
960
|
+
|
|
961
|
+
class Product(models.Model):
|
|
962
|
+
name = models.CharField(max_length=200)
|
|
963
|
+
price = models.DecimalField(max_digits=10, decimal_places=2)
|
|
964
|
+
|
|
965
|
+
@staticmethod
|
|
966
|
+
def search(query, min_price):
|
|
967
|
+
with connection.cursor() as cursor:
|
|
968
|
+
cursor.execute(
|
|
969
|
+
f"SELECT * FROM products WHERE name LIKE '%%{query}%%' AND price >= {min_price}"
|
|
970
|
+
)
|
|
971
|
+
return cursor.fetchall()
|
|
972
|
+
|
|
973
|
+
@staticmethod
|
|
974
|
+
def bulk_update_prices(category, multiplier):
|
|
975
|
+
with connection.cursor() as cursor:
|
|
976
|
+
cursor.execute(
|
|
977
|
+
f"UPDATE products SET price = price * {multiplier} WHERE category = '{category}'"
|
|
978
|
+
)`,
|
|
979
|
+
expectedRuleIds: ["CYBER-001", "DB-001"],
|
|
980
|
+
category: "security",
|
|
981
|
+
difficulty: "medium",
|
|
982
|
+
},
|
|
983
|
+
{
|
|
984
|
+
id: "lang-go-sql-string-concat",
|
|
985
|
+
description: "Go database queries with fmt.Sprintf for SQL",
|
|
986
|
+
language: "go",
|
|
987
|
+
code: `package handlers
|
|
988
|
+
|
|
989
|
+
import (
|
|
990
|
+
"database/sql"
|
|
991
|
+
"fmt"
|
|
992
|
+
"net/http"
|
|
993
|
+
)
|
|
994
|
+
|
|
995
|
+
func SearchHandler(db *sql.DB) http.HandlerFunc {
|
|
996
|
+
return func(w http.ResponseWriter, r *http.Request) {
|
|
997
|
+
name := r.URL.Query().Get("name")
|
|
998
|
+
category := r.URL.Query().Get("category")
|
|
999
|
+
query := fmt.Sprintf(
|
|
1000
|
+
"SELECT * FROM products WHERE name LIKE '%%%s%%' AND category = '%s'",
|
|
1001
|
+
name, category,
|
|
1002
|
+
)
|
|
1003
|
+
rows, err := db.Query(query)
|
|
1004
|
+
if err != nil {
|
|
1005
|
+
http.Error(w, err.Error(), 500)
|
|
1006
|
+
return
|
|
1007
|
+
}
|
|
1008
|
+
defer rows.Close()
|
|
1009
|
+
json.NewEncoder(w).Encode(scanRows(rows))
|
|
1010
|
+
}
|
|
1011
|
+
}`,
|
|
1012
|
+
expectedRuleIds: ["SCALE-001"],
|
|
1013
|
+
category: "security",
|
|
1014
|
+
difficulty: "easy",
|
|
1015
|
+
},
|
|
1016
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
1017
|
+
// Multi-language Auth patterns
|
|
1018
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
1019
|
+
{
|
|
1020
|
+
id: "lang-python-hardcoded-secret",
|
|
1021
|
+
description: "Python Flask app with hardcoded secret keys",
|
|
1022
|
+
language: "python",
|
|
1023
|
+
code: `from flask import Flask
|
|
1024
|
+
|
|
1025
|
+
app = Flask(__name__)
|
|
1026
|
+
app.secret_key = 'super-secret-key-do-not-share'
|
|
1027
|
+
|
|
1028
|
+
JWT_SECRET = 'jwt-signing-key-2024'
|
|
1029
|
+
API_KEY = 'sk-prod-a1b2c3d4e5f6g7h8i9j0'
|
|
1030
|
+
DATABASE_PASSWORD = 'P@ssw0rd123!'
|
|
1031
|
+
|
|
1032
|
+
STRIPE_SECRET_KEY = 'sk_live_abc123def456ghi789'
|
|
1033
|
+
AWS_SECRET_ACCESS_KEY = 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'
|
|
1034
|
+
|
|
1035
|
+
@app.route('/')
|
|
1036
|
+
def index():
|
|
1037
|
+
return 'Hello'`,
|
|
1038
|
+
expectedRuleIds: ["AUTH-001", "SEC-001"],
|
|
1039
|
+
category: "auth",
|
|
1040
|
+
difficulty: "easy",
|
|
1041
|
+
},
|
|
1042
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
1043
|
+
// Multi-language Error Handling patterns
|
|
1044
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
1045
|
+
{
|
|
1046
|
+
id: "lang-ruby-rescue-exception",
|
|
1047
|
+
description: "Ruby rescuing Exception instead of StandardError",
|
|
1048
|
+
language: "ruby",
|
|
1049
|
+
code: `class DataProcessor
|
|
1050
|
+
def process(data)
|
|
1051
|
+
result = transform(data)
|
|
1052
|
+
save_to_database(result)
|
|
1053
|
+
rescue Exception => e
|
|
1054
|
+
puts "Error: #{e.message}"
|
|
1055
|
+
nil
|
|
1056
|
+
end
|
|
1057
|
+
|
|
1058
|
+
def fetch_remote(url)
|
|
1059
|
+
response = Net::HTTP.get(URI(url))
|
|
1060
|
+
JSON.parse(response)
|
|
1061
|
+
rescue Exception
|
|
1062
|
+
{}
|
|
1063
|
+
end
|
|
1064
|
+
|
|
1065
|
+
def critical_operation
|
|
1066
|
+
perform_operation
|
|
1067
|
+
rescue Exception => e
|
|
1068
|
+
logger.error(e.message)
|
|
1069
|
+
retry
|
|
1070
|
+
end
|
|
1071
|
+
end`,
|
|
1072
|
+
expectedRuleIds: ["SCALE-001", "SWDEV-001", "RATE-001"],
|
|
1073
|
+
category: "error-handling",
|
|
1074
|
+
difficulty: "medium",
|
|
1075
|
+
},
|
|
1076
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
1077
|
+
// Multi-language Performance patterns
|
|
1078
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
1079
|
+
{
|
|
1080
|
+
id: "lang-python-string-concat-loop",
|
|
1081
|
+
description: "Python building strings with += in loop instead of join",
|
|
1082
|
+
language: "python",
|
|
1083
|
+
code: `def generate_csv(records):
|
|
1084
|
+
output = ""
|
|
1085
|
+
output += "id,name,email,created_at\\n"
|
|
1086
|
+
for record in records:
|
|
1087
|
+
output += f"{record['id']},{record['name']},{record['email']},{record['created_at']}\\n"
|
|
1088
|
+
return output
|
|
1089
|
+
|
|
1090
|
+
def build_html_table(rows):
|
|
1091
|
+
html = "<table>"
|
|
1092
|
+
for row in rows:
|
|
1093
|
+
html += "<tr>"
|
|
1094
|
+
for cell in row:
|
|
1095
|
+
html += f"<td>{cell}</td>"
|
|
1096
|
+
html += "</tr>"
|
|
1097
|
+
html += "</table>"
|
|
1098
|
+
return html
|
|
1099
|
+
|
|
1100
|
+
def create_report(sections):
|
|
1101
|
+
report = ""
|
|
1102
|
+
for section in sections:
|
|
1103
|
+
report += f"# {section['title']}\\n\\n"
|
|
1104
|
+
for line in section['content']:
|
|
1105
|
+
report += f" {line}\\n"
|
|
1106
|
+
report += "\\n"
|
|
1107
|
+
return report`,
|
|
1108
|
+
expectedRuleIds: ["PERF-001"],
|
|
1109
|
+
category: "performance",
|
|
1110
|
+
difficulty: "easy",
|
|
1111
|
+
},
|
|
1112
|
+
{
|
|
1113
|
+
id: "lang-java-string-concat-loop",
|
|
1114
|
+
description: "Java String concatenation in loop instead of StringBuilder",
|
|
1115
|
+
language: "java",
|
|
1116
|
+
code: `public class ReportGenerator {
|
|
1117
|
+
public String generateReport(List<Record> records) {
|
|
1118
|
+
String report = "";
|
|
1119
|
+
report += "Report generated at: " + new Date() + "\\n";
|
|
1120
|
+
report += "Total records: " + records.size() + "\\n\\n";
|
|
1121
|
+
|
|
1122
|
+
for (Record record : records) {
|
|
1123
|
+
report += "ID: " + record.getId() + "\\n";
|
|
1124
|
+
report += "Name: " + record.getName() + "\\n";
|
|
1125
|
+
report += "Status: " + record.getStatus() + "\\n";
|
|
1126
|
+
report += "---\\n";
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
return report;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
public String buildCsv(List<String[]> rows) {
|
|
1133
|
+
String csv = "";
|
|
1134
|
+
for (String[] row : rows) {
|
|
1135
|
+
for (int i = 0; i < row.length; i++) {
|
|
1136
|
+
csv += row[i];
|
|
1137
|
+
if (i < row.length - 1) csv += ",";
|
|
1138
|
+
}
|
|
1139
|
+
csv += "\\n";
|
|
1140
|
+
}
|
|
1141
|
+
return csv;
|
|
1142
|
+
}
|
|
1143
|
+
}`,
|
|
1144
|
+
expectedRuleIds: ["PERF-001"],
|
|
1145
|
+
category: "performance",
|
|
1146
|
+
difficulty: "easy",
|
|
1147
|
+
},
|
|
1148
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
1149
|
+
// CLEAN CODE — Language-specific FP validation
|
|
1150
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
1151
|
+
{
|
|
1152
|
+
id: "clean-go-idiomatic-errors",
|
|
1153
|
+
description: "Clean: Go code with idiomatic error handling and context",
|
|
1154
|
+
language: "go",
|
|
1155
|
+
code: `package repository
|
|
1156
|
+
|
|
1157
|
+
import (
|
|
1158
|
+
"context"
|
|
1159
|
+
"database/sql"
|
|
1160
|
+
"fmt"
|
|
1161
|
+
)
|
|
1162
|
+
|
|
1163
|
+
type UserRepo struct {
|
|
1164
|
+
db *sql.DB
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
func (r *UserRepo) FindByID(ctx context.Context, id string) (*User, error) {
|
|
1168
|
+
row := r.db.QueryRowContext(ctx, "SELECT id, name, email FROM users WHERE id = $1", id)
|
|
1169
|
+
var u User
|
|
1170
|
+
if err := row.Scan(&u.ID, &u.Name, &u.Email); err != nil {
|
|
1171
|
+
if err == sql.ErrNoRows {
|
|
1172
|
+
return nil, nil
|
|
1173
|
+
}
|
|
1174
|
+
return nil, fmt.Errorf("querying user %s: %w", id, err)
|
|
1175
|
+
}
|
|
1176
|
+
return &u, nil
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
func (r *UserRepo) Create(ctx context.Context, u *User) error {
|
|
1180
|
+
_, err := r.db.ExecContext(ctx,
|
|
1181
|
+
"INSERT INTO users (id, name, email) VALUES ($1, $2, $3)",
|
|
1182
|
+
u.ID, u.Name, u.Email,
|
|
1183
|
+
)
|
|
1184
|
+
if err != nil {
|
|
1185
|
+
return fmt.Errorf("inserting user: %w", err)
|
|
1186
|
+
}
|
|
1187
|
+
return nil
|
|
1188
|
+
}`,
|
|
1189
|
+
expectedRuleIds: [],
|
|
1190
|
+
category: "clean",
|
|
1191
|
+
difficulty: "easy",
|
|
1192
|
+
},
|
|
1193
|
+
{
|
|
1194
|
+
id: "clean-rust-result-handling",
|
|
1195
|
+
description: "Clean: Rust using Result and ? operator properly",
|
|
1196
|
+
language: "rust",
|
|
1197
|
+
code: `use std::fs;
|
|
1198
|
+
use std::io;
|
|
1199
|
+
use thiserror::Error;
|
|
1200
|
+
|
|
1201
|
+
#[derive(Error, Debug)]
|
|
1202
|
+
pub enum AppError {
|
|
1203
|
+
#[error("IO error: {0}")]
|
|
1204
|
+
Io(#[from] io::Error),
|
|
1205
|
+
#[error("Parse error: {0}")]
|
|
1206
|
+
Parse(#[from] serde_json::Error),
|
|
1207
|
+
#[error("Config missing key: {0}")]
|
|
1208
|
+
MissingKey(String),
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
pub fn load_config(path: &str) -> Result<Config, AppError> {
|
|
1212
|
+
let content = fs::read_to_string(path)?;
|
|
1213
|
+
let config: Config = serde_json::from_str(&content)?;
|
|
1214
|
+
if config.api_url.is_empty() {
|
|
1215
|
+
return Err(AppError::MissingKey("api_url".into()));
|
|
1216
|
+
}
|
|
1217
|
+
Ok(config)
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
pub fn process_request(body: &[u8]) -> Result<Response, AppError> {
|
|
1221
|
+
let text = std::str::from_utf8(body)
|
|
1222
|
+
.map_err(|e| AppError::Parse(serde_json::Error::custom(e.to_string())))?;
|
|
1223
|
+
let req: Request = serde_json::from_str(text)?;
|
|
1224
|
+
Ok(handle_request(req))
|
|
1225
|
+
}`,
|
|
1226
|
+
expectedRuleIds: [],
|
|
1227
|
+
category: "clean",
|
|
1228
|
+
difficulty: "medium",
|
|
1229
|
+
},
|
|
1230
|
+
{
|
|
1231
|
+
id: "clean-kotlin-null-safety",
|
|
1232
|
+
description: "Clean: Kotlin using proper null safety patterns",
|
|
1233
|
+
language: "kotlin",
|
|
1234
|
+
code: `data class UserProfile(
|
|
1235
|
+
val name: String,
|
|
1236
|
+
val email: String?,
|
|
1237
|
+
val avatarUrl: String?
|
|
1238
|
+
)
|
|
1239
|
+
|
|
1240
|
+
class UserService(private val repository: UserRepository) {
|
|
1241
|
+
fun getUserDisplayName(id: String): String {
|
|
1242
|
+
val user = repository.findById(id) ?: return "Unknown User"
|
|
1243
|
+
return user.profile?.displayName ?: user.name
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
fun getOrderTotal(orderId: String): Double? {
|
|
1247
|
+
val order = orderRepo.findById(orderId) ?: return null
|
|
1248
|
+
return order.items?.sumOf { it.price * it.quantity } ?: 0.0
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
fun processPayment(userId: String): PaymentResult {
|
|
1252
|
+
val user = repository.findById(userId)
|
|
1253
|
+
?: return PaymentResult.Error("User not found")
|
|
1254
|
+
val card = user.paymentMethods?.firstOrNull()
|
|
1255
|
+
?: return PaymentResult.Error("No payment method")
|
|
1256
|
+
return paymentGateway.charge(card.token, cart?.total ?: 0.0)
|
|
1257
|
+
}
|
|
1258
|
+
}`,
|
|
1259
|
+
expectedRuleIds: [],
|
|
1260
|
+
category: "clean",
|
|
1261
|
+
difficulty: "medium",
|
|
1262
|
+
},
|
|
1263
|
+
{
|
|
1264
|
+
id: "clean-swift-optional-binding",
|
|
1265
|
+
description: "Clean: Swift using guard let and optional chaining",
|
|
1266
|
+
language: "swift",
|
|
1267
|
+
code: `class UserManager {
|
|
1268
|
+
var currentUser: User?
|
|
1269
|
+
var session: Session?
|
|
1270
|
+
|
|
1271
|
+
func displayProfile() {
|
|
1272
|
+
guard let user = currentUser else {
|
|
1273
|
+
print("No user logged in")
|
|
1274
|
+
return
|
|
1275
|
+
}
|
|
1276
|
+
guard let email = user.email else {
|
|
1277
|
+
print("No email on file")
|
|
1278
|
+
return
|
|
1279
|
+
}
|
|
1280
|
+
let avatarURL = user.profile?.avatarURL ?? "default-avatar.png"
|
|
1281
|
+
print("User: \\(user.name), Email: \\(email)")
|
|
1282
|
+
if let url = URL(string: avatarURL) {
|
|
1283
|
+
loadImage(from: url)
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
func processPayment(amount: Double) {
|
|
1288
|
+
guard let card = currentUser?.paymentMethods?.first else {
|
|
1289
|
+
print("No payment method available")
|
|
1290
|
+
return
|
|
1291
|
+
}
|
|
1292
|
+
if let response = paymentGateway.charge(card: card, amount: amount),
|
|
1293
|
+
let receipt = response.receipt {
|
|
1294
|
+
saveReceipt(receipt)
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
}`,
|
|
1298
|
+
expectedRuleIds: [],
|
|
1299
|
+
category: "clean",
|
|
1300
|
+
difficulty: "easy",
|
|
1301
|
+
},
|
|
1302
|
+
{
|
|
1303
|
+
id: "clean-java-try-with-resources",
|
|
1304
|
+
description: "Clean: Java using try-with-resources for AutoCloseable",
|
|
1305
|
+
language: "java",
|
|
1306
|
+
code: `import java.io.*;
|
|
1307
|
+
import java.sql.*;
|
|
1308
|
+
import java.util.*;
|
|
1309
|
+
|
|
1310
|
+
public class FileProcessor {
|
|
1311
|
+
public String readFile(String path) throws IOException {
|
|
1312
|
+
try (var fis = new FileInputStream(path);
|
|
1313
|
+
var reader = new BufferedReader(new InputStreamReader(fis))) {
|
|
1314
|
+
var sb = new StringBuilder();
|
|
1315
|
+
String line;
|
|
1316
|
+
while ((line = reader.readLine()) != null) {
|
|
1317
|
+
sb.append(line).append("\\n");
|
|
1318
|
+
}
|
|
1319
|
+
return sb.toString();
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
public List<String> queryDatabase(String sql) throws SQLException {
|
|
1324
|
+
try (var conn = DriverManager.getConnection(DB_URL);
|
|
1325
|
+
var stmt = conn.createStatement();
|
|
1326
|
+
var rs = stmt.executeQuery(sql)) {
|
|
1327
|
+
var results = new ArrayList<String>();
|
|
1328
|
+
while (rs.next()) {
|
|
1329
|
+
results.add(rs.getString(1));
|
|
1330
|
+
}
|
|
1331
|
+
return results;
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
}`,
|
|
1335
|
+
expectedRuleIds: [],
|
|
1336
|
+
category: "clean",
|
|
1337
|
+
difficulty: "easy",
|
|
1338
|
+
},
|
|
1339
|
+
{
|
|
1340
|
+
id: "clean-php-prepared-statements",
|
|
1341
|
+
description: "Clean: PHP using PDO prepared statements throughout",
|
|
1342
|
+
language: "php",
|
|
1343
|
+
code: `<?php
|
|
1344
|
+
class UserRepository {
|
|
1345
|
+
private PDO $pdo;
|
|
1346
|
+
|
|
1347
|
+
public function __construct(PDO $pdo) {
|
|
1348
|
+
$this->pdo = $pdo;
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
public function search(string $name, string $role): array {
|
|
1352
|
+
$stmt = $this->pdo->prepare(
|
|
1353
|
+
"SELECT * FROM users WHERE name LIKE :name AND role = :role"
|
|
1354
|
+
);
|
|
1355
|
+
$stmt->execute([':name' => "%{$name}%", ':role' => $role]);
|
|
1356
|
+
return $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
public function updateEmail(int $id, string $email): void {
|
|
1360
|
+
$stmt = $this->pdo->prepare("UPDATE users SET email = :email WHERE id = :id");
|
|
1361
|
+
$stmt->execute([':email' => $email, ':id' => $id]);
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
public function deleteById(int $id): bool {
|
|
1365
|
+
$stmt = $this->pdo->prepare("DELETE FROM users WHERE id = :id");
|
|
1366
|
+
return $stmt->execute([':id' => $id]);
|
|
1367
|
+
}
|
|
1368
|
+
}`,
|
|
1369
|
+
expectedRuleIds: [],
|
|
1370
|
+
category: "clean",
|
|
1371
|
+
difficulty: "easy",
|
|
1372
|
+
},
|
|
1373
|
+
{
|
|
1374
|
+
id: "clean-ruby-safe-sinatra",
|
|
1375
|
+
description: "Clean: Ruby Sinatra with parameterized queries and input validation",
|
|
1376
|
+
language: "ruby",
|
|
1377
|
+
code: `require 'sinatra'
|
|
1378
|
+
require 'sequel'
|
|
1379
|
+
require 'json'
|
|
1380
|
+
|
|
1381
|
+
DB = Sequel.connect(ENV['DATABASE_URL'])
|
|
1382
|
+
|
|
1383
|
+
get '/users' do
|
|
1384
|
+
name = params[:name]
|
|
1385
|
+
halt 400, { error: 'name parameter required' }.to_json unless name
|
|
1386
|
+
|
|
1387
|
+
users = DB[:users].where(Sequel.ilike(:name, "%#{DB.literal(name).gsub("'", '')}%")).all
|
|
1388
|
+
users.to_json
|
|
1389
|
+
end
|
|
1390
|
+
|
|
1391
|
+
post '/users' do
|
|
1392
|
+
data = JSON.parse(request.body.read)
|
|
1393
|
+
halt 400, { error: 'name required' }.to_json unless data['name']&.length&.between?(1, 100)
|
|
1394
|
+
halt 400, { error: 'invalid email' }.to_json unless data['email']&.match?(/\\A[^@]+@[^@]+\\z/)
|
|
1395
|
+
|
|
1396
|
+
id = DB[:users].insert(name: data['name'], email: data['email'])
|
|
1397
|
+
status 201
|
|
1398
|
+
{ id: id }.to_json
|
|
1399
|
+
end`,
|
|
1400
|
+
expectedRuleIds: [],
|
|
1401
|
+
category: "clean",
|
|
1402
|
+
difficulty: "medium",
|
|
1403
|
+
},
|
|
1404
|
+
{
|
|
1405
|
+
id: "clean-python-proper-logging",
|
|
1406
|
+
description: "Clean: Python with proper logging and error handling",
|
|
1407
|
+
language: "python",
|
|
1408
|
+
code: `import logging
|
|
1409
|
+
from contextlib import contextmanager
|
|
1410
|
+
from typing import Generator
|
|
1411
|
+
|
|
1412
|
+
logger = logging.getLogger(__name__)
|
|
1413
|
+
|
|
1414
|
+
@contextmanager
|
|
1415
|
+
def managed_connection(url: str) -> Generator[Connection, None, None]:
|
|
1416
|
+
conn = connect(url)
|
|
1417
|
+
try:
|
|
1418
|
+
yield conn
|
|
1419
|
+
except DatabaseError as e:
|
|
1420
|
+
logger.error("Database error: %s", e, exc_info=True)
|
|
1421
|
+
raise
|
|
1422
|
+
finally:
|
|
1423
|
+
conn.close()
|
|
1424
|
+
|
|
1425
|
+
def process_batch(items: list[dict]) -> list[dict]:
|
|
1426
|
+
results = []
|
|
1427
|
+
for item in items:
|
|
1428
|
+
try:
|
|
1429
|
+
result = transform(item)
|
|
1430
|
+
results.append(result)
|
|
1431
|
+
except ValueError as e:
|
|
1432
|
+
logger.warning("Skipping invalid item %s: %s", item.get('id'), e)
|
|
1433
|
+
except IOError as e:
|
|
1434
|
+
logger.error("I/O error processing %s: %s", item.get('id'), e)
|
|
1435
|
+
raise
|
|
1436
|
+
return results`,
|
|
1437
|
+
expectedRuleIds: [],
|
|
1438
|
+
category: "clean",
|
|
1439
|
+
difficulty: "easy",
|
|
1440
|
+
},
|
|
1441
|
+
{
|
|
1442
|
+
id: "clean-csharp-parameterized",
|
|
1443
|
+
description: "Clean: C# with parameterized queries and proper disposal",
|
|
1444
|
+
language: "csharp",
|
|
1445
|
+
code: `using System.Data.SqlClient;
|
|
1446
|
+
|
|
1447
|
+
public class UserRepository : IDisposable
|
|
1448
|
+
{
|
|
1449
|
+
private readonly SqlConnection _conn;
|
|
1450
|
+
|
|
1451
|
+
public UserRepository(string connectionString)
|
|
1452
|
+
{
|
|
1453
|
+
_conn = new SqlConnection(connectionString);
|
|
1454
|
+
_conn.Open();
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
public User? GetUser(string username)
|
|
1458
|
+
{
|
|
1459
|
+
using var cmd = new SqlCommand("SELECT Id, Username, Email FROM Users WHERE Username = @username", _conn);
|
|
1460
|
+
cmd.Parameters.AddWithValue("@username", username);
|
|
1461
|
+
using var reader = cmd.ExecuteReader();
|
|
1462
|
+
if (reader.Read())
|
|
1463
|
+
{
|
|
1464
|
+
return new User
|
|
1465
|
+
{
|
|
1466
|
+
Id = reader.GetInt32(0),
|
|
1467
|
+
Name = reader.GetString(1),
|
|
1468
|
+
Email = reader.GetString(2)
|
|
1469
|
+
};
|
|
1470
|
+
}
|
|
1471
|
+
return null;
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
public void Dispose()
|
|
1475
|
+
{
|
|
1476
|
+
_conn?.Dispose();
|
|
1477
|
+
}
|
|
1478
|
+
}`,
|
|
1479
|
+
expectedRuleIds: [],
|
|
1480
|
+
category: "clean",
|
|
1481
|
+
difficulty: "easy",
|
|
1482
|
+
},
|
|
1483
|
+
{
|
|
1484
|
+
id: "clean-cpp-smart-pointers",
|
|
1485
|
+
description: "Clean: C++ using smart pointers and RAII",
|
|
1486
|
+
language: "cpp",
|
|
1487
|
+
code: `#include <memory>
|
|
1488
|
+
#include <vector>
|
|
1489
|
+
#include <string>
|
|
1490
|
+
|
|
1491
|
+
class ConnectionPool {
|
|
1492
|
+
std::vector<std::unique_ptr<Connection>> connections;
|
|
1493
|
+
public:
|
|
1494
|
+
std::unique_ptr<Connection> getConnection() {
|
|
1495
|
+
if (connections.empty()) return nullptr;
|
|
1496
|
+
auto conn = std::move(connections.back());
|
|
1497
|
+
connections.pop_back();
|
|
1498
|
+
return conn;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
void releaseConnection(std::unique_ptr<Connection> conn) {
|
|
1502
|
+
conn->reset();
|
|
1503
|
+
connections.push_back(std::move(conn));
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
void addConnection(const std::string& url) {
|
|
1507
|
+
connections.push_back(std::make_unique<Connection>(url));
|
|
1508
|
+
}
|
|
1509
|
+
};
|
|
1510
|
+
|
|
1511
|
+
void processData(const std::string& input) {
|
|
1512
|
+
auto buffer = std::make_unique<char[]>(input.size() + 1);
|
|
1513
|
+
std::copy(input.begin(), input.end(), buffer.get());
|
|
1514
|
+
buffer[input.size()] = '\\0';
|
|
1515
|
+
processOutput(buffer.get());
|
|
1516
|
+
}`,
|
|
1517
|
+
expectedRuleIds: [],
|
|
1518
|
+
category: "clean",
|
|
1519
|
+
difficulty: "medium",
|
|
1520
|
+
},
|
|
1521
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
1522
|
+
// Additional multi-language benchmark cases
|
|
1523
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
1524
|
+
{
|
|
1525
|
+
id: "lang-ruby-sql-injection",
|
|
1526
|
+
description: "Ruby on Rails controller with SQL injection via string interpolation",
|
|
1527
|
+
language: "ruby",
|
|
1528
|
+
code: `class UsersController < ApplicationController
|
|
1529
|
+
def search
|
|
1530
|
+
query = params[:q]
|
|
1531
|
+
@users = User.where("name LIKE '%#{query}%'")
|
|
1532
|
+
render json: @users
|
|
1533
|
+
end
|
|
1534
|
+
|
|
1535
|
+
def destroy
|
|
1536
|
+
User.connection.execute("DELETE FROM users WHERE id = #{params[:id]}")
|
|
1537
|
+
head :no_content
|
|
1538
|
+
end
|
|
1539
|
+
end`,
|
|
1540
|
+
expectedRuleIds: ["CYBER-001", "DB-001"],
|
|
1541
|
+
category: "security",
|
|
1542
|
+
difficulty: "easy",
|
|
1543
|
+
},
|
|
1544
|
+
{
|
|
1545
|
+
id: "lang-ruby-mass-assignment",
|
|
1546
|
+
description: "Ruby on Rails controller permitting all params without filtering",
|
|
1547
|
+
language: "ruby",
|
|
1548
|
+
code: `class AccountsController < ApplicationController
|
|
1549
|
+
def create
|
|
1550
|
+
@account = Account.new(params.permit!)
|
|
1551
|
+
if @account.save
|
|
1552
|
+
render json: @account, status: :created
|
|
1553
|
+
else
|
|
1554
|
+
render json: @account.errors, status: :unprocessable_entity
|
|
1555
|
+
end
|
|
1556
|
+
end
|
|
1557
|
+
|
|
1558
|
+
def update
|
|
1559
|
+
@account = Account.find(params[:id])
|
|
1560
|
+
@account.update(params.permit!)
|
|
1561
|
+
render json: @account
|
|
1562
|
+
end
|
|
1563
|
+
end`,
|
|
1564
|
+
expectedRuleIds: ["CYBER-001", "SEC-001"],
|
|
1565
|
+
category: "security",
|
|
1566
|
+
difficulty: "medium",
|
|
1567
|
+
},
|
|
1568
|
+
{
|
|
1569
|
+
id: "lang-php-eval-user-input",
|
|
1570
|
+
description: "PHP code using eval with user-supplied input",
|
|
1571
|
+
language: "php",
|
|
1572
|
+
code: `<?php
|
|
1573
|
+
function calculate($expression) {
|
|
1574
|
+
return eval("return " . $_GET['expr'] . ";");
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
function processTemplate($template, $vars) {
|
|
1578
|
+
foreach ($vars as $key => $value) {
|
|
1579
|
+
$template = str_replace("{{" . $key . "}}", $value, $template);
|
|
1580
|
+
}
|
|
1581
|
+
eval("?>" . $template);
|
|
1582
|
+
}
|
|
1583
|
+
?>`,
|
|
1584
|
+
expectedRuleIds: ["CYBER-001"],
|
|
1585
|
+
category: "security",
|
|
1586
|
+
difficulty: "easy",
|
|
1587
|
+
},
|
|
1588
|
+
{
|
|
1589
|
+
id: "lang-php-file-inclusion",
|
|
1590
|
+
description: "PHP remote/local file inclusion vulnerability",
|
|
1591
|
+
language: "php",
|
|
1592
|
+
code: `<?php
|
|
1593
|
+
$page = $_GET['page'];
|
|
1594
|
+
include($page . '.php');
|
|
1595
|
+
|
|
1596
|
+
function loadModule($module) {
|
|
1597
|
+
require_once($_POST['module_path'] . '/' . $module);
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
function getTemplate() {
|
|
1601
|
+
$template = $_COOKIE['template'];
|
|
1602
|
+
include("templates/" . $template);
|
|
1603
|
+
}
|
|
1604
|
+
?>`,
|
|
1605
|
+
expectedRuleIds: ["CYBER-001", "SEC-001"],
|
|
1606
|
+
category: "security",
|
|
1607
|
+
difficulty: "easy",
|
|
1608
|
+
},
|
|
1609
|
+
{
|
|
1610
|
+
id: "lang-scala-blocking-future",
|
|
1611
|
+
description: "Scala code blocking on Future with Await.result in async context",
|
|
1612
|
+
language: "scala",
|
|
1613
|
+
code: `import scala.concurrent._
|
|
1614
|
+
import scala.concurrent.duration._
|
|
1615
|
+
import scala.concurrent.ExecutionContext.Implicits.global
|
|
1616
|
+
|
|
1617
|
+
class UserService {
|
|
1618
|
+
def getUser(id: String): User = {
|
|
1619
|
+
val future = Future { db.findUser(id) }
|
|
1620
|
+
Await.result(future, 30.seconds) // blocks thread pool thread
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1623
|
+
def getAllUsers(): List[User] = {
|
|
1624
|
+
val futures = userIds.map(id => Future { db.findUser(id) })
|
|
1625
|
+
futures.map(f => Await.result(f, 10.seconds)).toList // blocks for each
|
|
1626
|
+
}
|
|
1627
|
+
}`,
|
|
1628
|
+
expectedRuleIds: ["COST-001"],
|
|
1629
|
+
category: "concurrency",
|
|
1630
|
+
difficulty: "medium",
|
|
1631
|
+
},
|
|
1632
|
+
{
|
|
1633
|
+
id: "lang-dart-insecure-http",
|
|
1634
|
+
description: "Dart/Flutter app using insecure HTTP for API calls",
|
|
1635
|
+
language: "dart",
|
|
1636
|
+
code: `import 'dart:convert';
|
|
1637
|
+
import 'package:http/http.dart' as http;
|
|
1638
|
+
|
|
1639
|
+
class ApiClient {
|
|
1640
|
+
static const baseUrl = 'http://api.example.com';
|
|
1641
|
+
|
|
1642
|
+
Future<Map<String, dynamic>> login(String email, String password) async {
|
|
1643
|
+
final response = await http.post(
|
|
1644
|
+
Uri.parse('$baseUrl/auth/login'),
|
|
1645
|
+
body: jsonEncode({'email': email, 'password': password}),
|
|
1646
|
+
);
|
|
1647
|
+
return jsonDecode(response.body);
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
Future<Map<String, dynamic>> getProfile(String token) async {
|
|
1651
|
+
final response = await http.get(
|
|
1652
|
+
Uri.parse('$baseUrl/profile'),
|
|
1653
|
+
headers: {'Authorization': 'Bearer $token'},
|
|
1654
|
+
);
|
|
1655
|
+
return jsonDecode(response.body);
|
|
1656
|
+
}
|
|
1657
|
+
}`,
|
|
1658
|
+
expectedRuleIds: ["SEC-001", "AUTH-001"],
|
|
1659
|
+
category: "security",
|
|
1660
|
+
difficulty: "easy",
|
|
1661
|
+
},
|
|
1662
|
+
{
|
|
1663
|
+
id: "lang-kotlin-insecure-prefs",
|
|
1664
|
+
description: "Kotlin Android app storing secrets in SharedPreferences",
|
|
1665
|
+
language: "kotlin",
|
|
1666
|
+
code: `class AuthManager(private val context: Context) {
|
|
1667
|
+
fun saveCredentials(username: String, password: String, token: String) {
|
|
1668
|
+
val prefs = context.getSharedPreferences("auth", Context.MODE_PRIVATE)
|
|
1669
|
+
prefs.edit()
|
|
1670
|
+
.putString("username", username)
|
|
1671
|
+
.putString("password", password)
|
|
1672
|
+
.putString("auth_token", token)
|
|
1673
|
+
.putString("refresh_token", token)
|
|
1674
|
+
.apply()
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
fun getToken(): String? {
|
|
1678
|
+
val prefs = context.getSharedPreferences("auth", Context.MODE_PRIVATE)
|
|
1679
|
+
return prefs.getString("auth_token", null)
|
|
1680
|
+
}
|
|
1681
|
+
}`,
|
|
1682
|
+
expectedRuleIds: ["CYBER-001"],
|
|
1683
|
+
category: "auth",
|
|
1684
|
+
difficulty: "medium",
|
|
1685
|
+
},
|
|
1686
|
+
{
|
|
1687
|
+
id: "lang-swift-force-unwrap-chain",
|
|
1688
|
+
description: "Swift code with excessive force unwrapping risking crashes",
|
|
1689
|
+
language: "swift",
|
|
1690
|
+
code: `func processResponse(_ data: Data?) -> UserProfile {
|
|
1691
|
+
let json = try! JSONSerialization.jsonObject(with: data!, options: []) as! [String: Any]
|
|
1692
|
+
let user = json["user"] as! [String: Any]
|
|
1693
|
+
let name = user["name"] as! String
|
|
1694
|
+
let age = user["age"] as! Int
|
|
1695
|
+
let address = user["address"] as! [String: Any]
|
|
1696
|
+
let city = address["city"] as! String
|
|
1697
|
+
let coords = address["coordinates"] as! [Double]
|
|
1698
|
+
return UserProfile(name: name, age: age, city: city, lat: coords[0], lon: coords[1])
|
|
1699
|
+
}`,
|
|
1700
|
+
expectedRuleIds: ["ERR-001"],
|
|
1701
|
+
category: "error-handling",
|
|
1702
|
+
difficulty: "easy",
|
|
1703
|
+
},
|
|
1704
|
+
{
|
|
1705
|
+
id: "lang-r-no-input-validation",
|
|
1706
|
+
description: "R Shiny application without input validation or sanitization",
|
|
1707
|
+
language: "r",
|
|
1708
|
+
code: `library(shiny)
|
|
1709
|
+
library(DBI)
|
|
1710
|
+
|
|
1711
|
+
server <- function(input, output, session) {
|
|
1712
|
+
output$results <- renderTable({
|
|
1713
|
+
query <- paste0("SELECT * FROM patients WHERE name LIKE '%", input$search, "%'")
|
|
1714
|
+
dbGetQuery(con, query)
|
|
1715
|
+
})
|
|
1716
|
+
|
|
1717
|
+
observeEvent(input$delete, {
|
|
1718
|
+
query <- paste0("DELETE FROM patients WHERE id = ", input$patient_id)
|
|
1719
|
+
dbExecute(con, query)
|
|
1720
|
+
})
|
|
1721
|
+
}`,
|
|
1722
|
+
expectedRuleIds: ["CYBER-001", "DB-001"],
|
|
1723
|
+
category: "security",
|
|
1724
|
+
difficulty: "medium",
|
|
1725
|
+
},
|
|
1726
|
+
{
|
|
1727
|
+
id: "lang-elixir-atom-leak",
|
|
1728
|
+
description: "Elixir code converting user input to atoms risking atom table exhaustion",
|
|
1729
|
+
language: "elixir",
|
|
1730
|
+
code: `defmodule Router do
|
|
1731
|
+
def handle_request(conn) do
|
|
1732
|
+
action = conn.params["action"] |> String.to_atom()
|
|
1733
|
+
format = conn.params["format"] |> String.to_atom()
|
|
1734
|
+
|
|
1735
|
+
case action do
|
|
1736
|
+
:index -> list_items(conn, format)
|
|
1737
|
+
:show -> show_item(conn, format)
|
|
1738
|
+
_ -> send_resp(conn, 404, "Not found")
|
|
1739
|
+
end
|
|
1740
|
+
end
|
|
1741
|
+
end`,
|
|
1742
|
+
expectedRuleIds: ["SEC-001"],
|
|
1743
|
+
category: "security",
|
|
1744
|
+
difficulty: "hard",
|
|
1745
|
+
},
|
|
1746
|
+
{
|
|
1747
|
+
id: "lang-lua-global-pollution",
|
|
1748
|
+
description: "Lua code polluting global namespace and using loadstring",
|
|
1749
|
+
language: "lua",
|
|
1750
|
+
code: `-- No local declarations — all globals
|
|
1751
|
+
function processInput(data)
|
|
1752
|
+
result = {}
|
|
1753
|
+
for i = 1, #data do
|
|
1754
|
+
item = data[i]
|
|
1755
|
+
transformed = transform(item)
|
|
1756
|
+
table.insert(result, transformed)
|
|
1757
|
+
end
|
|
1758
|
+
return result
|
|
1759
|
+
end
|
|
1760
|
+
|
|
1761
|
+
function executeUserCode(code)
|
|
1762
|
+
local fn = loadstring(code)
|
|
1763
|
+
fn()
|
|
1764
|
+
end`,
|
|
1765
|
+
expectedRuleIds: ["SEC-001"],
|
|
1766
|
+
category: "security",
|
|
1767
|
+
difficulty: "medium",
|
|
1768
|
+
},
|
|
1769
|
+
{
|
|
1770
|
+
id: "lang-clean-rust-error-handling",
|
|
1771
|
+
description: "Rust with proper error handling using Result and the ? operator",
|
|
1772
|
+
language: "rust",
|
|
1773
|
+
code: `use std::fs;
|
|
1774
|
+
use std::io;
|
|
1775
|
+
use thiserror::Error;
|
|
1776
|
+
|
|
1777
|
+
#[derive(Error, Debug)]
|
|
1778
|
+
pub enum AppError {
|
|
1779
|
+
#[error("IO error: {0}")]
|
|
1780
|
+
Io(#[from] io::Error),
|
|
1781
|
+
#[error("Parse error: {0}")]
|
|
1782
|
+
Parse(#[from] serde_json::Error),
|
|
1783
|
+
#[error("Not found: {0}")]
|
|
1784
|
+
NotFound(String),
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
pub fn load_config(path: &str) -> Result<Config, AppError> {
|
|
1788
|
+
let content = fs::read_to_string(path)?;
|
|
1789
|
+
let config: Config = serde_json::from_str(&content)?;
|
|
1790
|
+
Ok(config)
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1793
|
+
pub fn get_user(id: &str) -> Result<User, AppError> {
|
|
1794
|
+
let users = load_config("users.json")?;
|
|
1795
|
+
users.find(id).ok_or_else(|| AppError::NotFound(id.to_string()))
|
|
1796
|
+
}`,
|
|
1797
|
+
expectedRuleIds: [],
|
|
1798
|
+
unexpectedRuleIds: ["ERR", "STRUCT", "MAINT"],
|
|
1799
|
+
category: "clean",
|
|
1800
|
+
difficulty: "medium",
|
|
1801
|
+
},
|
|
1802
|
+
{
|
|
1803
|
+
id: "lang-clean-kotlin-coroutines",
|
|
1804
|
+
description: "Kotlin with proper coroutine structure and error handling",
|
|
1805
|
+
language: "kotlin",
|
|
1806
|
+
code: `import kotlinx.coroutines.*
|
|
1807
|
+
|
|
1808
|
+
class OrderService(
|
|
1809
|
+
private val orderRepo: OrderRepository,
|
|
1810
|
+
private val paymentClient: PaymentClient,
|
|
1811
|
+
) {
|
|
1812
|
+
suspend fun processOrder(orderId: String): Result<Order> = coroutineScope {
|
|
1813
|
+
val order = orderRepo.findById(orderId)
|
|
1814
|
+
?: return@coroutineScope Result.failure(OrderNotFoundException(orderId))
|
|
1815
|
+
|
|
1816
|
+
val paymentResult = withTimeout(5000) {
|
|
1817
|
+
paymentClient.charge(order.total, order.paymentMethod)
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
if (paymentResult.isFailure) {
|
|
1821
|
+
return@coroutineScope Result.failure(paymentResult.exceptionOrNull()!!)
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
val updated = orderRepo.updateStatus(orderId, OrderStatus.PAID)
|
|
1825
|
+
Result.success(updated)
|
|
1826
|
+
}
|
|
1827
|
+
}`,
|
|
1828
|
+
expectedRuleIds: [],
|
|
1829
|
+
unexpectedRuleIds: ["CONC", "ERR", "REL"],
|
|
1830
|
+
category: "clean",
|
|
1831
|
+
difficulty: "hard",
|
|
1832
|
+
},
|
|
1833
|
+
{
|
|
1834
|
+
id: "lang-clean-swift-optionals",
|
|
1835
|
+
description: "Swift code with safe optional handling",
|
|
1836
|
+
language: "swift",
|
|
1837
|
+
code: `struct UserProfile {
|
|
1838
|
+
let name: String
|
|
1839
|
+
let email: String
|
|
1840
|
+
let age: Int?
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
func parseProfile(from data: Data) -> Result<UserProfile, ParseError> {
|
|
1844
|
+
guard let json = try? JSONSerialization.jsonObject(with: data) as? [String: Any] else {
|
|
1845
|
+
return .failure(.invalidJSON)
|
|
1846
|
+
}
|
|
1847
|
+
guard let name = json["name"] as? String,
|
|
1848
|
+
let email = json["email"] as? String else {
|
|
1849
|
+
return .failure(.missingRequiredFields)
|
|
1850
|
+
}
|
|
1851
|
+
let age = json["age"] as? Int
|
|
1852
|
+
return .success(UserProfile(name: name, email: email, age: age))
|
|
1853
|
+
}`,
|
|
1854
|
+
expectedRuleIds: [],
|
|
1855
|
+
unexpectedRuleIds: ["ERR", "STRUCT"],
|
|
1856
|
+
category: "clean",
|
|
1857
|
+
difficulty: "medium",
|
|
1858
|
+
},
|
|
1859
|
+
{
|
|
1860
|
+
id: "lang-powershell-hardcoded-creds",
|
|
1861
|
+
description: "PowerShell script with hardcoded credentials",
|
|
1862
|
+
language: "powershell",
|
|
1863
|
+
code: `$username = "admin"
|
|
1864
|
+
$password = "P@ssw0rd123!"
|
|
1865
|
+
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force
|
|
1866
|
+
$credential = New-Object System.Management.Automation.PSCredential($username, $securePassword)
|
|
1867
|
+
|
|
1868
|
+
Invoke-Command -ComputerName "prod-server-01" -Credential $credential -ScriptBlock {
|
|
1869
|
+
Restart-Service "WebApp"
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1872
|
+
$connectionString = "Server=prod-db.example.com;Database=main;User Id=sa;Password=SuperSecret123;"
|
|
1873
|
+
Invoke-Sqlcmd -ConnectionString $connectionString -Query "SELECT * FROM users"`,
|
|
1874
|
+
expectedRuleIds: ["AUTH-001", "CYBER-001"],
|
|
1875
|
+
category: "auth",
|
|
1876
|
+
difficulty: "easy",
|
|
1877
|
+
},
|
|
1878
|
+
{
|
|
1879
|
+
id: "lang-bash-injection-vulnerables",
|
|
1880
|
+
description: "Bash script with command injection vulnerabilities",
|
|
1881
|
+
language: "bash",
|
|
1882
|
+
code: `#!/bin/bash
|
|
1883
|
+
# Process user-provided filename
|
|
1884
|
+
filename=$1
|
|
1885
|
+
cat /data/$filename
|
|
1886
|
+
|
|
1887
|
+
# Execute user-provided command
|
|
1888
|
+
user_cmd=$2
|
|
1889
|
+
eval $user_cmd
|
|
1890
|
+
|
|
1891
|
+
# Cleanup using user input
|
|
1892
|
+
rm -rf /tmp/$3
|
|
1893
|
+
|
|
1894
|
+
# Search with user input
|
|
1895
|
+
grep "$4" /var/log/syslog | mail -s "Results" admin@example.com`,
|
|
1896
|
+
expectedRuleIds: ["CYBER-001"],
|
|
1897
|
+
category: "security",
|
|
1898
|
+
difficulty: "easy",
|
|
1899
|
+
},
|
|
1900
|
+
{
|
|
1901
|
+
id: "lang-csharp-dispose-not-called",
|
|
1902
|
+
description: "C# code not disposing IDisposable resources properly",
|
|
1903
|
+
language: "csharp",
|
|
1904
|
+
code: `public class DataProcessor
|
|
1905
|
+
{
|
|
1906
|
+
public string ReadFile(string path)
|
|
1907
|
+
{
|
|
1908
|
+
var stream = new FileStream(path, FileMode.Open);
|
|
1909
|
+
var reader = new StreamReader(stream);
|
|
1910
|
+
var content = reader.ReadToEnd();
|
|
1911
|
+
return content;
|
|
1912
|
+
// stream and reader never disposed
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
public void ProcessDatabase(string connStr)
|
|
1916
|
+
{
|
|
1917
|
+
var connection = new SqlConnection(connStr);
|
|
1918
|
+
connection.Open();
|
|
1919
|
+
var command = new SqlCommand("SELECT * FROM data", connection);
|
|
1920
|
+
var reader = command.ExecuteReader();
|
|
1921
|
+
while (reader.Read()) { /* process */ }
|
|
1922
|
+
// connection, command, reader never disposed/closed
|
|
1923
|
+
}
|
|
1924
|
+
}`,
|
|
1925
|
+
expectedRuleIds: ["COST-001"],
|
|
1926
|
+
category: "error-handling",
|
|
1927
|
+
difficulty: "medium",
|
|
1928
|
+
},
|
|
1929
|
+
{
|
|
1930
|
+
id: "lang-clean-ruby-service",
|
|
1931
|
+
description: "Clean Ruby service class with proper error handling",
|
|
1932
|
+
language: "ruby",
|
|
1933
|
+
code: `class PaymentService
|
|
1934
|
+
class PaymentError < StandardError; end
|
|
1935
|
+
class InsufficientFundsError < PaymentError; end
|
|
1936
|
+
class InvalidCardError < PaymentError; end
|
|
1937
|
+
|
|
1938
|
+
def initialize(gateway:, logger:)
|
|
1939
|
+
@gateway = gateway
|
|
1940
|
+
@logger = logger
|
|
1941
|
+
end
|
|
1942
|
+
|
|
1943
|
+
def charge(amount:, card_token:)
|
|
1944
|
+
raise ArgumentError, "amount must be positive" unless amount.positive?
|
|
1945
|
+
raise ArgumentError, "card_token is required" if card_token.blank?
|
|
1946
|
+
|
|
1947
|
+
result = @gateway.charge(amount: amount, token: card_token)
|
|
1948
|
+
@logger.info("Payment charged", amount: amount, transaction_id: result.id)
|
|
1949
|
+
result
|
|
1950
|
+
rescue Gateway::CardDeclined => e
|
|
1951
|
+
@logger.warn("Card declined", error: e.message)
|
|
1952
|
+
raise InvalidCardError, e.message
|
|
1953
|
+
rescue Gateway::InsufficientFunds => e
|
|
1954
|
+
@logger.warn("Insufficient funds", error: e.message)
|
|
1955
|
+
raise InsufficientFundsError, e.message
|
|
1956
|
+
end
|
|
1957
|
+
end`,
|
|
1958
|
+
expectedRuleIds: [],
|
|
1959
|
+
unexpectedRuleIds: ["ERR", "STRUCT", "DOC"],
|
|
1960
|
+
category: "clean",
|
|
1961
|
+
difficulty: "medium",
|
|
1962
|
+
},
|
|
1963
|
+
];
|