@reidbuilds/slop 0.2.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.
Files changed (62) hide show
  1. package/.claude/settings.local.json +11 -0
  2. package/.firebaserc +5 -0
  3. package/README.md +73 -0
  4. package/cli/analyzer.js +150 -0
  5. package/cli/index.js +182 -0
  6. package/cli/learner.js +156 -0
  7. package/cli/reporter.js +126 -0
  8. package/cli/scanner.js +45 -0
  9. package/ff-slop.md +27 -0
  10. package/firebase.json +16 -0
  11. package/functions/index.js +30 -0
  12. package/functions/package-lock.json +2755 -0
  13. package/functions/package.json +12 -0
  14. package/hardcoresyn-slop.md +1887 -0
  15. package/package.json +17 -0
  16. package/slop-index/catches.jsonl +590 -0
  17. package/slop-index/patterns/001-hallucinated-imports.md +39 -0
  18. package/slop-index/patterns/002-comment-restatement.md +53 -0
  19. package/slop-index/patterns/003-unnecessary-abstraction.md +56 -0
  20. package/slop-index/patterns/004-unused-imports.md +41 -0
  21. package/slop-index/patterns/005-hardcoded-config.md +49 -0
  22. package/slop-index/patterns/006-deprecated-api-confidence.md +52 -0
  23. package/slop-index/patterns/007-try-catch-everything.md +63 -0
  24. package/slop-index/patterns/008-generic-variable-names.md +49 -0
  25. package/slop-index/patterns/009-stub-with-shell.md +61 -0
  26. package/slop-index/patterns/010-async-misuse.md +64 -0
  27. package/slop-index/patterns/011-console-log-left-in.md +53 -0
  28. package/slop-index/patterns/012-over-engineered-simple.md +64 -0
  29. package/slop-index/patterns/013-emoji-debugging.md +44 -0
  30. package/slop-index/patterns/014-fake-async-simulation.md +71 -0
  31. package/slop-index/patterns/015-credential-fallbacks.md +51 -0
  32. package/slop-index/patterns/016-mock-data-pollution.md +75 -0
  33. package/slop-index/proposed/.gitkeep +0 -0
  34. package/slop-index/proposed/017-emoji-progress-logging.md +44 -0
  35. package/slop-index/proposed/018-test-credentials-in-fallbacks.md +54 -0
  36. package/slop-index/proposed/019-fake-loading-simulation.md +75 -0
  37. package/slop-index/proposed/020-configuration-debugging-left-in.md +53 -0
  38. package/slop-index/proposed/021-emoji-production-logging.md +42 -0
  39. package/slop-index/proposed/022-fake-delay-simulation.md +70 -0
  40. package/slop-index/proposed/023-credential-hardcoding-with-fallbacks.md +57 -0
  41. package/slop-index/proposed/024-repetitive-error-pattern.md +76 -0
  42. package/slop-index/proposed/025-environment-specific-fallbacks.md +55 -0
  43. package/slop-index/proposed/026-emoji-production-logs.md +46 -0
  44. package/slop-index/proposed/027-credentials-in-debug-logs.md +48 -0
  45. package/slop-index/proposed/028-repetitive-service-wrappers.md +59 -0
  46. package/slop-index/proposed/029-forced-non-null-assertions.md +59 -0
  47. package/slop-index/proposed/030-production-credential-fallbacks.md +51 -0
  48. package/slop-index/proposed/031-fake-version-confidence.md +50 -0
  49. package/slop-index/proposed/032-forced-non-null-assertions.md +53 -0
  50. package/slop-index/proposed/033-emoji-production-logs.md +44 -0
  51. package/slop-index/proposed/034-realistic-mock-data-leakage.md +62 -0
  52. package/slop-index/proposed/035-production-credential-exposure.md +43 -0
  53. package/slop-index/proposed/036-identical-wrapper-proliferation.md +53 -0
  54. package/slop-index/proposed/037-forced-null-assertions.md +50 -0
  55. package/slop-index/proposed/038-emoji-production-logging.md +42 -0
  56. package/slop-index/proposed/039-fake-delay-operations.md +52 -0
  57. package/slop-index/proposed/040-forced-null-assertion-chains.md +45 -0
  58. package/slop-index/proposed/041-production-debug-configuration.md +45 -0
  59. package/slop-index/proposed/042-repetitive-firebase-wrappers.md +51 -0
  60. package/slop-index/proposed/043-hardcoded-process-timeouts.md +48 -0
  61. package/slop-index/proposed/044-fictional-package-versions.md +37 -0
  62. package/test-sample.js +89 -0
