@filipebraida/adonis-function-points 0.5.0 → 0.6.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.
Files changed (33) hide show
  1. package/CHANGELOG.md +102 -0
  2. package/README.md +101 -292
  3. package/build/{calibration-8eV8CEix.js → calibration-DVIf8hcE.js} +42 -3
  4. package/build/commands/main.js +6 -6
  5. package/build/{fp_calibrate-DUbHiifm.js → fp_calibrate-EAuAtdbq.js} +1 -1
  6. package/build/{fp_count-ChtblhZV.js → fp_count-CZ0cUUBQ.js} +1 -1
  7. package/build/{fp_diff-Dt7J4IWu.js → fp_diff-BTg_LX0r.js} +1 -1
  8. package/build/{fp_explain-DZJ--0-S.js → fp_explain-D6QvDLKQ.js} +1 -1
  9. package/build/{fp_inventory-CPtmuuke.js → fp_inventory-C43fU39x.js} +1 -1
  10. package/build/{fp_metrics-et8F1Wvt.js → fp_metrics-DEMPk4xC.js} +1 -1
  11. package/build/index.d.ts +8 -4
  12. package/build/index.js +4 -4
  13. package/build/{pipeline-CNTBhs6o.js → pipeline-Cq4dNTNE.js} +763 -313
  14. package/build/{resolvers-PJwo2Z8R.js → resolvers-DlKJOZnk.js} +328 -63
  15. package/build/{runners-DIt1G85i.js → runners-FYmPIPub.js} +6 -3
  16. package/build/src/albrecht/counter.d.ts +31 -5
  17. package/build/src/albrecht/data_functions.d.ts +49 -3
  18. package/build/src/albrecht/diff.d.ts +27 -0
  19. package/build/src/albrecht/index.d.ts +1 -0
  20. package/build/src/albrecht/opaque.d.ts +90 -0
  21. package/build/src/albrecht/technical_filter.d.ts +18 -11
  22. package/build/src/albrecht/transactional_functions.d.ts +7 -0
  23. package/build/src/cli.js +2 -2
  24. package/build/src/define_config.d.ts +55 -57
  25. package/build/src/inventory/graph/call_graph.d.ts +29 -0
  26. package/build/src/inventory/graph/output_fields.d.ts +99 -0
  27. package/build/src/inventory/paths.d.ts +2 -0
  28. package/build/src/inventory/resolvers/index.d.ts +21 -0
  29. package/build/src/inventory/resolvers/index.js +2 -2
  30. package/build/src/pipeline.js +1 -1
  31. package/build/src/types.d.ts +30 -1
  32. package/build/stubs/config.stub +29 -16
  33. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  //#region src/define_config.ts
2
2
  const DEFAULTS = {
3
3
  boundary: {},
4
- retStrategy: "constant",
4
+ dataFunctions: { grouping: "usage" },
5
5
  maxDepth: 3,
6
6
  messageDet: 0
7
7
  };
@@ -12,6 +12,10 @@ function defineConfig(config) {
12
12
  boundary: {
13
13
  ...DEFAULTS.boundary,
14
14
  ...config.boundary
15
+ },
16
+ dataFunctions: {
17
+ ...DEFAULTS.dataFunctions,
18
+ ...config.dataFunctions
15
19
  }
16
20
  };
17
21
  }
@@ -51,6 +55,39 @@ const AEP_FACTORS = {
51
55
  unchanged: 0
52
56
  };
