Skip to content

Known False Positives 1 #2

@CodeDeficient

Description

@CodeDeficient

KarpeSlop False Positives Tracker

This document tracks known false positives in the karpeslop AI slop detector to help improve the tool.

Issue 1: unsafe_double_type_assertion in Comments

Pattern: /as\s+unknown\s+as\s+\w+/g

Problem: Matches natural English phrases in comments like "as soon as React".

Example:

// Hide the instant skeleton as soon as React hydrates  ← FALSE POSITIVE

Affected Files:

  • app/ClientLayoutWrapper.tsx:22

Fix Recommendation: Require preceding ) or identifier, or skip comment lines.


Issue 2: missing_error_handling in JSDoc Examples

Pattern: /(fetch|axios|http)\s*\(/g

Problem: Matches fetch( or refetch() in JSDoc documentation examples.

Examples:

/**
 * @example
 * retry={() => refetch()}  ← FALSE POSITIVE
 * const response = await fetch(`/api/...`);  ← FALSE POSITIVE
 */

Affected Files:

  • hooks/useRadiusFilter.ts:30 (JSDoc example)
  • components/ui/error-states/UnknownErrorFallback.tsx:54
  • components/ui/error-states/NetworkErrorFallback.tsx:40
  • components/ui/error-states/DataMissingFallback.tsx:36

Fix Recommendation: Skip lines starting with * or lines containing @example.


Issue 3: missing_error_handling Not Detecting try/catch

Pattern: /(fetch|axios|http)\s*\(/g

Problem: Detector finds fetch calls but doesn't recognize when they're already wrapped in try/catch blocks.

Examples:

const runCleanup = async () => {
  try {
    const response = await fetch('/api/admin/data-cleanup', {   FALSE POSITIVE
      // ...
    });
  } catch (error) {
    logError('Error:', error);
  }
};

Affected Files:

  • hooks/useDataCleanup.ts:72 (inside try/catch lines 70-100)
  • hooks/useDataCleanup.ts:117 (inside try/catch lines 115-126)
  • hooks/useFoodTruckFinder.ts:60 (inside try/catch lines 48-103)
  • hooks/useAutoClaimCheck.ts:30 (inside try/catch)

Fix Recommendation: Walk up the AST or scan surrounding lines for try { before flagging.


Issue 4: missing_error_handling for Intentional Throws

Pattern: /(fetch|axios|http)\s*\(/g

Problem: Some functions intentionally throw errors for the caller to handle.

Example:

const claimTruck = useCallback(async (truckId: string) => {
  const response = await fetch('/api/auth/auto-claim', {...});   FALSE POSITIVE
  if (!response.ok) {
    throw new Error(data.error ?? 'Failed to claim truck');  // Intentional!
  }
}, []);

Affected Files:

  • hooks/useAutoClaimCheck.ts:65

Fix Recommendation: Detect throw statements in the same function block.


Issue 5: production_console_log with Conditional Guards

Pattern: /console\.(log|warn|error|info|debug|trace)\(/g

Problem: Doesn't recognize when console.log is guarded by a development check.

Example:

if (isDev) console.log('Service Worker registered');   FALSE POSITIVE

Affected Files:

  • app/layout.tsx:152, 157, 164, 176

Fix Recommendation: Skip when preceded by if ( condition on the same line.


Summary

Pattern False Positives Root Cause
unsafe_double_type_assertion 1 Matches English in comments
missing_error_handling 11+ JSDoc, existing try/catch, intentional throws
production_console_log 4 Conditional guards not detected

Total False Positives: ~16

Last updated: January 13, 2026

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions