diff --git a/README.md b/README.md index 027dcb1..f118fc6 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,6 @@ Current checks focus on patterns that often show up in unreviewed generated code - [async wrapper / `return await` noise](src/rules/async-noise/README.md) - [pass-through wrappers](src/rules/pass-through-wrappers/README.md) - [duplicate helper/function signatures across source files](src/rules/duplicate-function-signatures/README.md) -- [directory fan-out hotspots](src/rules/directory-fanout-hotspot/README.md) - [duplicated test mock/setup patterns](src/rules/duplicate-mock-setup/README.md) `scan` reports raw + normalized scores, hotspot tables, and grouped findings. Use `--json` when you want the full evidence payload. @@ -240,7 +239,6 @@ The analyzer reads `slop-scan.config.ts`, `slop-scan.config.js`, `slop-scan.conf { "files": ["src/rules/**"], "rules": { - "structure.directory-fanout-hotspot": { "enabled": false }, "structure.over-fragmentation": { "enabled": false } } } diff --git a/src/default-registry.ts b/src/default-registry.ts index d3e6586..b7b2fa4 100644 --- a/src/default-registry.ts +++ b/src/default-registry.ts @@ -20,7 +20,6 @@ import { promiseDefaultFallbacksRule } from "./rules/promise-default-fallbacks"; import { genericStatusEnvelopesRule } from "./rules/generic-status-envelopes"; import { genericRecordCastsRule } from "./rules/generic-record-casts"; import { stringifiedUnknownErrorsRule } from "./rules/stringified-unknown-errors"; -import { directoryFanoutHotspotRule } from "./rules/directory-fanout-hotspot"; import { duplicateFunctionSignaturesRule } from "./rules/duplicate-function-signatures"; import { passThroughWrappersRule } from "./rules/pass-through-wrappers"; import { duplicateMockSetupRule } from "./rules/duplicate-mock-setup"; @@ -49,7 +48,6 @@ export function createDefaultRegistry(): Registry { registry.registerRule(stringifiedUnknownErrorsRule); registry.registerRule(passThroughWrappersRule); registry.registerRule(duplicateFunctionSignaturesRule); - registry.registerRule(directoryFanoutHotspotRule); registry.registerRule(duplicateMockSetupRule); registry.registerReporter(textReporter); diff --git a/tests/benchmark-history.test.ts b/tests/benchmark-history.test.ts index 135a159..87eef47 100644 --- a/tests/benchmark-history.test.ts +++ b/tests/benchmark-history.test.ts @@ -208,10 +208,10 @@ describe("benchmark history support", () => { expect(summary.repos.every((repo) => repo.series.length === 2)).toBe(true); expect( summary.repos.find((repo) => repo.id === "slop-heavy")?.deltaFromPrevious?.repoScore, - ).toBe(2); - expect(summary.repos.find((repo) => repo.id === "mixed")?.deltaFromPrevious?.repoScore).toBe( - -1, - ); + ).toBeCloseTo(2, 6); + expect( + summary.repos.find((repo) => repo.id === "mixed")?.deltaFromPrevious?.repoScore, + ).toBeCloseTo(-1, 6); expect( summary.repos.find((repo) => repo.id === "slop-heavy")?.highest?.blendedVsPinnedBaseline, ).toBe(adjustedSlopHeavyWeekTwo.blended.vsPinnedBaseline); diff --git a/tests/fixtures-regression.test.ts b/tests/fixtures-regression.test.ts index 25e170c..93af6d5 100644 --- a/tests/fixtures-regression.test.ts +++ b/tests/fixtures-regression.test.ts @@ -28,19 +28,18 @@ describe("fixture regression suite", () => { createDefaultRegistry(), ); - expect(result.repoScore).toBeCloseTo(10.8666666667, 6); - expect(result.findings).toHaveLength(4); + expect(result.repoScore).toBeCloseTo(7.7, 6); + expect(result.findings).toHaveLength(3); expect([...new Set(result.findings.map((finding) => finding.ruleId))].sort()).toEqual([ "defensive.async-noise", "defensive.error-obscuring", - "structure.directory-fanout-hotspot", "structure.pass-through-wrappers", ]); expect(result.fileScores.map((score) => score.path)).toEqual([ "src/service.ts", "src/error.ts", ]); - expect(result.directoryScores.map((score) => score.path)).toEqual(["src/fragments"]); + expect(result.directoryScores).toHaveLength(0); }); test("mixed fixture localizes hotspots to the slop subtree", async () => { @@ -50,9 +49,9 @@ describe("fixture regression suite", () => { createDefaultRegistry(), ); - expect(result.repoScore).toBeCloseTo(9.7, 6); + expect(result.repoScore).toBeCloseTo(6.7, 6); expect(result.fileScores[0]?.path).toBe("src/slop/service.ts"); - expect(result.directoryScores[0]?.path).toBe("src/slop"); + expect(result.directoryScores).toHaveLength(0); expect(result.fileScores.every((score) => score.path.startsWith("src/slop/"))).toBe(true); }); @@ -68,9 +67,9 @@ describe("fixture regression suite", () => { expect(output.status).toBe(0); const report = JSON.parse(output.stdout); - expect(report.summary.repoScore).toBeCloseTo(10.8666666667, 6); - expect(report.summary.findingCount).toBe(4); - expect(report.directoryScores[0].path).toBe("src/fragments"); + expect(report.summary.repoScore).toBeCloseTo(7.7, 6); + expect(report.summary.findingCount).toBe(3); + expect(report.directoryScores).toHaveLength(0); expect(report.fileScores[0].path).toBe("src/service.ts"); }); @@ -88,11 +87,7 @@ describe("fixture regression suite", () => { "strong Found 1 error-obscuring catch block defensive.error-obscuring", ); expect(output.stdout).toContain(" at src/error.ts:2:1"); - expect(output.stdout).toContain( - "medium Directory fan-out is a repo hotspot (7 files vs baseline 1.0) structure.directory-fanout-hotspot", - ); - expect(output.stdout).toContain(" at src/fragments:1:1"); - expect(output.stdout).toContain("4 findings"); + expect(output.stdout).toContain("3 findings"); expect(output.stdout).not.toContain("slop-scan report"); }); diff --git a/tests/heuristics.test.ts b/tests/heuristics.test.ts index 519905b..12ba066 100644 --- a/tests/heuristics.test.ts +++ b/tests/heuristics.test.ts @@ -98,10 +98,9 @@ describe("heuristic rule pack", () => { expect(ruleIds.has("defensive.stringified-unknown-errors")).toBe(true); expect(ruleIds.has("defensive.async-noise")).toBe(true); expect(ruleIds.has("structure.pass-through-wrappers")).toBe(true); - expect(ruleIds.has("structure.directory-fanout-hotspot")).toBe(true); expect(result.fileScores.some((score) => score.path === "src/service.ts")).toBe(true); - expect(result.directoryScores[0]?.path).toBe("src/fragments"); + expect(result.directoryScores).toHaveLength(0); expect(result.repoScore).toBeGreaterThan(0); });