53
57
  /**
58
+ * The Roteiro de Métricas de Software do SISP, v3.0 (Portaria SGD/MGI nº 3656,
59
+ * de 2026), §7.3 "Projeto de Melhoria" — what a Brazilian public contract names
60
+ * instead of AEP:
61
+ *
62
+ * PF_MELHORIA = PF_INCLUÍDO + FI × PF_ALTERADO + 0,50 × PF_EXCLUÍDO + PF_CONVERSÃO
63
+ *
64
+ * where FI, the impact factor on an altered function, is 63% when the contractor
65
+ * developed or already maintains the function, and 84% when it did not (and must
66
+ * document it). This preset carries the 63% — a factory billing maintenance of
67
+ * its own work — and `diff.factors: { changed: 0.84 }` is the other case.
68
+ * PF_CONVERSÃO is data conversion, which this package does not count.
69
+ *
70
+ * Read from the guide's own PDF, not from memory: an earlier draft of this
71
+ * preset said 0,50 / 0,30, and v2.0 (2012) priced exclusion at 0,40. A contract
72
+ * binds to a revision, so the report prints which preset priced the total.
73
+ */
74
+ const SISP_FACTORS = {
75
+ added: 1,
76
+ changed: .63,
77
+ removed: .5,
78
+ unchanged: 0
79
+ };
80
+ const FACTOR_PRESETS = {
81
+ aep: {
82
+ label: "OMG Automated Enhancement Points 1.0, §6.5",
83
+ factors: AEP_FACTORS
84
+ },
85
+ sisp: {
86
+ label: "Roteiro de Métricas de Software do SISP v3.0 §7.3, FI 63% (own maintenance); 84% otherwise",
87
+ factors: SISP_FACTORS
88
+ }
89
+ };
90
+ /**
54
91
  * Two counts of DIFFERENT applications compare cleanly and mean nothing.
55
92
  *
56
93
  * The ruleset guard already refuses counts produced by different rules. This
@@ -68,8 +105,9 @@ var IncomparableSourcesError = class extends Error {
68
105
  function diffCounts(from, to, options = {}) {
69
106
  if (from.rulesetVersion !== to.rulesetVersion || from.ruleset !== to.ruleset) throw new IncomparableRulesetsError(`${from.ruleset}@${from.rulesetVersion}`, `${to.ruleset}@${to.rulesetVersion}`);
70
107
  if (from.source && to.source && from.source.app !== to.source.app) throw new IncomparableSourcesError(from.source.app, to.source.app);
108
+ const preset = options.preset ?? "aep";
71
109
  const factors = {
72
- ...AEP_FACTORS,
110
+ ...FACTOR_PRESETS[preset].factors,
73
111
  ...options.factors
74
112
  };
75
113
  const reasonFactors = options.reasonFactors ?? {};
@@ -140,6 +178,7 @@ function diffCounts(from, to, options = {}) {
140
178
  * an invoice, and a reader who sees that tail stops trusting the rest.
141
179
  */
142
180
  billable: round2(entries.reduce((total, entry) => total + entry.function.points * factorFor(entry), 0)),
181
+ preset,
143
182
  factors,
144
183
  reasonFactors,
145
184
  warnings
@@ -400,4 +439,4 @@ function parseSamples(csv) {
400
439
  return samples;
401
440
  }
402
441
  //#endregion
403
- export { AEP_FACTORS as a, diffCounts as c, measureStructure as i, DEFAULTS as l, parseSamples as n, IncomparableRulesetsError as o, measureConformance as r, IncomparableSourcesError as s, calibrate as t, defineConfig as u };
442
+ export { AEP_FACTORS as a, IncomparableSourcesError as c, DEFAULTS as d, defineConfig as f, measureStructure as i, SISP_FACTORS as l, parseSamples as n, FACTOR_PRESETS as o, measureConformance as r, IncomparableRulesetsError as s, calibrate as t, diffCounts as u };
@@ -14,27 +14,27 @@
14
14
  const commands = [
15
15
  {
16
16
  commandName: "fp:inventory",
17
- importer: () => import("../fp_inventory-CPtmuuke.js")
17
+ importer: () => import("../fp_inventory-C43fU39x.js")
18
18
  },
19
19
  {
20
20
  commandName: "fp:metrics",
21
- importer: () => import("../fp_metrics-et8F1Wvt.js")
21
+ importer: () => import("../fp_metrics-DEMPk4xC.js")
22
22
  },
23
23
  {
24
24
  commandName: "fp:count",
25
- importer: () => import("../fp_count-ChtblhZV.js")
25
+ importer: () => import("../fp_count-CZ0cUUBQ.js")
26
26
  },
27
27
  {
28
28
  commandName: "fp:explain",
29
- importer: () => import("../fp_explain-DZJ--0-S.js")
29
+ importer: () => import("../fp_explain-D6QvDLKQ.js")
30
30
  },
31
31
  {
32
32
  commandName: "fp:diff",
33
- importer: () => import("../fp_diff-Dt7J4IWu.js")
33
+ importer: () => import("../fp_diff-BTg_LX0r.js")
34
34
  },
35
35
  {
36
36
  commandName: "fp:calibrate",
37
- importer: () => import("../fp_calibrate-DUbHiifm.js")
37
+ importer: () => import("../fp_calibrate-EAuAtdbq.js")
38
38
  }
39
39
  ];
40
40
  let cache = null;
