@hublo/sentinel 1.5.0-alpha.25 → 1.5.0-alpha.26

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.
@@ -15,7 +15,7 @@ import {
15
15
  palette,
16
16
  registerAdapters,
17
17
  resolve
18
- } from "../chunk-I3IEZLBG.js";
18
+ } from "../chunk-WDZRBHMH.js";
19
19
  import {
20
20
  resolveContext
21
21
  } from "../chunk-ZMVI65FF.js";
@@ -5488,8 +5488,8 @@ var metricsHelp = {
5488
5488
  },
5489
5489
  deadLinesPercent: {
5490
5490
  label: "Unreachable lines",
5491
- what: "The share of scanned lines the reachability walk never reached from an entry point.",
5492
- read: "Higher is worse, and only once the entry-point count above says the question was decidable. Read it next to the four counts below rather than alone: one number covering files, exports, symbols and imports hides four different kinds of work.",
5491
+ what: "The share of scanned lines the reachability walk never reached from an entry point, with the share of FILES those lines sit in beside it.",
5492
+ read: "\u26D4 Read the two denominators together or the figure misleads, and that is measured rather than feared. On `apps/nest/microservices/agency` the line share is 60.21%, which reads as a rotten module or a broken tool; neither is true. 490 of its 504 files are reachable, and ONE unreachable file, a seed data table, holds 52 210 lines, 59.3% of the module by itself. A large line share over a small file share means a generated or seed file, not code anyone writes. Higher is worse, and only once the entry-point count above says the question was decidable. Read it next to the four counts below rather than alone: one number covering files, exports, symbols and imports hides four different kinds of work.",
5493
5493
  caveat: "Unreachable here means unreachable WITHIN this module, and that is a measured limitation rather than a theoretical one. A library is consumed from outside the scan, so its files look unreachable: on a sample of 12 files reported dead, 9 of `libs/front/components` and 7 of `libs/nest/auth` are cited elsewhere in the repository, one of them in 356 files. Test, fixture and story files are also outside the reachability graph, verified on a fixture, so a file reached only by a story is reported unreachable; it is true of the product and false of the repository, and `libs/front/components` has one such file of 915 lines.",
5494
5494
  source: "jscpd's dead-code engine, `deadLines` over `totalLines`. The library figures were measured per module with the workspace's own path aliases, and the story case was isolated on a four-file fixture where the only importer was a `.stories.tsx`."
5495
5495
  },
@@ -6017,7 +6017,7 @@ function renderMarkdown(report) {
6017
6017
  const row = report.rows.find((candidate) => candidate.metric === family.headline);
6018
6018
  const marker = row?.status === void 0 ? "" : ` (${row.status})`;
6019
6019
  const shown = row?.unit.split(";")[0] ?? "";
6020
- const unit = shown === "" ? "" : `${shown === "%" ? "" : " "}${shown}`;
6020
+ const unit = shown === "" ? "" : `${shown.startsWith("%") ? "" : " "}${shown}`;
6021
6021
  const value = row === void 0 ? "--" : `${figure(row)}${unit}${marker}`;
6022
6022
  const label = helpFor(family.headline)?.label ?? family.label;
6023
6023
  return `| ${label} | ${value} | ${places.get(family.label) ?? 0} |`;
@@ -7774,7 +7774,25 @@ function assembleReport(ctx, config, product, tests, dead, complexity, graph, co
7774
7774
  value: stats.entryPoints ?? 0,
7775
7775
  unit: `of ${stats.files ?? 0} files`
7776
7776
  },
7777
- { metric: "deadLinesPercent", value: share(stats), unit: "%" },
7777
+ /**
7778
+ * ⛔ The share of LINES, with the share of FILES beside it, because one without the other
7779
+ * misleads and this was measured rather than imagined.
7780
+ *
7781
+ * On `apps/nest/microservices/agency` the line share reads **60.21%**, which in a
7782
+ * pull-request comment says the module is rotten or the tool is broken. Neither is true:
7783
+ * 490 of its 504 files are reachable, and a SINGLE unreachable file,
7784
+ * `app/database/seed/data/legacy-agencies.ts`, holds **52 210 lines**, 59.3% of the module on
7785
+ * its own. Twelve files carry 53 233 of the 53 242 dead lines.
7786
+ *
7787
+ * With both denominators the sentence reads correctly at a glance: 60% of the lines sit in
7788
+ * 2% of the files, so the reader looks for a big generated or seed file instead of concluding
7789
+ * anything about the code they write. Nothing is computed that the pass did not hand over.
7790
+ */
7791
+ {
7792
+ metric: "deadLinesPercent",
7793
+ value: share(stats),
7794
+ unit: `% of lines, in ${(stats.files ?? 0) - (stats.reachableFiles ?? 0)} of ${stats.files ?? 0} files`
7795
+ },
7778
7796
  // ⛔ Minus the files the TOOL itself labels `used-only-by-tests`. They were counted as
7779
7797
  // unreachable while the tool knew better: measured on `libs/nest/auth`, 5 of the 20. A file a
7780
7798
  // spec reaches is not unreachable, and leaving it in the headline count meant the figure
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  registerAdapters,
7
7
  resolve,
8
8
  setDefaultRunner
9
- } from "./chunk-I3IEZLBG.js";
9
+ } from "./chunk-WDZRBHMH.js";
10
10
  import {
11
11
  BaseAdapter
12
12
  } from "./chunk-ZMVI65FF.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hublo/sentinel",
3
- "version": "1.5.0-alpha.25",
3
+ "version": "1.5.0-alpha.26",
4
4
  "description": "One CLI that guards code health across Hublo repos: shared lint/typescript/build/test presets, static & dynamic analysis, and architecture checks.",
5
5
  "type": "module",
6
6
  "license": "MIT",