@filipebraida/adonis-function-points 0.7.0 → 0.8.0

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/CHANGELOG.md CHANGED
@@ -6,6 +6,76 @@ release moves the number for unchanged code, the rule set version moves with it
6
6
  otherwise the difference would measure the tool's change rather than the work, and
7
7
  that difference becomes an invoice.
8
8
 
9
+ ## 0.8.0
10
+
11
+ **Rule set `afp@1.7.0`.** One rule, wide, found by a team reviewing a 0.6.0 count of
12
+ their own application: six transactions that write were counted as EOs, with the
13
+ coverage at 99.5% and three unresolved calls. The number was close and the count was
14
+ wrong in nine places, and only the coverage line could have said so — it said 100%.
15
+ Frozen in a fixture with a hand-written reference before the code, recounted on the
16
+ three validated applications. A 0.7.0 baseline has to be recounted: the totals move −1,
17
+ −8 and +2 FP; what moves is EO → EI (3 / 11 / 2 transactions), FTRs gained, and a
18
+ coverage that now falls where the analysis does not know.
19
+
20
+ ### Fixed
21
+
22
+ - **A write binds to what the variable IS, not to where it was born.** `document.save()`
23
+ was a write on `Document` only when the instance was born in the same body or arrived
24
+ as a parameter typed inline. The reviewed application's dominant shape — the
25
+ controller loads, the action alters — arrives it destructured from a **named**
26
+ interface (`handle({ document, name }: RenameDocumentInput)`), by `const { x } =
27
+ input`, as a followed method's **declared return type** (`Promise<Session | null>`;
28
+ unannotated, its `return`s when every one is a store, one level of calls down), as a
29
+ conditional or a default whose branches are the same store (`id ? await X.find(id) :
30
+ new X()`, `(await q.first()) ?? new X()`), as `auth.user` / `auth.getUserOrFail()` —
31
+ the model `config/auth.ts` names in its provider, read, never assumed — as a
32
+ **relation read off a loaded row** (`const pasta = documento.pasta`, which had been
33
+ billed to `Documento`), as a `for…of` or a callback parameter over rows or a relation,
34
+ as a `let x: Store` assigned later, as `Store[]` or `Store | null` parameters. Every
35
+ one is a reading of what the code declares; no type checker (the project resolves no
36
+ `#alias/…`, so `getType()` is `any`), and no guess. Counting-decisions §3.
37
+ - **A write on a receiver nobody can type is an UNRESOLVED call**, reason "write on a
38
+ receiver whose type the analysis cannot read": `x.save()` / `x.delete()` with no
39
+ arguments, `x.merge(…).save()`, `x.related('…').create|sync|attach(…)`. It lowers
40
+ coverage and is listed by `fp:inventory`; the transaction stays what the readable
41
+ code says. A local a package built (`await PDFDocument.create()`, then `pdf.save()`)
42
+ is not a store and is not reported. This is the line between a count that errs and a
43
+ count that lies, and it did not exist.
44
+ - **A service is what the container returns.** `const svc = await
45
+ app.container.make(X)` binds `svc` to X as `new X()` already did, so `svc.method()` is
46
+ followed. On the reviewed application this shape carried the write of
47
+ `POST /gestao/atribuicao` and 31 more sites.
48
+ - A method chain on store rows handed to a delivery (`rows.map(f).join('\n')`) delivers
49
+ the rows, not one field.
50
+
51
+ ### New
52
+
53
+ - **What the page shows is what leaves**, for a store handed to the page raw — no
54
+ transformer, no `.select()`. `inertia.render('livros/index', …)` opens
55
+ `inertia/pages/livros/index.tsx` (or `app/<module>/ui/pages/…`, or any `pages/` directory
56
+ — exactly one match, or nothing is read) and `view.render('catalogo')` opens
57
+ `resources/views/catalogo.edge`; the columns the page reads off the rows are the DETs
58
+ (`page:Livro.titulo`), one child component deep, through tsconfig `paths`, subpath
59
+ imports and relative paths. Where it cannot read — a second level of components, a
60
+ spread, a function receiving the rows, a package's `<DataTable data={…} />`, two files
61
+ answering to one name, one prop carrying several stores, members that are not columns
62
+ — the store leaves whole and the count says why, by transaction. Measured on the three
63
+ applications: **0 FP moved** (sae: three pages read, 22 stores reported; the other two
64
+ hand every raw store through a transformer). Fixture `inertia_pages` (25 FP): the DETs
65
+ change, the points do not.
66
+
67
+ ### Documented
68
+
69
+ - counting-decisions §3 gains "A write is attributed to what the variable IS", with the
70
+ eleven bindings as a table; the fixture `escritas_indiretas` (87 FP; `afp@1.6.0` said
71
+ 57 with full coverage — five EIs sold as EOs, two ILFs mistaken for EIFs, one ILF lost)
72
+ carries one transaction per shape, plus the unreadable receiver and the package object.
73
+ - counting-decisions §6 gains "What the page shows" — the reader, its reach, and the
74
+ measured zero.
75
+ - The three boundary questions the review left open — technical logs, a mirror of another
76
+ system's table, a requirement's data — are declarations (`boundary.infrastructure`,
77
+ `boundary.externallyMaintained`), not rules; plan 0.8 §C records them.
78
+
9
79
  ## 0.7.0
