@wbern/obscene 1.3.0 → 1.3.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/dist/cli.js +7 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -12,7 +12,11 @@ function readIgnoreFile() {
|
|
|
12
12
|
try {
|
|
13
13
|
const content = readFileSync(name, "utf-8");
|
|
14
14
|
return content.split("\n").map((line) => line.trim()).filter((line) => line !== "" && !line.startsWith("#"));
|
|
15
|
-
} catch {
|
|
15
|
+
} catch (err) {
|
|
16
|
+
if (err && typeof err === "object" && "code" in err && err.code === "ENOENT") {
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
throw err;
|
|
16
20
|
}
|
|
17
21
|
}
|
|
18
22
|
return [];
|
|
@@ -747,7 +751,7 @@ function formatCompositeTable(output) {
|
|
|
747
751
|
|
|
748
752
|
// src/cli.ts
|
|
749
753
|
var program = new Command();
|
|
750
|
-
program.name("obscene").description("Identify hotspot files \u2014 complex code that changes frequently").version("1.3.
|
|
754
|
+
program.name("obscene").description("Identify hotspot files \u2014 complex code that changes frequently").version("1.3.1");
|
|
751
755
|
var REPORT_GUIDE = {
|
|
752
756
|
complexity: "Cyclomatic complexity (branch/loop count). NOT a quality judgment \u2014 a 500-line parser will naturally score high. Compare density, not raw values.",
|
|
753
757
|
complexityDensity: "Complexity per line of code. Normalizes for file size. >0.25 suggests dense logic worth reviewing; <0.10 is typical for straightforward code.",
|
|
@@ -771,7 +775,7 @@ var COUPLING_GUIDE = {
|
|
|
771
775
|
function addSharedOptions(cmd) {
|
|
772
776
|
return cmd.option("--top <n>", "limit to top N entries (0 = all)", "20").option("--format <type>", "output format: json | table", "json").option(
|
|
773
777
|
"--exclude <patterns...>",
|
|
774
|
-
"additional file patterns to exclude (
|
|
778
|
+
"additional file patterns to exclude (also reads .obsignore / .obsceneignore)"
|
|
775
779
|
);
|
|
776
780
|
}
|
|
777
781
|
addSharedOptions(
|