package/cli/scanner.js ADDED
@@ -0,0 +1,45 @@
1
+ import { readFileSync, statSync } from 'fs'
2
+ import { glob } from 'glob'
3
+ import path from 'path'
4
+
5
+ const SUPPORTED_EXTENSIONS = [
6
+ '.js', '.jsx', '.ts', '.tsx', '.py', '.rb', '.go', '.java', '.cs', '.php'
7
+ ]
8
+
9
+ export async function scanTarget(targetPath, options = {}) {
10
+ const stat = statSync(targetPath)
11
+
12
+ if (stat.isFile()) {
13
+ return [readCodeFile(targetPath)]
14
+ }
15
+
16
+ if (stat.isDirectory()) {
17
+ const pattern = options.recursive !== false
18
+ ? `${targetPath}/**/*{${SUPPORTED_EXTENSIONS.join(',')}}`
19
+ : `${targetPath}/*{${SUPPORTED_EXTENSIONS.join(',')}}`
20
+
21
+ const files = await glob(pattern, {
22
+ ignore: ['**/node_modules/**', '**/.git/**', '**/dist/**', '**/build/**']
23
+ })
24
+
25
+ return files.map(readCodeFile).filter(Boolean)
26
+ }
27
+
28
+ throw new Error(`Target not found: ${targetPath}`)
29
+ }
30
+
31
+ function readCodeFile(filePath) {
32
+ try {
33
+ const content = readFileSync(filePath, 'utf-8')
34
+ if (content.trim().length === 0) return null
35
+ return {
36
+ path: filePath,
37
+ filename: path.basename(filePath),
38
+ extension: path.extname(filePath),
39
+ content,
40
+ lines: content.split('\n').length
41
+ }
42
+ } catch {
43
+ return null
44
+ }
45
+ }
package/ff-slop.md ADDED
@@ -0,0 +1,27 @@
1
+ # Slop Report
2
+
3
+ Generated: 2026-05-20
4
+
5
+ ## main.tsx
6
+
7
+ ✓ Clean
8
+
9
+ ## App.tsx
10
+
11
+ ### [LOW] unused-imports — line 2
12
+
13
+ **Code:** `import reactLogo from './assets/react.svg'
14
+ import viteLogo from '/vite.svg'`
15
+
16
+ **Issue:** Both reactLogo and viteLogo are imported but used in the JSX, so this is not actually an unused import issue
17
+
18
+ **Fix:** No fix needed - imports are actually used
19
+
20
+ ## Summary
21
+
22
+ | Severity | Count |
23
+ |---|---|
24
+ | High | 0 |
25
+ | Medium | 0 |
26
+ | Low | 0 |
27
+ | **Total** | **0** |
package/firebase.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "functions": [
3
+ {
4
+ "source": "functions",
5
+ "codebase": "default",
6
+ "disallowLegacyRuntimeConfig": true,
7
+ "ignore": [
8
+ "node_modules",
9
+ ".git",
10
+ "firebase-debug.log",
11
+ "firebase-debug.*.log",
12
+ "*.local"
13
+ ]
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,30 @@
1
+ const { onRequest } = require('firebase-functions/v2/https')
2
+ const admin = require('firebase-admin')
3
+
4
+ admin.initializeApp()
5
+ const db = admin.firestore()
6
+ db.settings({ databaseId: 'slopbase' })
7
+
8
+ exports.slopSync = onRequest(async (req, res) => {
9
+ if (req.method !== 'POST') {
10
+ return res.status(405).json({ error: 'Method not allowed' })
11
+ }
12
+
13
+ const { pattern_id, severity, language, timestamp } = req.body
14
+ if (!pattern_id || !severity) {
15
+ return res.status(400).json({ error: 'pattern_id and severity are required' })
16
+ }
17
+
18
+ await db.collection('catches').add({ pattern_id, severity, language: language ?? null, timestamp: timestamp ?? new Date().toISOString() })
19
+ return res.json({ ok: true })
20
+ })
21
+
22
+ exports.slopPatterns = onRequest(async (req, res) => {
23
+ if (req.method !== 'GET') {
24
+ return res.status(405).json({ error: 'Method not allowed' })
25
+ }
26
+
27
+ const snap = await db.collection('community_patterns').get()
28
+ const patterns = snap.docs.map(doc => ({ id: doc.id, ...doc.data() }))
29
+ return res.json(patterns)
30
+ })