10
80
 
11
81
  **Rule set `afp@1.6.0`.** Three rules move the number for unchanged code, every one
package/README.md CHANGED
@@ -13,7 +13,7 @@ node ace fp:count
13
13
 
14
14
  ```
15
15
  Unadjusted count: 46 FP
16
- Ruleset: afp@1.6.0
16
+ Ruleset: afp@1.7.0
17
17
 
18
18
  type n FP
19
19
  ILF 2 14
@@ -14,27 +14,27 @@
14
14
  const commands = [
15
15
  {
16
16
  commandName: "fp:inventory",
17
- importer: () => import("../fp_inventory-DIjKIC9t.js")
17
+ importer: () => import("../fp_inventory-B322MvZT.js")
18
18
  },
19
19
  {
20
20
  commandName: "fp:metrics",
21
- importer: () => import("../fp_metrics-BpU61waG.js")
21
+ importer: () => import("../fp_metrics-DjADb7F6.js")
22
22
  },
23
23
  {
24
24
  commandName: "fp:count",
25
- importer: () => import("../fp_count-arGLnVlY.js")
25
+ importer: () => import("../fp_count-B_KPNKMO.js")
26
26
  },
27
27
  {
28
28
  commandName: "fp:explain",
29
- importer: () => import("../fp_explain-aNFApwiT.js")
29
+ importer: () => import("../fp_explain-C2s6Kpaj.js")
30
30
  },
31
31
  {
32
32
  commandName: "fp:diff",
33
- importer: () => import("../fp_diff-DBBvzq5x.js")
33
+ importer: () => import("../fp_diff-B3NhXzrb.js")
34
34
  },
35
35
  {
36
36
  commandName: "fp:calibrate",
37
- importer: () => import("../fp_calibrate-3TxGdS1b.js")
37
+ importer: () => import("../fp_calibrate-B_oD9b02.js")
38
38
  }
39
39
  ];
40
40
  let cache = null;
@@ -1,4 +1,4 @@
1
- import { s as printResult, t as runCalibrate } from "./runners-Dm7cWGa-.js";
1
+ import { s as printResult, t as runCalibrate } from "./runners-BpBJsGMj.js";
2
2
  import { n as printerFor, t as __decorate } from "./decorate-D6enDn9D.js";
3
3
  import { BaseCommand, args } from "@adonisjs/core/ace";
4
4
  //#region commands/fp_calibrate.ts
@@ -1,4 +1,4 @@
1
- import { n as runCount, s as printResult } from "./runners-Dm7cWGa-.js";
1
+ import { n as runCount, s as printResult } from "./runners-BpBJsGMj.js";
2
2
  import { n as printerFor, t as __decorate } from "./decorate-D6enDn9D.js";
3
3
  import { BaseCommand, flags } from "@adonisjs/core/ace";
4
4
  //#region commands/fp_count.ts
@@ -1,4 +1,4 @@
1
- import { r as runDiff, s as printResult } from "./runners-Dm7cWGa-.js";
1
+ import { r as runDiff, s as printResult } from "./runners-BpBJsGMj.js";
2
2
  import { n as printerFor, t as __decorate } from "./decorate-D6enDn9D.js";
3
3
  import { BaseCommand, args } from "@adonisjs/core/ace";
4
4
  //#region commands/fp_diff.ts
@@ -1,4 +1,4 @@
1
- import { i as runExplain, s as printResult } from "./runners-Dm7cWGa-.js";
1
+ import { i as runExplain, s as printResult } from "./runners-BpBJsGMj.js";
2
2
  import { n as printerFor, t as __decorate } from "./decorate-D6enDn9D.js";
3
3
  import { BaseCommand, args } from "@adonisjs/core/ace";
4
4
  //#region commands/fp_explain.ts
@@ -1,4 +1,4 @@
1
- import { a as runInventory, s as printResult } from "./runners-Dm7cWGa-.js";
1
+ import { a as runInventory, s as printResult } from "./runners-BpBJsGMj.js";
2
2
  import { n as printerFor, t as __decorate } from "./decorate-D6enDn9D.js";
3
3
  import { BaseCommand, flags } from "@adonisjs/core/ace";
4
4
  //#region commands/fp_inventory.ts
@@ -1,4 +1,4 @@
1
- import { o as runMetrics, s as printResult } from "./runners-Dm7cWGa-.js";
1
+ import { o as runMetrics, s as printResult } from "./runners-BpBJsGMj.js";
2
2
  import { n as printerFor, t as __decorate } from "./decorate-D6enDn9D.js";
3
3
  import { BaseCommand, flags } from "@adonisjs/core/ace";
4
4
  //#region commands/fp_metrics.ts
package/build/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { configure } from "./configure.js";
2
2
  import { a as AEP_FACTORS, c as IncomparableSourcesError, f as defineConfig, i as measureStructure, l as SISP_FACTORS, n as parseSamples, o as FACTOR_PRESETS, r as measureConformance, s as IncomparableRulesetsError, t as calibrate, u as diffCounts } from "./calibration-DVIf8hcE.js";
3
3
  import "./src/types.js";
4
- import { n as ignoreCalls, t as BUILTIN_CALL_RESOLVERS } from "./resolvers-DaU4uAqT.js";
5
- import { a as DEFAULT_TECHNICAL_PATTERNS, i as RULESET_VERSION, n as analyze, r as RULESET, t as CoverageTooLowError } from "./pipeline-DO2301fV.js";
4
+ import { n as ignoreCalls, t as BUILTIN_CALL_RESOLVERS } from "./resolvers-DhJO-qvQ.js";
5
+ import { a as DEFAULT_TECHNICAL_PATTERNS, i as RULESET_VERSION, n as analyze, r as RULESET, t as CoverageTooLowError } from "./pipeline-C6kHKB9-.js";
6
6
  export { AEP_FACTORS, BUILTIN_CALL_RESOLVERS, CoverageTooLowError, DEFAULT_TECHNICAL_PATTERNS, FACTOR_PRESETS, IncomparableRulesetsError, IncomparableSourcesError, RULESET, RULESET_VERSION, SISP_FACTORS, analyze, calibrate, configure, defineConfig, diffCounts, ignoreCalls, measureConformance, measureStructure, parseSamples };