repometry 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 (115) hide show
  1. package/README.md +35 -17
  2. package/package.json +1 -1
  3. package/target/main/resources/report/json/comparison-v1.schema.json +6 -6
  4. package/target/main/resources/report/json/file-metrics-v1.schema.json +7 -6
  5. package/target/main/resources/report/json/pull-review-v1.schema.json +5 -5
  6. package/target/main/resources/report/json/report-v2.schema.json +197 -10
  7. package/target/main/resources/report/json/repository-summary-v1.schema.json +161 -14
  8. package/target/main/resources/report/json/viewer-inspection-v1.schema.json +518 -6
  9. package/target/main/resources/viewer/styles.css +5 -0
  10. package/target/main/ts/api/git/changes.d.ts +1 -1
  11. package/target/main/ts/api/git/changes.js +3 -3
  12. package/target/main/ts/api/git/commit-metadata.js +6 -4
  13. package/target/main/ts/api/git/git.d.ts +1 -1
  14. package/target/main/ts/api/git/git.js +4 -4
  15. package/target/main/ts/api/git/inspection-source.d.ts +1 -1
  16. package/target/main/ts/api/git/inspection-source.js +3 -3
  17. package/target/main/ts/api/git/local.d.ts +1 -1
  18. package/target/main/ts/api/git/local.js +4 -4
  19. package/target/main/ts/api/worker/remote-executor.d.ts +1 -1
  20. package/target/main/ts/api/worker/remote-executor.js +2 -2
  21. package/target/main/ts/api/worker/worker-protocol.d.ts +2 -2
  22. package/target/main/ts/api/worker/worker-protocol.js +8 -8
  23. package/target/main/ts/api/worker/worker.d.ts +1 -1
  24. package/target/main/ts/api/worker/worker.js +4 -4
  25. package/target/main/ts/cli/main.js +4 -3
  26. package/target/main/ts/cli/reporting.d.ts +1 -1
  27. package/target/main/ts/cli/reporting.js +1 -1
  28. package/target/main/ts/compose/analysis-files.d.ts +13 -0
  29. package/target/main/ts/compose/analysis-files.js +95 -0
  30. package/target/main/ts/compose/analysis-imports.d.ts +7 -0
  31. package/target/main/ts/compose/analysis-imports.js +34 -0
  32. package/target/main/ts/compose/analysis-report.d.ts +5 -0
  33. package/target/main/ts/compose/analysis-report.js +78 -0
  34. package/target/main/ts/compose/analysis-repository.d.ts +6 -0
  35. package/target/main/ts/compose/analysis-repository.js +61 -0
  36. package/target/main/ts/compose/analysis-results.d.ts +38 -0
  37. package/target/main/ts/compose/analysis-results.js +78 -0
  38. package/target/main/ts/compose/analysis-sources.d.ts +73 -0
  39. package/target/main/ts/compose/analysis-sources.js +47 -0
  40. package/target/main/ts/compose/analyze-snapshot.d.ts +2 -2
  41. package/target/main/ts/compose/analyze-snapshot.js +19 -250
  42. package/target/main/ts/compose/diff-coverage.d.ts +2 -0
  43. package/target/main/ts/compose/diff-coverage.js +6 -4
  44. package/target/main/ts/compose/inspect.js +8 -5
  45. package/target/main/ts/compose/languages.d.ts +29 -0
  46. package/target/main/ts/compose/languages.js +87 -0
  47. package/target/main/ts/compose/sources.js +14 -12
  48. package/target/main/ts/core/engine/manifest.d.ts +2 -2
  49. package/target/main/ts/core/engine/manifest.js +25 -5
  50. package/target/main/ts/core/engine/plan.d.ts +2 -4
  51. package/target/main/ts/core/engine/plan.js +13 -15
  52. package/target/main/ts/core/engine/plugin.d.ts +2 -1
  53. package/target/main/ts/core/model/clone-source.d.ts +1 -0
  54. package/target/main/ts/core/model/clone-source.js +1 -0
  55. package/target/main/ts/core/model/code-structure.d.ts +2 -0
  56. package/target/main/ts/core/model/code-structure.js +6 -0
  57. package/target/main/ts/core/model/language.d.ts +10 -0
  58. package/target/main/ts/core/model/language.js +6 -0
  59. package/target/main/ts/core/model/measurement.d.ts +7 -6
  60. package/target/main/ts/core/model/measurement.js +17 -6
  61. package/target/main/ts/core/model/plugin-data.d.ts +3 -0
  62. package/target/main/ts/core/model/quality-summary.js +5 -4
  63. package/target/main/ts/core/model/report.d.ts +1 -2
  64. package/target/main/ts/core/model/report.js +0 -1
  65. package/target/main/ts/core/model/snapshot.d.ts +0 -2
  66. package/target/main/ts/core/model/snapshot.js +0 -6
  67. package/target/main/ts/core/usecases/compare.js +61 -17
  68. package/target/main/ts/core/usecases/inspect.js +2 -2
  69. package/target/main/ts/plugin.d.ts +3 -2
  70. package/target/main/ts/plugin.js +1 -1
  71. package/target/main/ts/plugins/duplication/duplication.js +10 -4
  72. package/target/main/ts/plugins/language-js/babel-provider.js +8 -2
  73. package/target/main/ts/plugins/language-js/extensions.d.ts +3 -0
  74. package/target/main/ts/plugins/language-js/extensions.js +4 -0
  75. package/target/main/ts/plugins/language-js/js-security.js +3 -2
  76. package/target/main/ts/report/html/app/viewer-data.d.ts +1 -1
  77. package/target/main/ts/report/html/app/viewer-data.js +2 -29
  78. package/target/main/ts/report/html/app/viewer-metric-registry.js +7 -7
  79. package/target/main/ts/report/html/app/viewer-overview-cards.js +8 -2
  80. package/target/main/ts/report/html/app/viewer-route.d.ts +2 -2
  81. package/target/main/ts/report/html/app/viewer-route.js +3 -3
  82. package/target/main/ts/report/html/app/viewer-trend-data.d.ts +6 -1
  83. package/target/main/ts/report/html/app/viewer-trend-data.js +6 -2
  84. package/target/main/ts/report/html/app/viewer.js +3 -3
  85. package/target/main/ts/report/html/site/export-site.d.ts +3 -4
  86. package/target/main/ts/report/html/site/export-site.js +24 -41
  87. package/target/main/ts/report/html/site/exported-server.js +2 -1
  88. package/target/main/ts/report/html/site/local-server.d.ts +1 -1
  89. package/target/main/ts/report/html/site/local-server.js +13 -19
  90. package/target/main/ts/report/html/site/projects.js +8 -17
  91. package/target/main/ts/report/json/projections/commit-summary.d.ts +2 -2
  92. package/target/main/ts/report/json/projections/commit-summary.js +18 -19
  93. package/target/main/ts/report/json/projections/file-metrics.js +31 -24
  94. package/target/main/ts/report/json/projections/inspection-context.js +10 -1
  95. package/target/main/ts/report/json/projections/inspection-details.d.ts +1 -1
  96. package/target/main/ts/report/json/projections/inspection-details.js +2 -2
  97. package/target/main/ts/report/json/projections/metric-values.d.ts +1 -0
  98. package/target/main/ts/report/json/projections/metric-values.js +15 -5
  99. package/target/main/ts/report/json/store/pull-review-store.js +1 -2
  100. package/target/main/ts/report/json/validation/report.d.ts +1 -1
  101. package/target/main/ts/report/json/validation/report.js +10 -8
  102. package/target/main/ts/report/json/validation/summary-validation.js +1 -3
  103. package/target/main/ts/report/json/wire/file-metrics-model.d.ts +2 -0
  104. package/target/main/ts/report/json/wire/inspection-details-model.d.ts +0 -5
  105. package/target/main/ts/report/json/wire/public-history-model.d.ts +0 -6
  106. package/target/main/ts/report/json/wire/public-history-model.js +0 -1
  107. package/target/main/ts/report.d.ts +2 -3
  108. package/target/main/ts/report.js +1 -2
  109. package/target/main/resources/report/json/inspection-context-v1.schema.json +0 -172
  110. package/target/main/resources/report/json/public-history-v1.schema.json +0 -50
  111. package/target/main/resources/report/json/quality-history-v1.schema.json +0 -51
  112. package/target/main/resources/report/json/report-v1.schema.json +0 -65
  113. package/target/main/resources/report/json/viewer-details-v1.schema.json +0 -346
  114. package/target/main/ts/report/json/projections/public-history.d.ts +0 -4
  115. package/target/main/ts/report/json/projections/public-history.js +0 -17
