Skip to content

Commit fd9cf4d

Browse files
committed
fix: remove incorrect skip logic for overconfident_comment that was causing false negatives
The skip logic at lines 825-831 was inverted - it was skipping lines that START with // (actual comments with overconfident language) instead of only skipping lines where the pattern appeared in non-comment contexts. This caused the detector to miss true positives like: // This is obviously the right approach // The code clearly handles edge cases missed-true-positives.ts now correctly shows 17 issues (up from 9).
1 parent 55f09ef commit fd9cf4d

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

ai-slop-detector.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -822,13 +822,7 @@ class AISlopDetector {
822822
}
823823
}
824824

825-
// Skip comment-line-only patterns that only make sense in actual code comments
826-
if (pattern.id === 'overconfident_comment') {
827-
const trimmed = line.trim();
828-
if (trimmed.startsWith('//') || trimmed.startsWith('*') || trimmed.startsWith('/*')) {
829-
continue;
830-
}
831-
}
825+
832826

833827
// In quiet mode, skip test and mock files for all patterns except production console logs
834828
if (quiet && pattern.id !== 'production_console_log') {

karpeslop-bin.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -691,14 +691,6 @@ class AISlopDetector {
691691
}
692692
}
693693

694-
// Skip comment-line-only patterns that only make sense in actual code comments
695-
if (pattern.id === 'overconfident_comment') {
696-
const trimmed = line.trim();
697-
if (trimmed.startsWith('//') || trimmed.startsWith('*') || trimmed.startsWith('/*')) {
698-
continue;
699-
}
700-
}
701-
702694
// In quiet mode, skip test and mock files for all patterns except production console logs
703695
if (quiet && pattern.id !== 'production_console_log') {
704696
const isTestFile = filePath.includes('__tests__') || filePath.includes('.test.') || filePath.includes('.spec.') || filePath.includes('__mocks__') || filePath.includes('test-');

0 commit comments

Comments
 (0)