@@ -1,4 +1,4 @@
1
- import { s as printResult, t as runCalibrate } from "./runners-DIt1G85i.js";
1
+ import { s as printResult, t as runCalibrate } from "./runners-FYmPIPub.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-DIt1G85i.js";
1
+ import { n as runCount, s as printResult } from "./runners-FYmPIPub.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-DIt1G85i.js";
1
+ import { r as runDiff, s as printResult } from "./runners-FYmPIPub.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-DIt1G85i.js";
1
+ import { i as runExplain, s as printResult } from "./runners-FYmPIPub.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-DIt1G85i.js";
1
+ import { a as runInventory, s as printResult } from "./runners-FYmPIPub.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-DIt1G85i.js";
1
+ import { o as runMetrics, s as printResult } from "./runners-FYmPIPub.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.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { configure } from './configure.js';
2
2
  export { defineConfig } from './src/define_config.js';
3
- export type { FunctionPointsConfig, FunctionOverride } from './src/define_config.js';
3
+ export type { FunctionPointsConfig, FunctionOverride, OpaqueDeclaration, } from './src/define_config.js';
4
4
  export * from './src/types.js';
5
5
  /**
6
6
  * Counting, programmatically.
@@ -20,9 +20,12 @@ export type { Analysis, AnalysisOptions } from './src/pipeline.js';
20
20
  * it was measured with.
21
21
  */
22
22
  export { RULESET, RULESET_VERSION } from './src/albrecht/counter.js';
23
+ /** The technical-data filter's naming list, to start from when replacing it. */
24
+ export { DEFAULT_TECHNICAL_PATTERNS } from './src/albrecht/technical_filter.js';
25
+ export type { TechnicalPattern } from './src/albrecht/technical_filter.js';
23
26
  /** Change, and what it bills at — AEP §6.3 and §6.5. */
24
- export { AEP_FACTORS, diffCounts, IncomparableRulesetsError, IncomparableSourcesError, } from './src/albrecht/diff.js';
25
- export type { ChangeFactors, ChangeReasonFactors, DiffOptions, FunctionPointDiff, } from './src/albrecht/diff.js';
27
+ export { AEP_FACTORS, SISP_FACTORS, FACTOR_PRESETS, diffCounts, IncomparableRulesetsError, IncomparableSourcesError, } from './src/albrecht/diff.js';
28
+ export type { ChangeFactors, ChangeReasonFactors, DiffOptions, FactorPreset, FunctionPointDiff, } from './src/albrecht/diff.js';
26
29
  /** The counterweight: density, coupling and conformance over the same inventory. */
27
30
  export { measureConformance, measureStructure } from './src/metrics/structure.js';
28
31
  export type { Conformance, ModuleMetrics, StructureMetrics } from './src/metrics/structure.js';
@@ -30,5 +33,6 @@ export type { Conformance, ModuleMetrics, StructureMetrics } from './src/metrics
30
33
  export { calibrate, parseSamples } from './src/albrecht/calibration.js';
31
34
  export type { Calibration, CalibrationSample, TypeCalibration } from './src/albrecht/calibration.js';
32
35
  /** Tracing strategies: the one public extension point. */
33
- export { BUILTIN_CALL_RESOLVERS } from './src/inventory/resolvers/index.js';
36
+ export { BUILTIN_CALL_RESOLVERS, ignoreCalls } from './src/inventory/resolvers/index.js';
37
+ export type { IgnoreCallsOptions } from './src/inventory/resolvers/index.js';
34
38
  export type { CallResolver, ResolverContext } from './src/inventory/resolvers/types.js';
package/build/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { configure } from "./configure.js";
2
- import { a as AEP_FACTORS, c as diffCounts, i as measureStructure, n as parseSamples, o as IncomparableRulesetsError, r as measureConformance, s as IncomparableSourcesError, t as calibrate, u as defineConfig } from "./calibration-8eV8CEix.js";
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 { t as BUILTIN_CALL_RESOLVERS } from "./resolvers-PJwo2Z8R.js";
5
- import { i as RULESET_VERSION, n as analyze, r as RULESET, t as CoverageTooLowError } from "./pipeline-CNTBhs6o.js";
6
- export { AEP_FACTORS, BUILTIN_CALL_RESOLVERS, CoverageTooLowError, IncomparableRulesetsError, IncomparableSourcesError, RULESET, RULESET_VERSION, analyze, calibrate, configure, defineConfig, diffCounts, measureConformance, measureStructure, parseSamples };
4
+ import { n as ignoreCalls, t as BUILTIN_CALL_RESOLVERS } from "./resolvers-DlKJOZnk.js";
5
+ import { a as DEFAULT_TECHNICAL_PATTERNS, i as RULESET_VERSION, n as analyze, r as RULESET, t as CoverageTooLowError } from "./pipeline-Cq4dNTNE.js";
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 };