@wbern/obscene 2.1.0 → 2.1.1
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.
- package/README.md +1 -1
- package/dist/cli.js +6 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -185,7 +185,7 @@ The coupling table annotates entries that need framing:
|
|
|
185
185
|
| Marker | JSON field | Meaning |
|
|
186
186
|
|--------|------------|---------|
|
|
187
187
|
| `†` next to a path | `file1Deleted` / `file2Deleted` | File is no longer present at HEAD (deleted or renamed away). The coupling signal is historical; the pair is not actionable in the current tree. |
|
|
188
|
-
| `⇄` next to the Degree value | `lockstep` |
|
|
188
|
+
| `⇄` next to the Degree value | `lockstep` | Shared commits / max(churn) ≥ 0.9 — both files almost always change together over the window. Typical of generator/mirror pairs (`README.md` ↔ `src/README.md`, `*.pb.go` ↔ `*.proto`). Treat the pair as a single unit from git's perspective. |
|
|
189
189
|
|
|
190
190
|
### Corpus framing
|
|
191
191
|
|
package/dist/cli.js
CHANGED
|
@@ -359,7 +359,8 @@ function computeCoupling(cochanges, churn, complexityMap, minCochanges, trackedF
|
|
|
359
359
|
percentOfTotal: 0,
|
|
360
360
|
tier: "cool"
|
|
361
361
|
};
|
|
362
|
-
|
|
362
|
+
const maxChurn = Math.max(churn1, churn2);
|
|
363
|
+
if (count > 0 && maxChurn > 0 && count / maxChurn >= 0.9) {
|
|
363
364
|
entry.lockstep = true;
|
|
364
365
|
}
|
|
365
366
|
if (trackedFiles) {
|
|
@@ -880,9 +881,10 @@ function formatHotspotsTable(output) {
|
|
|
880
881
|
"Score=metric\xD7churn | Tiers are relative to THIS codebase, not absolute quality grades."
|
|
881
882
|
)
|
|
882
883
|
);
|
|
884
|
+
const zeroComplexityCorpus = corpus !== void 0 && corpus.fileCount > 0 && corpus.totalComplexity === 0;
|
|
883
885
|
lines.push(
|
|
884
886
|
pc2.dim(
|
|
885
|
-
"High scores flag review candidates, not bad code \u2014 stable complex files (parsers, engines) score high naturally."
|
|
887
|
+
zeroComplexityCorpus ? "High scores flag files that change often and are sizable \u2014 neither is bad in itself." : "High scores flag review candidates, not bad code \u2014 stable complex files (parsers, engines) score high naturally."
|
|
886
888
|
)
|
|
887
889
|
);
|
|
888
890
|
lines.push(pc2.dim("Docs: https://github.com/wbern/obscene#metrics"));
|
|
@@ -964,7 +966,7 @@ function formatCompositeTable(output) {
|
|
|
964
966
|
|
|
965
967
|
// src/cli.ts
|
|
966
968
|
var program = new Command();
|
|
967
|
-
program.name("obscene").description("Identify hotspot files \u2014 complex code that changes frequently").version("2.1.
|
|
969
|
+
program.name("obscene").description("Identify hotspot files \u2014 complex code that changes frequently").version("2.1.1");
|
|
968
970
|
var REPORT_GUIDE = {
|
|
969
971
|
complexity: "Cyclomatic complexity (branch/loop count). NOT a quality judgment \u2014 a 500-line parser will naturally score high. Compare density, not raw values.",
|
|
970
972
|
complexityDensity: "Complexity per line of code. Normalizes for file size. >0.25 suggests dense logic worth reviewing; <0.10 is typical for straightforward code.",
|
|
@@ -986,7 +988,7 @@ var COUPLING_GUIDE = {
|
|
|
986
988
|
totalComplexity: "Sum of both files' cyclomatic complexity. Highlights coupled pairs where the involved code is also complex \u2014 hidden dependency + high complexity compounds maintenance risk.",
|
|
987
989
|
tier: "Relative ranking within THIS codebase's coupling pairs (top 50% = hot, next 30% = warm, bottom 20% = cool). NOT an absolute quality grade. 'hot' means this pair co-changes more than most \u2014 it may be intentional and fine.",
|
|
988
990
|
deleted: "file1Deleted / file2Deleted are set when the file is no longer present at HEAD (deleted or renamed away). The coupling signal is historical \u2014 the pair is not actionable in the current tree.",
|
|
989
|
-
lockstep: "Set when
|
|
991
|
+
lockstep: "Set when shared commits / max(churn) \u2265 0.9 \u2014 both files almost always change together over the window. Typical of generator/mirror pairs (README \u2194 src/README, *.pb.go \u2194 *.proto). The coupling signal is real but uninformative; treat the pair as a single unit from git's perspective."
|
|
990
992
|
};
|
|
991
993
|
function addSharedOptions(cmd) {
|
|
992
994
|
return cmd.option("--top <n>", "limit to top N entries (0 = all)", "20").option("--format <type>", "output format: json | table", "json").option(
|