package/README.md CHANGED
@@ -1,30 +1,48 @@
1
- # Repometry
1
+ <h1 align="center">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/idleware/repometry/master/.github/assets/readme-header-dark.svg">
4
+ <img src="https://raw.githubusercontent.com/idleware/repometry/master/.github/assets/readme-header-light.svg" alt="repometry" width="287" height="48">
5
+ </picture>
6
+ </h1>
2
7
 
3
- [![Maintainability](https://idleware.github.io/repometry/maintainability.svg)](https://idleware.github.io/repometry/)
4
- [![Coverage](https://idleware.github.io/repometry/coverage.svg)](https://idleware.github.io/repometry/)
5
- [![Security](https://idleware.github.io/repometry/security.svg)](https://idleware.github.io/repometry/)
8
+ <p align="center">Track repository metrics without SaaS</p>
6
9
 
7
- > Track repository metrics without SaaS
10
+ <p align="center">
11
+ <a href="https://idleware.github.io/repometry/"><img src="https://idleware.github.io/repometry/maintainability.svg" alt="Maintainability"></a>
12
+ <a href="https://idleware.github.io/repometry/"><img src="https://idleware.github.io/repometry/coverage.svg" alt="Coverage"></a>
13
+ <a href="https://idleware.github.io/repometry/"><img src="https://idleware.github.io/repometry/security.svg" alt="Security"></a>
14
+ </p>
8
15
 
9
16
  Git can serve as a project’s single source of truth for code, tests, docs, and CI configuration. Repometry lets you keep coverage and maintainability metrics alongside your code, commit by commit.
10
17
 
11
18
  ## Requirements
12
19
 
13
- Node.js >= 24
20
+ Node.js 24 or newer.
14
21
 
15
22
  ## Usage
16
23
 
17
- Run each command in your repository as `npx repometry <command>`.
18
-
19
- | Command | What it does |
20
- |---|---|
21
- | `analyze` | Measures HEAD and saves the inspection under `.repometry/` |
22
- | `analyze HEAD~50..HEAD` | Measures the last 50 commits, oldest first, to build history. `--skip-saved` leaves commits already saved. |
23
- | `analyze --import lcov=coverage/lcov.info` | Adds coverage or scanner results from your tools. Repeat `--import` for each file. |
24
- | `report html` | Writes the report (history, files, findings, badges, source links) to `.repometry/report/html`; `-o DIR` picks another folder |
25
- | `view` | Serves the report locally on a free port; `--port 3030` picks the port |
26
- | `plugins` | Lists the import formats, reporters and CI adapters |
27
- | `help [command]` | Shows the options of a command |
24
+ Run these commands in your repository.
25
+
26
+ ```sh
27
+ # Analyze HEAD and save its inspection under .repometry/.
28
+ npx repometry analyze
29
+
30
+ # Build history for the last 50 commits, oldest first, skipping saved inspections.
31
+ npx repometry analyze HEAD~50..HEAD --skip-saved
32
+
33
+ # Import coverage and scanner results. Repeat --import for each file.
34
+ npx repometry analyze --import lcov=coverage/lcov.info --import sarif=results.sarif
35
+
36
+ # Open the report locally on a free port. Use --port 3030 to choose a port.
37
+ npx repometry view
38
+
39
+ # Export a static report to .repometry/report/html. Use -o DIR for another folder.
40
+ npx repometry report html
41
+
42
+ # List supported formats and get help for a command.
43
+ npx repometry plugins
44
+ npx repometry help analyze
45
+ ```
28
46
 
29
47
  A report shows everything the store holds, so publish it only where you would publish that data.
30
48
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repometry",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Track repository metrics without SaaS",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -25,10 +25,10 @@
25
25
  "type": "object",
26
26
  "required": ["subject", "generatedAt", "status", "scope"],
27
27
  "properties": {
28
- "subject": { "$ref": "urn:repometry:schema:report:1#/$defs/subject" },
29
- "generatedAt": { "$ref": "urn:repometry:schema:report:1#/properties/generatedAt" },
30
- "status": { "$ref": "urn:repometry:schema:report:1#/properties/status" },
31
- "scope": { "$ref": "urn:repometry:schema:report:1#/properties/scope" }
28
+ "subject": { "$ref": "urn:repometry:schema:report:2#/$defs/subject" },
29
+ "generatedAt": { "$ref": "urn:repometry:schema:report:2#/properties/generatedAt" },
30
+ "status": { "$ref": "urn:repometry:schema:report:2#/properties/status" },
31
+ "scope": { "$ref": "urn:repometry:schema:report:2#/properties/scope" }
32
32
  },
33
33
  "additionalProperties": false
34
34
  },
@@ -38,8 +38,8 @@
38
38
  "properties": {
39
39
  "status": { "enum": ["complete", "partial", "not-applicable", "unavailable"] },
40
40
  "value": { "type": ["number", "null"], "minimum": 0 },
41
- "covered": { "$ref": "urn:repometry:schema:report:1#/$defs/count" },
42
- "total": { "$ref": "urn:repometry:schema:report:1#/$defs/count" }
41
+ "covered": { "$ref": "urn:repometry:schema:report:2#/$defs/count" },
42
+ "total": { "$ref": "urn:repometry:schema:report:2#/$defs/count" }
43
43
  },
44
44
  "dependentRequired": { "covered": ["total"], "total": ["covered"] },
45
45
  "additionalProperties": false
@@ -5,10 +5,10 @@
5
5
  "required": ["schema", "subject", "generatedAt", "status", "scope", "files", "directories", "unassignedDiagnostics", "hotspots"],
6
6
  "properties": {
7
7
  "schema": { "const": "urn:repometry:schema:file-metrics:1" },
8
- "subject": { "$ref": "urn:repometry:schema:report:1#/$defs/subject" },
9
- "generatedAt": { "$ref": "urn:repometry:schema:report:1#/properties/generatedAt" },
10
- "status": { "$ref": "urn:repometry:schema:report:1#/properties/status" },
11
- "scope": { "$ref": "urn:repometry:schema:report:1#/properties/scope" },
8
+ "subject": { "$ref": "urn:repometry:schema:report:2#/$defs/subject" },
9
+ "generatedAt": { "$ref": "urn:repometry:schema:report:2#/properties/generatedAt" },
10
+ "status": { "$ref": "urn:repometry:schema:report:2#/properties/status" },
11
+ "scope": { "$ref": "urn:repometry:schema:report:2#/properties/scope" },
12
12
  "files": { "type": "array", "items": { "$ref": "#/$defs/file" } },
13
13
  "directories": { "type": "array", "items": { "$ref": "#/$defs/directory" } },
14
14
  "languages": {
@@ -16,7 +16,7 @@
16
16
  "items": {
17
17
  "type": "object",
18
18
  "required": ["id", "analysed"],
19
- "properties": { "id": { "type": "string" }, "label": { "type": "string" }, "analysed": { "type": "boolean" } },
19
+ "properties": { "id": { "type": "string" }, "label": { "type": "string" }, "color": { "type": "string", "pattern": "^#[a-fA-F0-9]{6}$" }, "analysed": { "type": "boolean" } },
20
20
  "additionalProperties": false
21
21
  }
22
22
  },
@@ -50,13 +50,14 @@
50
50
  },
51
51
  "additionalProperties": false,
52
52
  "$defs": {
53
- "count": { "$ref": "urn:repometry:schema:report:1#/$defs/count" },
53
+ "count": { "$ref": "urn:repometry:schema:report:2#/$defs/count" },
54
54
  "optionalCount": { "anyOf": [{ "$ref": "#/$defs/count" }, { "type": "null" }] },
55
55
  "observations": {
56
56
  "type": "object",
57
57
  "required": ["path", "lines", "functions", "complexity", "lineCoverage", "diagnosticCount"],
58
58
  "properties": {
59
59
  "language": { "type": "integer", "minimum": 0 },
60
+ "provider": { "type": "string", "minLength": 1 },
60
61
  "analysed": { "type": "boolean" },
61
62
  "values": {
62
63
  "type": "object",
@@ -35,8 +35,8 @@
35
35
  "required": ["status", "covered", "total", "percent", "files", "gaps", "excludedPaths", "coverageInputDigest", "uncovered", "gate"],
36
36
  "properties": {
37
37
  "status": { "enum": ["complete", "partial", "not-applicable", "unavailable"] },
38
- "covered": { "$ref": "urn:repometry:schema:report:1#/$defs/count" },
39
- "total": { "$ref": "urn:repometry:schema:report:1#/$defs/count" },
38
+ "covered": { "$ref": "urn:repometry:schema:report:2#/$defs/count" },
39
+ "total": { "$ref": "urn:repometry:schema:report:2#/$defs/count" },
40
40
  "percent": { "$ref": "urn:repometry:schema:diff-coverage:1#/properties/percent" },
41
41
  "files": { "$ref": "urn:repometry:schema:diff-coverage:1#/properties/files" },
42
42
  "gaps": { "$ref": "urn:repometry:schema:diff-coverage:1#/properties/gaps" },
@@ -60,7 +60,7 @@
60
60
  "properties": {
61
61
  "status": { "$ref": "#/$defs/gateStatus" },
62
62
  "minimumPercent": { "$ref": "urn:repometry:schema:diff-coverage:1#/$defs/percent" },
63
- "minimumLines": { "$ref": "urn:repometry:schema:report:1#/$defs/count" }
63
+ "minimumLines": { "$ref": "urn:repometry:schema:report:2#/$defs/count" }
64
64
  },
65
65
  "additionalProperties": false
66
66
  }
@@ -72,14 +72,14 @@
72
72
  "required": ["added", "qualityCount", "reason", "gate"],
73
73
  "properties": {
74
74
  "added": { "type": ["array", "null"], "items": { "$ref": "urn:repometry:schema:report:2#/$defs/finding" } },
75
- "qualityCount": { "anyOf": [{ "type": "null" }, { "$ref": "urn:repometry:schema:report:1#/$defs/count" }] },
75
+ "qualityCount": { "anyOf": [{ "type": "null" }, { "$ref": "urn:repometry:schema:report:2#/$defs/count" }] },
76
76
  "reason": { "enum": [null, "reports-unavailable", "findings-unavailable", "partial-inspection", "analysis-changed"] },
77
77
  "gate": {
78
78
  "type": ["object", "null"],
79
79
  "required": ["status", "maximum"],
80
80
  "properties": {
81
81
  "status": { "$ref": "#/$defs/gateStatus" },
82
- "maximum": { "$ref": "urn:repometry:schema:report:1#/$defs/count" }
82
+ "maximum": { "$ref": "urn:repometry:schema:report:2#/$defs/count" }
83
83
  },
84
84
  "additionalProperties": false
85
85
  }
@@ -18,10 +18,10 @@
18
18
  "const": "urn:repometry:schema:report:2"
19
19
  },
20
20
  "subject": {
21
- "$ref": "urn:repometry:schema:report:1#/properties/subject"
21
+ "$ref": "#/$defs/subject"
22
22
  },
23
23
  "generatedAt": {
24
- "$ref": "urn:repometry:schema:report:1#/properties/generatedAt"
24
+ "type": "string"
25
25
  },
26
26
  "committedAt": {
27
27
  "type": "string"
@@ -41,22 +41,49 @@
41
41
  "additionalProperties": false
42
42
  },
43
43
  "appliedConfig": {
44
- "$ref": "urn:repometry:schema:report:1#/properties/appliedConfig"
44
+ "type": "object",
45
+ "minProperties": 1
45
46
  },
46
47
  "definitions": {
47
- "$ref": "urn:repometry:schema:report:1#/properties/definitions"
48
+ "type": "object",
49
+ "additionalProperties": {
50
+ "type": "string"
51
+ }
48
52
  },
49
53
  "scope": {
50
- "$ref": "urn:repometry:schema:report:1#/properties/scope"
54
+ "type": "object",
55
+ "required": [
56
+ "files",
57
+ "parsed"
58
+ ],
59
+ "properties": {
60
+ "files": {
61
+ "$ref": "#/$defs/count"
62
+ },
63
+ "parsed": {
64
+ "$ref": "#/$defs/count"
65
+ }
66
+ },
67
+ "additionalProperties": false
51
68
  },
52
69
  "status": {
53
- "$ref": "urn:repometry:schema:report:1#/properties/status"
70
+ "enum": [
71
+ "complete",
72
+ "partial",
73
+ "not-applicable"
74
+ ]
54
75
  },
55
76
  "measurements": {
56
- "$ref": "urn:repometry:schema:report:1#/properties/measurements"
77
+ "type": "array",
78
+ "items": {
79
+ "$ref": "#/$defs/measurement"
80
+ }
57
81
  },
58
82
  "diagnostics": {
59
- "$ref": "urn:repometry:schema:report:1#/properties/diagnostics"
83
+ "type": "array",
84
+ "items": {
85
+ "$ref": "#/$defs/diagnostic"
86
+ }
60
87
  },
61
88
  "findings": {
62
89
  "type": "array",
@@ -83,6 +110,19 @@
83
110
  "additionalProperties": false
84
111
  }
85
112
  },
113
+ "languages": {
114
+ "type": "array",
115
+ "items": {
116
+ "type": "object",
117
+ "required": ["id", "label"],
118
+ "properties": {
119
+ "id": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" },
120
+ "label": { "type": "string", "minLength": 1 },
121
+ "color": { "type": "string", "pattern": "^#[a-fA-F0-9]{6}$" }
122
+ },
123
+ "additionalProperties": false
124
+ }
125
+ },
86
126
  "inventory": {
87
127
  "type": "array",
88
128
  "items": {
@@ -93,6 +133,7 @@
93
133
  "lines": { "type": ["integer", "null"], "minimum": 0 },
94
134
  "bytes": { "type": "integer", "minimum": 0 },
95
135
  "language": { "type": "string" },
136
+ "provider": { "type": "string", "minLength": 1 },
96
137
  "analysed": { "type": "boolean" }
97
138
  },
98
139
  "additionalProperties": false
@@ -139,6 +180,111 @@
139
180
  },
140
181
  "additionalProperties": false,
141
182
  "$defs": {
183
+ "measurement": {
184
+ "type": "object",
185
+ "required": [
186
+ "definition",
187
+ "target",
188
+ "value"
189
+ ],
190
+ "properties": {
191
+ "definition": {
192
+ "type": "string",
193
+ "minLength": 1
194
+ },
195
+ "target": {
196
+ "enum": [
197
+ "repository",
198
+ "file",
199
+ "function"
200
+ ]
201
+ },
202
+ "value": {
203
+ "type": [
204
+ "number",
205
+ "null"
206
+ ]
207
+ },
208
+ "path": {
209
+ "type": "string",
210
+ "minLength": 1
211
+ },
212
+ "line": {
213
+ "type": "integer",
214
+ "minimum": 1
215
+ },
216
+ "column": {
217
+ "type": "integer",
218
+ "minimum": 1
219
+ },
220
+ "name": {
221
+ "type": "string"
222
+ },
223
+ "covered": {
224
+ "$ref": "#/$defs/count"
225
+ },
226
+ "total": {
227
+ "$ref": "#/$defs/count"
228
+ }
229
+ },
230
+ "dependentRequired": {
231
+ "covered": [
232
+ "total"
233
+ ],
234
+ "total": [
235
+ "covered"
236
+ ],
237
+ "line": [
238
+ "path"
239
+ ],
240
+ "column": [
241
+ "line"
242
+ ]
243
+ },
244
+ "if": {
245
+ "properties": {
246
+ "target": {
247
+ "enum": [
248
+ "file",
249
+ "function"
250
+ ]
251
+ }
252
+ }
253
+ },
254
+ "then": {
255
+ "required": [
256
+ "path"
257
+ ]
258
+ },
259
+ "additionalProperties": false
260
+ },
261
+ "diagnostic": {
262
+ "type": "object",
263
+ "required": [
264
+ "operation",
265
+ "state",
266
+ "message"
267
+ ],
268
+ "properties": {
269
+ "operation": {
270
+ "type": "string"
271
+ },
272
+ "state": {
273
+ "enum": [
274
+ "failed",
275
+ "blocked",
276
+ "partial"
277
+ ]
278
+ },
279
+ "path": {
280
+ "type": "string"
281
+ },
282
+ "message": {
283
+ "type": "string"
284
+ }
285
+ },
286
+ "additionalProperties": false
287
+ },
142
288
  "reportProduct": {
143
289
  "type": "object",
144
290
  "required": ["operation", "value"],
@@ -302,10 +448,51 @@
302
448
  "additionalProperties": false
303
449
  },
304
450
  "count": {
305
- "$ref": "urn:repometry:schema:report:1#/$defs/count"
451
+ "type": "integer",
452
+ "minimum": 0,
453
+ "maximum": 9007199254740991
306
454
  },
307
455
  "subject": {
308
- "$ref": "urn:repometry:schema:report:1#/$defs/subject"
456
+ "type": "object",
457
+ "required": [
458
+ "kind",
459
+ "id"
460
+ ],
461
+ "properties": {
462
+ "kind": {
463
+ "enum": [
464
+ "commit",
465
+ "working-tree"
466
+ ]
467
+ },
468
+ "id": {
469
+ "type": "string"
470
+ }
471
+ },
472
+ "additionalProperties": false,
473
+ "if": {
474
+ "properties": {
475
+ "kind": {
476
+ "const": "commit"
477
+ }
478
+ }
479
+ },
480
+ "then": {
481
+ "properties": {
482
+ "id": {
483
+ "type": "string",
484
+ "pattern": "^(?:[a-f0-9]{40}|[a-f0-9]{64})$"
485
+ }
486
+ }
487
+ },
488
+ "else": {
489
+ "properties": {
490
+ "id": {
491
+ "type": "string",
492
+ "pattern": "^[a-f0-9]{64}$"
493
+ }
494
+ }
495
+ }
309
496
  }
310
497
  }
311
498
  }
@@ -40,6 +40,116 @@
40
40
  }
41
41
  },
42
42
  "$defs": {
43
+ "count": {
44
+ "type": "integer",
45
+ "minimum": 0
46
+ },
47
+ "nullableCount": {
48
+ "type": [
49
+ "integer",
50
+ "null"
51
+ ],
52
+ "minimum": 0
53
+ },
54
+ "ratio": {
55
+ "type": [
56
+ "number",
57
+ "null"
58
+ ],
59
+ "minimum": 0
60
+ },
61
+ "quality": {
62
+ "type": "object",
63
+ "required": [
64
+ "codeLines",
65
+ "comments",
66
+ "classes",
67
+ "cognitiveComplexity",
68
+ "duplication",
69
+ "maintainability"
70
+ ],
71
+ "properties": {
72
+ "codeLines": {
73
+ "$ref": "#/$defs/nullableCount"
74
+ },
75
+ "comments": {
76
+ "$ref": "#/$defs/nullableCount"
77
+ },
78
+ "classes": {
79
+ "$ref": "#/$defs/nullableCount"
80
+ },
81
+ "cognitiveComplexity": {
82
+ "$ref": "#/$defs/nullableCount"
83
+ },
84
+ "duplication": {
85
+ "type": [
86
+ "object",
87
+ "null"
88
+ ],
89
+ "required": [
90
+ "duplicatedLines",
91
+ "codeLines",
92
+ "ratio"
93
+ ],
94
+ "properties": {
95
+ "duplicatedLines": {
96
+ "type": "integer",
97
+ "minimum": 0
98
+ },
99
+ "codeLines": {
100
+ "type": "integer",
101
+ "minimum": 0
102
+ },
103
+ "ratio": {
104
+ "type": [
105
+ "number",
106
+ "null"
107
+ ],
108
+ "minimum": 0,
109
+ "maximum": 1
110
+ }
111
+ },
112
+ "additionalProperties": false
113
+ },
114
+ "maintainability": {
115
+ "type": [
116
+ "object",
117
+ "null"
118
+ ],
119
+ "required": [
120
+ "smells",
121
+ "effortMinutes",
122
+ "debtRatio",
123
+ "grade"
124
+ ],
125
+ "properties": {
126
+ "smells": {
127
+ "type": "integer",
128
+ "minimum": 0
129
+ },
130
+ "effortMinutes": {
131
+ "type": "integer",
132
+ "minimum": 0
133
+ },
134
+ "debtRatio": {
135
+ "$ref": "#/$defs/ratio"
136
+ },
137
+ "grade": {
138
+ "enum": [
139
+ "A",
140
+ "B",
141
+ "C",
142
+ "D",
143
+ "F",
144
+ null
145
+ ]
146
+ }
147
+ },
148
+ "additionalProperties": false
149
+ }
150
+ },
151
+ "additionalProperties": false
152
+ },
43
153
  "commit": {
44
154
  "type": "object",
45
155
  "required": [
@@ -63,46 +173,83 @@
63
173
  "additionalProperties": { "type": ["number", "null"] }
64
174
  },
65
175
  "sha": {
66
- "$ref": "urn:repometry:schema:public-history:1#/properties/reports/items/properties/sha"
176
+ "type": "string",
177
+ "pattern": "^(?:[a-f0-9]{40}|[a-f0-9]{64})$"
67
178
  },
68
179
  "generatedAt": {
69
- "$ref": "urn:repometry:schema:public-history:1#/properties/reports/items/properties/generatedAt"
180
+ "type": "string"
70
181
  },
71
182
  "status": {
72
- "$ref": "urn:repometry:schema:public-history:1#/properties/reports/items/properties/status"
183
+ "enum": [
184
+ "complete",
185
+ "partial",
186
+ "not-applicable"
187
+ ]
73
188
  },
74
189
  "files": {
75
- "$ref": "urn:repometry:schema:public-history:1#/properties/reports/items/properties/files"
190
+ "$ref": "#/$defs/count"
76
191
  },
77
192
  "parsed": {
78
- "$ref": "urn:repometry:schema:public-history:1#/properties/reports/items/properties/parsed"
193
+ "$ref": "#/$defs/count"
79
194
  },
80
195
  "lines": {
81
- "$ref": "urn:repometry:schema:public-history:1#/properties/reports/items/properties/lines"
196
+ "$ref": "#/$defs/nullableCount"
82
197
  },
83
198
  "functions": {
84
- "$ref": "urn:repometry:schema:public-history:1#/properties/reports/items/properties/functions"
199
+ "$ref": "#/$defs/nullableCount"
85
200
  },
86
201
  "maxComplexity": {
87
- "$ref": "urn:repometry:schema:public-history:1#/properties/reports/items/properties/maxComplexity"
202
+ "$ref": "#/$defs/nullableCount"
88
203
  },
89
204
  "lineCoverage": {
90
- "$ref": "urn:repometry:schema:public-history:1#/properties/reports/items/properties/lineCoverage"
205
+ "type": [
206
+ "object",
207
+ "null"
208
+ ],
209
+ "required": [
210
+ "covered",
211
+ "total"
212
+ ],
213
+ "properties": {
214
+ "covered": {
215
+ "$ref": "#/$defs/count"
216
+ },
217
+ "total": {
218
+ "type": "integer",
219
+ "minimum": 1
220
+ }
221
+ },
222
+ "additionalProperties": false
91
223
  },
92
224
  "committedAt": {
93
- "$ref": "urn:repometry:schema:public-history:1#/properties/reports/items/properties/committedAt"
225
+ "type": "string"
94
226
  },
95
227
  "subject": {
96
- "$ref": "urn:repometry:schema:public-history:1#/properties/reports/items/properties/subject"
228
+ "type": "string"
97
229
  },
98
230
  "author": {
99
- "$ref": "urn:repometry:schema:public-history:1#/properties/reports/items/properties/author"
231
+ "type": "object",
232
+ "required": [
233
+ "name"
234
+ ],
235
+ "additionalProperties": false,
236
+ "properties": {
237
+ "name": {
238
+ "type": "string"
239
+ },
240
+ "email": {
241
+ "type": "string"
242
+ }
243
+ }
100
244
  },
101
245
  "tags": {
102
- "$ref": "urn:repometry:schema:public-history:1#/properties/reports/items/properties/tags"
246
+ "type": "array",
247
+ "items": {
248
+ "type": "string"
249
+ }
103
250
  },
104
251
  "quality": {
105
- "$ref": "urn:repometry:schema:quality-history:1#/$defs/quality"
252
+ "$ref": "#/$defs/quality"
106
253
  },
107
254
  "revision": {
108
255
  "type": "string",