@hublo/sentinel 1.7.0-alpha.21 → 1.7.0-alpha.22
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 +2 -1
- package/dist/bin/sentinel.js +9 -37
- package/dist/{chunk-UVXXEAHU.js → chunk-F3Q3JQJ6.js} +6 -4
- package/dist/{chunk-XTBHIKFG.js → chunk-JT7ZMH44.js} +5 -5
- package/dist/chunk-JT7ZMH44.js.map +1 -0
- package/dist/{chunk-BBNABWZ6.js → chunk-LX7EG6PJ.js} +2 -2
- package/dist/chunk-LX7EG6PJ.js.map +1 -0
- package/dist/chunk-NGLEGAEN.js +190 -0
- package/dist/chunk-NGLEGAEN.js.map +1 -0
- package/dist/{chunk-J2RMARWP.js → chunk-PMRL4MH6.js} +2 -2
- package/dist/{chunk-RI7R3S3T.js → chunk-VSUHHETH.js} +7701 -6601
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/roles/sql/config.d.ts +68 -0
- package/dist/roles/sql/config.js +8 -0
- package/dist/roles/static-analysis/config.js +1 -1
- package/dist/roles/test/setup/jest-parity.js +2 -2
- package/dist/roles/test/setup/workspace-entry.js +2 -2
- package/dist/{validate-YCTNTNFT.js → validate-IES226NX.js} +2 -2
- package/docs/sql-adoption.md +573 -0
- package/docs/static-analysis-study.md +10 -49
- package/docs/typescript-traces.md +142 -140
- package/docs/using-sentinel.md +2 -1
- package/package.json +5 -4
- package/dist/chunk-BBNABWZ6.js.map +0 -1
- package/dist/chunk-XTBHIKFG.js.map +0 -1
- package/dist/chunk-XYOIXC6A.js +0 -126
- package/dist/chunk-XYOIXC6A.js.map +0 -1
- package/dist/roles/code-churn/config.d.ts +0 -92
- package/dist/roles/code-churn/config.js +0 -10
- package/docs/code-churn-adoption.md +0 -237
- /package/dist/{chunk-J2RMARWP.js.map → chunk-PMRL4MH6.js.map} +0 -0
- /package/dist/roles/{code-churn → sql}/config.js.map +0 -0
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
# Code churn adoption cheat sheet
|
|
2
|
-
|
|
3
|
-
A quick reference for adopting the sentinel `code-churn` role on a module, for reading its figure,
|
|
4
|
-
and for moving a setting in `code-churn.config.mjs` (HUB-46818, issue #98).
|
|
5
|
-
|
|
6
|
-
**What it measures.** Of the lines a module **added** in a period, the share **rewritten or
|
|
7
|
-
deleted within 21 days** of being written: code churn as
|
|
8
|
-
[Sourcegraph](https://sourcegraph.com/blog/code-churn) and
|
|
9
|
-
[DevStats](https://www.devstats.com/glossary/code-churn) define it. A line rewritten days after it
|
|
10
|
-
landed is work done twice.
|
|
11
|
-
|
|
12
|
-
```
|
|
13
|
-
code churn % = lines added in the period and removed within 21 days / lines added in the period
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
**It reads the git history and nothing else**: no build, no test run, no network. The static
|
|
17
|
-
analysis role answers what the code is today; this one answers how it got there.
|
|
18
|
-
|
|
19
|
-
**It reports and never fails a run.** No threshold, no gate: a churn figure is a trend.
|
|
20
|
-
|
|
21
|
-
## Adopt a module in two steps
|
|
22
|
-
|
|
23
|
-
Run from the **module's own directory**. You do not need to install sentinel first.
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
# 1. write the module's config + the pinned devDependency
|
|
27
|
-
cd apps/.../<module>
|
|
28
|
-
npx --yes @hublo/sentinel@<version> --init --code-churn
|
|
29
|
-
|
|
30
|
-
# 2. fetch what step 1 declared
|
|
31
|
-
pnpm install
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
`--init` writes `code-churn.config.mjs`, adds the three scripts below and the `code-churn` nx
|
|
35
|
-
target to the module's `package.json`, and pins `@hublo/sentinel` into its `devDependencies`. A
|
|
36
|
-
module with no file the role measures is skipped by name. An existing `code-churn.config.mjs` is
|
|
37
|
-
the team's and is never rewritten by a re-init.
|
|
38
|
-
|
|
39
|
-
**Adopt first, then the history is read.** On a module that has not adopted, `--run` counts the
|
|
40
|
-
files it would measure and says how to adopt, without reading the history. A bare `sentinel --run`
|
|
41
|
-
sweeps every role over every module, 441 on the monorepo: a `git log` for each of them, nobody
|
|
42
|
-
having asked, is what this avoids.
|
|
43
|
-
|
|
44
|
-
## Everyday use
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
pnpm run code-churn # the figure and the five most rewritten files, in your terminal
|
|
48
|
-
pnpm run code-churn:json # code-churn-report/code-churn.json, for a machine
|
|
49
|
-
pnpm run code-churn:html # code-churn-report/code-churn.html, every file, for a reader
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
Or without the scripts:
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
sentinel --run --code-churn # same as the first script
|
|
56
|
-
sentinel --run --code-churn --output markdown # code-churn-report/code-churn.md, the pull-request recap
|
|
57
|
-
sentinel --inspect --code-churn --json # every setting, without reading the history
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
The console, on `apps/nest/microservices/planning-parameter` (hublo/monorepo `main` f12da701121):
|
|
61
|
-
|
|
62
|
-
```
|
|
63
|
-
code churn 4.2%: 405 of the 9750 line(s) added from 2026-07-28 to 2026-10-26 were rewritten or deleted within 21 days (123 commit(s) of origin/main up to f12da701121, 1 of them skipped as touching more than 100 files of the module).
|
|
64
|
-
100% 78/78 src/team-sequence-parameter/business-logic/use-cases/cut-slots-at-half-day-hour.ts (deleted)
|
|
65
|
-
16.9% 48/284 src/team-sequence-assignment/business-logic/use-cases/update-team-sequence-assignment-period.use-case.ts
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## What it reads
|
|
69
|
-
|
|
70
|
-
| Point | How |
|
|
71
|
-
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
72
|
-
| Which history | **main's**, `--first-parent`, up to the merge base of `HEAD` and `NX_BASE` (CI) or `origin/main` (elsewhere). The same commit locally and in CI, so a figure seen in CI is the one you get on your machine. Your branch's own commits are not main's yet and are not read |
|
|
73
|
-
| A merge | read as everything it brought (`--diff-merges=first-parent`). What a pull request rewrote before merging is not seen: what is measured is what main received |
|
|
74
|
-
| Which period | the lines written in the 90 days that end 21 days before the newest commit read, so every counted line has had its full window |
|
|
75
|
-
| Which files | `src` when the module has one, the module otherwise (the static analysis perimeter), then the role's `include`; tests, declarations and generated files left out |
|
|
76
|
-
| A rename | the file's lines are carried to its new name (`-M`) |
|
|
77
|
-
| A sweep | a commit touching more than 100 files **of the module** is not counted: neither its lines as added, nor what it removes as rework |
|
|
78
|
-
|
|
79
|
-
When git cannot answer, the run **fails and says why**, never an empty figure: a shallow clone
|
|
80
|
-
(`fetch-depth: 0` in CI, `git fetch --unshallow` locally), no `origin/main` (`git fetch origin
|
|
81
|
-
main`), a module outside git.
|
|
82
|
-
|
|
83
|
-
## How to read the figure
|
|
84
|
-
|
|
85
|
-
Every report places the figure in a **band**, calibrated on the monorepo's own modules, and says
|
|
86
|
-
what the band means. A band places the figure; it never says whether the code is good. A module
|
|
87
|
-
compares best with itself over time, measured with the same settings.
|
|
88
|
-
|
|
89
|
-
| When | Band | What the reports say |
|
|
90
|
-
| ----------------------------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
91
|
-
| under 500 lines added in the period | little activity | the counts, no percentage: a figure over a few lines is noise. The files table still shows what changed, how often and why |
|
|
92
|
-
| under 3% | low | among the lowest quarter of the modules the levels were calibrated on |
|
|
93
|
-
| 3 to 11% | usual | within the usual range |
|
|
94
|
-
| over 11% | above | above three quarters of the modules; the files that carry it lead the table |
|
|
95
|
-
| over 16% | worth a look | above 90% of the modules; read the kinds of change: mostly `feat`, the specification moves; mostly `fix`, the code is corrected after it landed |
|
|
96
|
-
|
|
97
|
-
The levels are the 25th, 75th and 90th percentiles (3.1, 11.4 and 15.9%, rounded down) of the 36
|
|
98
|
-
sentinel modules of `main` f12da701121 that added at least 500 lines from 2026-07-28 to
|
|
99
|
-
2026-10-26; 77 of the 113 added fewer. Vendor figures (LinearB under 3% "elite" and over 8% "needs
|
|
100
|
-
focus", EM Tools 15 to 25% "healthy", GitClear) count other things under the same name: LinearB
|
|
101
|
-
counts CHANGED lines whose previous version is under 21 days old, over all branches. Applied as
|
|
102
|
-
they are, LinearB's bands would put 18 of those 36 modules in alert, so none is applied.
|
|
103
|
-
|
|
104
|
-
Measured on hublo/monorepo `main` f12da701121, period 2026-07-28 to 2026-10-26:
|
|
105
|
-
|
|
106
|
-
| Module | Churn | Added | Rewritten | Commits read | Skipped as sweeps |
|
|
107
|
-
| -------------------------------------------- | ----: | ------: | --------: | -----------: | ----------------: |
|
|
108
|
-
| `apps/nest/microservices/planning-parameter` | 4.2% | 9 750 | 405 | 123 | 1 |
|
|
109
|
-
| `apps/nest/microservices/recruitment` | 7.7% | 44 798 | 3 429 | 344 | 3 |
|
|
110
|
-
| `apps/front/host-admin` | 12.1% | 185 650 | 22 546 | 1 262 | 14 |
|
|
111
|
-
|
|
112
|
-
The host-admin row leaves out `src/routeTree.gen.ts`, TanStack Router's generated route tree,
|
|
113
|
-
which the `*.gen.*` ignore added on 2026-11-17 (187 639 and 22 615 before it).
|
|
114
|
-
|
|
115
|
-
## What the reports show
|
|
116
|
-
|
|
117
|
-
`code-churn.html` stays on one subject: how the module's code CHANGES. Code churn is a symptom of
|
|
118
|
-
design and of instability, and the page reads it from the history; what the code IS today
|
|
119
|
-
(complexity, duplication, dead code, import coupling) is static analysis's page.
|
|
120
|
-
|
|
121
|
-
It opens on one plain sentence and three cards: the figure and its band; the pull requests of the
|
|
122
|
-
period by kind of change (`feat`, `fix`, `refactor`, other, read from each title); and which kind
|
|
123
|
-
rewrote the lines. Then two tabs, and a **Help** button in the banner.
|
|
124
|
-
|
|
125
|
-
**Code churn.** Every file the period changed, sortable, searchable, filterable by tag and
|
|
126
|
-
paginated by 50, every column with a "?":
|
|
127
|
-
|
|
128
|
-
| Column | What it says |
|
|
129
|
-
| -------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
130
|
-
| Code churn, rewritten / added | how much of the code the file gained was taken back within 21 days |
|
|
131
|
-
| Changes, feat / fix / refactor / other | how many merged pull requests changed it, and of what kind: many `fix`, corrected after it lands; many `feat`, its requirement keeps moving |
|
|
132
|
-
| Hotspot | how often it changes and how complex it is, together, 0 to 1, relative to this module; tagged "hotspot" only with a complexity over 10 too |
|
|
133
|
-
| Changes with | the file it changes with most often in the same pull requests ("13 of 18"), the next nine under "+ N more": the dependency git sees and the import graph does not (Gall et al., 1998; D'Ambros, Lanza and Robbes, 2009) |
|
|
134
|
-
|
|
135
|
-
On `apps/nest/microservices/regulation-storage` (25.8%, worth a look), the 960 rewritten lines
|
|
136
|
-
split into 612 by one `fix` four days after the module was ported, 322 by `feat`: its rework is a
|
|
137
|
-
correction right after delivery, not a moving specification.
|
|
138
|
-
|
|
139
|
-
**Settings.** The settings the run used and the bands.
|
|
140
|
-
|
|
141
|
-
**Help.** What code churn is and why it matters, the band, the kinds of change, each column, how
|
|
142
|
-
to put the page beside static analysis (`pnpm exec sentinel --run --static-analysis --output
|
|
143
|
-
html`), what the figures do not say and the sources. Every part comes with an example taken from
|
|
144
|
-
the module itself.
|
|
145
|
-
|
|
146
|
-
The hotspot score needs a complexity, measured by the run with static analysis's own pass, for
|
|
147
|
-
every file. Nothing runs the module's tests: test coverage was tried and removed, since it needs
|
|
148
|
-
the tests to run (minutes on a large module, a database for nest's integration suites). Import
|
|
149
|
-
coupling, centrality and fix density were tried too, and left to the json: two reviewers read the
|
|
150
|
-
extra tab as "nothing new", and a second subject on the page lost the first.
|
|
151
|
-
|
|
152
|
-
## How others read code churn
|
|
153
|
-
|
|
154
|
-
No large company publishes code churn as a productivity measure. Research supports it as a
|
|
155
|
-
**risk signal on a file or a module**, read over time and beside other figures. So this role
|
|
156
|
-
reports it per module, never per person, and never as a target.
|
|
157
|
-
|
|
158
|
-
| Who | Their reading | What this role takes from it |
|
|
159
|
-
| ----------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
|
|
160
|
-
| Nagappan and Ball, Microsoft Research, ICSE 2005 ([paper](https://www.st.cs.uni-saarland.de/edu/recommendation-systems/papers/ICSE05Churn.pdf)) | On Windows Server 2003, RELATIVE churn (normalised by size and time) predicts defect density; absolute churn does not | A ratio per module, not a count of lines |
|
|
161
|
-
| Shin, Meneely, Williams, Osborne, IEEE TSE 2011 ([paper](https://ieeexplore.ieee.org/document/5560680)) | Complexity, churn and developer activity together find over 80% of the vulnerable files of Firefox and the RHEL kernel | Churn is strongest crossed with another figure, such as static analysis's complexity |
|
|
162
|
-
| Google, _Software Engineering at Google_, ch. 7 ([chapter](https://abseil.io/resources/swe-book/html/ch07.html)) | Lines of code are not a productivity measure; goals first, then signals, then metrics | Never presented as productivity |
|
|
163
|
-
| SPACE, Forsgren, Storey et al., 2021 ([ACM Queue](https://queue.acm.org/detail.cfm?id=3454124)) | An activity metric is never used alone, nor to reward or penalise a developer | Per module and over time, never per person |
|
|
164
|
-
| DORA, 2024 ([history](https://dora.dev/guides/dora-metrics/history/)) | "Deployment rework rate" counts unplanned DEPLOYMENTS after incidents | A different figure under a similar name: this role does not measure it |
|
|
165
|
-
| Meta, Diff Authoring Time, 2025 ([paper](https://arxiv.org/html/2503.10977v2)) | Measures the time spent authoring a change, because simple line metrics are gamed | The figure describes code, not people |
|
|
166
|
-
| GitClear, vendor ([report](https://www.gitclear.com/coding_on_copilot_data_shows_ais_downward_pressure_on_code_quality)) | The same definition over two weeks, rising with AI coding assistants (153 M lines, 2020 to 2023; their 2024 figure is a projection) | A reason to watch the trend now; a vendor's figure, cited as one |
|
|
167
|
-
| CodeScene, Tornhill, vendor ([hotspots](https://docs.enterprise.codescene.io/versions/4.1.4/guides/technical/hotspots.html)) | A hotspot is change frequency multiplied by complexity | The natural next step: churn beside static analysis's complexity |
|
|
168
|
-
| Vendor benchmarks (EM Tools, LinearB) | EM Tools: 15 to 25% "healthy", no source. LinearB 2026: under 3% "elite", over 8% "needs focus", for changed lines whose previous version is under 21 days old, all branches | Other definitions: never applied. Our bands are our own modules' percentiles |
|
|
169
|
-
|
|
170
|
-
## Every hypothesis and compromise, in one place
|
|
171
|
-
|
|
172
|
-
Each choice the figure depends on, why it was made, what it costs, and how a module moves it.
|
|
173
|
-
Measured on hublo/monorepo `main` f12da701121 unless said otherwise.
|
|
174
|
-
|
|
175
|
-
| # | Hypothesis or compromise | Why | What it costs, measured | Moved by |
|
|
176
|
-
| --- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------- |
|
|
177
|
-
| 1 | Churn is Sourcegraph's rework: a line removed within 21 days of being written | A published definition a reader can check, rather than one of ours | The window is a convention: DevStats gives 14 to 21 days | `window.reworkDays` |
|
|
178
|
-
| 2 | The measured lines are those written in the 90 days that end 21 days before the newest commit read | Every counted line has had its full window; a line written yesterday cannot have been rewritten yet | The figure describes work that is three weeks old at least | `window.periodDays` |
|
|
179
|
-
| 3 | Only main's history is read, first-parent, a merge as everything it brought | What a module received is what it carries; the same answer for everyone | Rework inside a branch before it merges is not seen (validation case V4) | not movable |
|
|
180
|
-
| 4 | The read ends at the merge base of `HEAD` and `NX_BASE` / `origin/main` | The same figure in CI and on a developer's machine | A branch's own commits are not in its figure until they merge | not movable |
|
|
181
|
-
| 5 | The history is read only for a module that adopted the role | A bare sweep covers every module; reading history for each one nobody asked about costs a `git log` per module, and a shallow clone would fail them all | A module must adopt before it sees a figure | adopt |
|
|
182
|
-
| 6 | The perimeter is the static analysis one: `src` when it exists, then `include`; tests, declarations and generated files left out | Both roles answer "is my config, are my tests measured" the same way | Code outside `src` in a module that has one is not measured | `include`, `includeTests`, `tests`, `ignore` |
|
|
183
|
-
| 7 | A commit touching more than 100 files OF THE MODULE is a sweep: its lines are replayed, never counted | A formatter run or a mass rename is not work done twice | No count separates a sweep from a large feature. On host-admin the cap skips 14 commits, real features among them: 12.1% with the cap against 12.5% without on `main` f12da701121 (14 of 1 262 commits), 12.1% against 12.6% at 7112443cc41 (14 of 1 271, validation case V5). Across planning-parameter, recruitment and host-admin, the cap moves the figure by at most 0.6 point. Counted in the repository instead, it skipped 40 of 123 commits on planning-parameter (2.5% for 4.2%), which is why it is not | `maxFilesPerCommit` |
|
|
184
|
-
| 8 | The history is read for this module only (`--relative -- .`) | One module's history, not the repository's, at a cost of seconds | A line moved in from another module reads as written at the move | not movable |
|
|
185
|
-
| 9 | A rename is followed when git detects it, at 50% similarity, inside the module | git's own detection, the one every git tool uses | A file renamed AND mostly rewritten in one commit reads as one file deleted and one added: its young lines count as rework | not movable |
|
|
186
|
-
| 10 | Diffs are read with no context (`--unified=0`), with git's default `myers` algorithm, indent heuristic and rename limit pinned on the command line | Every removed and written line is in a hunk header; nothing else is read; a developer's own `diff.algorithm` cannot move the figure | Two blank lines can align differently from a diff with three lines of context: 1 file of 1 492 differs by two lines on each side against PyDriller. `git blame` also reads with no context | not movable |
|
|
187
|
-
| 11 | A line is dated by its commit's committer date, which on main is when it landed | The date main received the line | A commit rebased later carries the date it was rebased | not movable |
|
|
188
|
-
| 12 | A whitespace-only change is a change | It is what git records, and a reformat of the whole module is caught by the sweep cap | Reindenting young lines in a small commit counts as rework | not movable |
|
|
189
|
-
| 13 | Binary files are skipped | They have no lines | none on the modules measured | not movable |
|
|
190
|
-
| 14 | No gate; a band places the figure among the modules the levels were calibrated on | No published level transfers to another definition or codebase; ours are the monorepo's own percentiles | A band reads as a grade if the sentence is skipped; it says where, never how good. Recalibrated by a sweep at each stable release | `levels` |
|
|
191
|
-
| 15 | A shallow clone, no `origin/main`, a module outside git: the run fails | A cut history makes every line look new; an empty figure would be read as no churn | CI needs `fetch-depth: 0`, which the recap workflow sets | not movable |
|
|
192
|
-
| 16 | The nx target is not cached | The figure depends on the history, which nx does not hash | Each run reads the history again: 0.5 s on planning-parameter, 6 s on host-admin | not movable |
|
|
193
|
-
| 17 | The kind of a change is read from the commit subject: a Conventional Commit title, or the branch of a merge commit | Deterministic and readable; commitlint enforces it; 96% of main's 3 175 commits of the period carry one | It is what the author declared, not a proof: a `fix` may correct a behaviour the product asked to change | not movable |
|
|
194
|
-
| 18 | Change coupling counts commits of main, each a merged pull request | A pull request is the unit a team reviews and ships | A large pull request couples everything it touches once; read the count beside the partner. Sweeps are left out | `maxFilesPerCommit` |
|
|
195
|
-
| 19 | Complexity is the McCabe number of a file's most complex function, measured by static analysis's own pass | The measure static analysis and the linters use, now for every file | A file of many simple functions reads as simple | not movable |
|
|
196
|
-
| 20 | Under 500 added lines, no percentage | 77 of the 113 modules are under it, 26 lines in the median, where one rewrite moves the figure by points | A quiet module never shows a band; its files and kinds still show | `levels.minimumAdded` |
|
|
197
|
-
|
|
198
|
-
## The config file, `code-churn.config.mjs`
|
|
199
|
-
|
|
200
|
-
The shape of `static-analysis.config.mjs`. A setting the module leaves out keeps the role's value;
|
|
201
|
-
a setting it writes **replaces** it, including inside a list, and the reports mark it as
|
|
202
|
-
overridden by this module.
|
|
203
|
-
|
|
204
|
-
| Setting | Default | What it moves |
|
|
205
|
-
| ------------------- | --------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
|
|
206
|
-
| `window.reworkDays` | `21` | how long after a line is written a change to it counts as rework |
|
|
207
|
-
| `window.periodDays` | `90` | how far back the measured lines were written |
|
|
208
|
-
| `maxFilesPerCommit` | `100` | over this many files of the module, a commit is a sweep |
|
|
209
|
-
| `levels` | `{ minimumAdded: 500, low: 3, above: 11, watch: 16 }` | the module's band, and below how many added lines it has none |
|
|
210
|
-
| `include` | `["**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs,svelte,vue}"]` | the files measured, inside `src` |
|
|
211
|
-
| `includeTests` | `false` | measure the tests too |
|
|
212
|
-
| `tests` | the sql role's list, extended to JavaScript | what counts as a test |
|
|
213
|
-
| `ignore` | `node_modules`, `dist`, `build`, `coverage`, declarations, generated (`*.generated.*`, `*.gen.*`, `generated/`) | never measured |
|
|
214
|
-
| `listed` | `10` | how many files the json row lists |
|
|
215
|
-
|
|
216
|
-
## How it was validated
|
|
217
|
-
|
|
218
|
-
The figure was recomputed **independently with `git blame`**: for each commit C of the period, the
|
|
219
|
-
code 21 days after C, and how many of C's lines `git blame --first-parent` still finds there. On
|
|
220
|
-
hublo/monorepo `main` f12da701121, commit by commit:
|
|
221
|
-
|
|
222
|
-
| Module | Commits compared | Added | Rewritten | Difference |
|
|
223
|
-
| -------------------------------------------- | ---------------: | ------: | --------: | ---------: |
|
|
224
|
-
| `apps/nest/microservices/planning-parameter` | 66 | 9 547 | 469 | 0 |
|
|
225
|
-
| `apps/nest/microservices/recruitment` | 205 | 44 477 | 3 429 | 0 |
|
|
226
|
-
| `apps/front/host-admin` | 934 | 222 068 | 27 801 | 0 |
|
|
227
|
-
|
|
228
|
-
Set aside on both sides: the (commit, file) pairs where `git blame` follows a newly added file to
|
|
229
|
-
another file deleted in the same commit, since its rename pairing is per path and `git log`'s is
|
|
230
|
-
global (6 pairs and 201 lines on planning-parameter, 1 and 330 on recruitment, 3 and 62 on
|
|
231
|
-
host-admin). The figures above are without the sweep cap, so every commit is compared.
|
|
232
|
-
|
|
233
|
-
The added and removed lines read from the patch were also compared with
|
|
234
|
-
[PyDriller](https://github.com/ishepard/pydriller) 2.6, file by file on the 92 non-merge commits of
|
|
235
|
-
planning-parameter: 1 491 of 1 492 identical. The one left differs by two lines on each side, a
|
|
236
|
-
diff with no context aligning two blank lines differently from one with three; both are valid, and
|
|
237
|
-
`git blame` reads with no context, as this role does.
|
|
File without changes
|
|
File without changes
|