Skip to content

feat(enrichment): leftover console.log / debugger analyzer #2015

Description

@JSONbored

New REES local analyzer that flags debugging leftovers introduced in the diff — debugger; statements and bare console.log/print() calls added to non-test source files. Distinct from the existing secret-log analyzer (which only fires on sensitive-value sinks); this catches plain debug noise regardless of payload. Pure compute, no network.

Deliverables

  • Add DebugLeftoverFinding ({ file, line, kind: 'debugger'|'console'|'print' }) + debugLeftover? key to review-enrichment/src/types.ts BriefFindings
  • Create review-enrichment/src/analyzers/debug-leftover.ts scanning added lines; skip test/spec files and skip lines the secret-log analyzer already owns is not required (findings are independent); cap with maxFindings
  • Register a local descriptor in review-enrichment/src/analyzers/registry.ts (category 'quality', cost 'local', requires ['files']) with inline render()
  • Add review-enrichment/test/debug-leftover.test.ts covering debugger/console/print detection, test-file skip, and the cap

References

  • review-enrichment/src/analyzers/secret-log.ts (sink-detection helper to reuse; this is the non-sensitive counterpart)
  • review-enrichment/src/analyzers/actions-pin.ts (added-line hunk walk)
  • review-enrichment/src/analyzers/registry.ts:221-238 (secretLog descriptor as template)

Part of #1499.


size: XS · gittensor:bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions