repometry 0.4.2 → 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 (269) hide show
  1. package/README.md +36 -14
  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 +210 -11
  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 +7 -2
  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 +2 -1
  14. package/target/main/ts/api/git/git.js +16 -4
  15. package/target/main/ts/api/git/inspection-source.d.ts +1 -1
  16. package/target/main/ts/api/git/inspection-source.js +4 -10
  17. package/target/main/ts/api/git/local.d.ts +1 -1
  18. package/target/main/ts/api/git/local.js +41 -7
  19. package/target/main/ts/api/process/docker-tool-runner.d.ts +13 -0
  20. package/target/main/ts/api/process/docker-tool-runner.js +108 -0
  21. package/target/main/ts/api/process/failure.d.ts +1 -0
  22. package/target/main/ts/api/process/failure.js +12 -0
  23. package/target/main/ts/api/process/plugin.d.ts +10 -0
  24. package/target/main/ts/api/process/plugin.js +96 -0
  25. package/target/main/ts/api/worker/remote-executor.d.ts +1 -1
  26. package/target/main/ts/api/worker/remote-executor.js +2 -2
  27. package/target/main/ts/api/worker/worker-protocol.d.ts +2 -2
  28. package/target/main/ts/api/worker/worker-protocol.js +8 -8
  29. package/target/main/ts/api/worker/worker.d.ts +1 -1
  30. package/target/main/ts/api/worker/worker.js +4 -4
  31. package/target/main/ts/cli/main.js +4 -3
  32. package/target/main/ts/cli/reporting.d.ts +1 -1
  33. package/target/main/ts/cli/reporting.js +1 -1
  34. package/target/main/ts/compose/analysis-files.d.ts +13 -0
  35. package/target/main/ts/compose/analysis-files.js +95 -0
  36. package/target/main/ts/compose/analysis-imports.d.ts +7 -0
  37. package/target/main/ts/compose/analysis-imports.js +34 -0
  38. package/target/main/ts/compose/analysis-report.d.ts +5 -0
  39. package/target/main/ts/compose/analysis-report.js +78 -0
  40. package/target/main/ts/compose/analysis-repository.d.ts +6 -0
  41. package/target/main/ts/compose/analysis-repository.js +61 -0
  42. package/target/main/ts/compose/analysis-results.d.ts +38 -0
  43. package/target/main/ts/compose/analysis-results.js +78 -0
  44. package/target/main/ts/compose/analysis-sources.d.ts +73 -0
  45. package/target/main/ts/compose/analysis-sources.js +47 -0
  46. package/target/main/ts/compose/analyze-snapshot.d.ts +3 -2
  47. package/target/main/ts/compose/analyze-snapshot.js +19 -197
  48. package/target/main/ts/compose/diff-coverage.d.ts +2 -0
  49. package/target/main/ts/compose/diff-coverage.js +6 -4
  50. package/target/main/ts/compose/inspect.d.ts +5 -0
  51. package/target/main/ts/compose/inspect.js +14 -7
  52. package/target/main/ts/compose/languages.d.ts +29 -0
  53. package/target/main/ts/compose/languages.js +87 -0
  54. package/target/main/ts/compose/sources.js +14 -12
  55. package/target/main/ts/core/engine/execute.d.ts +3 -1
  56. package/target/main/ts/core/engine/execute.js +14 -2
  57. package/target/main/ts/core/engine/manifest.d.ts +2 -2
  58. package/target/main/ts/core/engine/manifest.js +25 -5
  59. package/target/main/ts/core/engine/operation-cache.d.ts +14 -0
  60. package/target/main/ts/core/engine/operation-cache.js +66 -0
  61. package/target/main/ts/core/engine/plan.d.ts +3 -4
  62. package/target/main/ts/core/engine/plan.js +28 -11
  63. package/target/main/ts/core/engine/plugin.d.ts +10 -2
  64. package/target/main/ts/core/engine/plugin.js +1 -3
  65. package/target/main/ts/core/engine/report-products.js +2 -13
  66. package/target/main/ts/core/model/clone-source.d.ts +1 -0
  67. package/target/main/ts/core/model/clone-source.js +2 -1
  68. package/target/main/ts/core/model/code-structure.d.ts +5 -0
  69. package/target/main/ts/core/model/code-structure.js +10 -1
  70. package/target/main/ts/core/model/finding-ignore.js +1 -1
  71. package/target/main/ts/core/model/finding.js +1 -1
  72. package/target/main/ts/core/model/language.d.ts +10 -0
  73. package/target/main/ts/core/model/language.js +6 -0
  74. package/target/main/ts/core/model/line-coverage.d.ts +5 -1
  75. package/target/main/ts/core/model/line-coverage.js +14 -11
  76. package/target/main/ts/core/model/measurement.d.ts +7 -6
  77. package/target/main/ts/core/model/measurement.js +18 -7
  78. package/target/main/ts/core/model/plugin-data.d.ts +5 -0
  79. package/target/main/ts/core/model/plugin-data.js +15 -1
  80. package/target/main/ts/core/model/quality-summary.js +6 -5
  81. package/target/main/ts/core/model/report.d.ts +1 -2
  82. package/target/main/ts/core/model/report.js +0 -1
  83. package/target/main/ts/core/model/scanner-import.js +1 -1
  84. package/target/main/ts/core/model/snapshot.d.ts +1 -2
  85. package/target/main/ts/core/model/snapshot.js +5 -7
  86. package/target/main/ts/core/model/source.d.ts +3 -0
  87. package/target/main/ts/core/model/source.js +15 -0
  88. package/target/main/ts/core/ports/tool-runner.d.ts +18 -0
  89. package/target/main/ts/core/ports/tool-runner.js +2 -0
  90. package/target/main/ts/core/usecases/compare.js +61 -17
  91. package/target/main/ts/core/usecases/inspect.js +2 -2
  92. package/target/main/ts/plugin.d.ts +10 -3
  93. package/target/main/ts/plugin.js +4 -2
  94. package/target/main/ts/plugins/coverage/coverage.d.ts +5 -2
  95. package/target/main/ts/plugins/coverage/coverage.js +35 -10
  96. package/target/main/ts/plugins/duplication/duplication.js +10 -4
  97. package/target/main/ts/plugins/language-js/babel-provider.js +8 -2
  98. package/target/main/ts/plugins/language-js/extensions.d.ts +3 -0
  99. package/target/main/ts/plugins/language-js/extensions.js +4 -0
  100. package/target/main/ts/plugins/language-js/function-facts.d.ts +1 -0
  101. package/target/main/ts/plugins/language-js/function-facts.js +30 -4
  102. package/target/main/ts/plugins/language-js/js-security.js +3 -2
  103. package/target/main/ts/report/html/app/viewer-chart-bars.d.ts +11 -0
  104. package/target/main/ts/report/html/app/viewer-chart-bars.js +54 -0
  105. package/target/main/ts/report/html/app/viewer-chart-label.d.ts +15 -0
  106. package/target/main/ts/report/html/app/viewer-chart-label.js +43 -0
  107. package/target/main/ts/report/html/app/viewer-chart-line.d.ts +24 -0
  108. package/target/main/ts/report/html/app/viewer-chart-line.js +89 -0
  109. package/target/main/ts/report/html/app/viewer-chart-points.d.ts +49 -0
  110. package/target/main/ts/report/html/app/viewer-chart-points.js +74 -0
  111. package/target/main/ts/report/html/app/viewer-chart-scale.d.ts +21 -0
  112. package/target/main/ts/report/html/app/viewer-chart-scale.js +93 -0
  113. package/target/main/ts/report/html/app/viewer-chart-svg.d.ts +28 -0
  114. package/target/main/ts/report/html/app/viewer-chart-svg.js +41 -0
  115. package/target/main/ts/report/html/app/viewer-chart-time.d.ts +26 -0
  116. package/target/main/ts/report/html/app/viewer-chart-time.js +150 -0
  117. package/target/main/ts/report/html/app/viewer-chart-tip.d.ts +4 -0
  118. package/target/main/ts/report/html/app/viewer-chart-tip.js +210 -0
  119. package/target/main/ts/report/html/app/viewer-chart-x.d.ts +12 -0
  120. package/target/main/ts/report/html/app/viewer-chart-x.js +50 -0
  121. package/target/main/ts/report/html/app/viewer-chart.d.ts +4 -98
  122. package/target/main/ts/report/html/app/viewer-chart.js +16 -677
  123. package/target/main/ts/report/html/app/viewer-code-map.d.ts +27 -0
  124. package/target/main/ts/report/html/app/viewer-code-map.js +175 -0
  125. package/target/main/ts/report/html/app/viewer-columns.d.ts +38 -0
  126. package/target/main/ts/report/html/app/viewer-columns.js +92 -0
  127. package/target/main/ts/report/html/app/viewer-commit-picker.d.ts +12 -0
  128. package/target/main/ts/report/html/app/viewer-commit-picker.js +229 -0
  129. package/target/main/ts/report/html/app/viewer-commits.d.ts +5 -9
  130. package/target/main/ts/report/html/app/viewer-commits.js +17 -216
  131. package/target/main/ts/report/html/app/viewer-controls.d.ts +43 -0
  132. package/target/main/ts/report/html/app/viewer-controls.js +141 -0
  133. package/target/main/ts/report/html/app/viewer-copy.d.ts +17 -0
  134. package/target/main/ts/report/html/app/viewer-copy.js +64 -0
  135. package/target/main/ts/report/html/app/viewer-data.d.ts +1 -1
  136. package/target/main/ts/report/html/app/viewer-data.js +2 -29
  137. package/target/main/ts/report/html/app/viewer-diagnostics.d.ts +4 -0
  138. package/target/main/ts/report/html/app/viewer-diagnostics.js +60 -0
  139. package/target/main/ts/report/html/app/viewer-dom.d.ts +27 -0
  140. package/target/main/ts/report/html/app/viewer-dom.js +99 -0
  141. package/target/main/ts/report/html/app/viewer-file-aside.d.ts +19 -0
  142. package/target/main/ts/report/html/app/viewer-file-aside.js +124 -0
  143. package/target/main/ts/report/html/app/viewer-file-figures.d.ts +15 -0
  144. package/target/main/ts/report/html/app/viewer-file-figures.js +60 -0
  145. package/target/main/ts/report/html/app/viewer-file-source.d.ts +7 -0
  146. package/target/main/ts/report/html/app/viewer-file-source.js +119 -0
  147. package/target/main/ts/report/html/app/viewer-files.d.ts +2 -118
  148. package/target/main/ts/report/html/app/viewer-files.js +24 -2184
  149. package/target/main/ts/report/html/app/viewer-filter.d.ts +3 -51
  150. package/target/main/ts/report/html/app/viewer-filter.js +111 -450
  151. package/target/main/ts/report/html/app/viewer-hotspots.d.ts +4 -0
  152. package/target/main/ts/report/html/app/viewer-hotspots.js +131 -0
  153. package/target/main/ts/report/html/app/viewer-inspection.d.ts +69 -0
  154. package/target/main/ts/report/html/app/viewer-inspection.js +36 -0
  155. package/target/main/ts/report/html/app/viewer-issue-group.d.ts +27 -0
  156. package/target/main/ts/report/html/app/viewer-issue-group.js +174 -0
  157. package/target/main/ts/report/html/app/viewer-issues.d.ts +4 -0
  158. package/target/main/ts/report/html/app/viewer-issues.js +173 -0
  159. package/target/main/ts/report/html/app/viewer-language-bar.d.ts +9 -0
  160. package/target/main/ts/report/html/app/viewer-language-bar.js +72 -0
  161. package/target/main/ts/report/html/app/viewer-languages.d.ts +27 -0
  162. package/target/main/ts/report/html/app/viewer-languages.js +93 -0
  163. package/target/main/ts/report/html/app/viewer-layout.d.ts +14 -0
  164. package/target/main/ts/report/html/app/viewer-layout.js +134 -0
  165. package/target/main/ts/report/html/app/viewer-line-coverage.d.ts +47 -0
  166. package/target/main/ts/report/html/app/viewer-line-coverage.js +121 -0
  167. package/target/main/ts/report/html/app/viewer-locations.d.ts +16 -0
  168. package/target/main/ts/report/html/app/viewer-locations.js +31 -0
  169. package/target/main/ts/report/html/app/viewer-map-scale.d.ts +26 -0
  170. package/target/main/ts/report/html/app/viewer-map-scale.js +147 -0
  171. package/target/main/ts/report/html/app/viewer-map-shape.d.ts +42 -0
  172. package/target/main/ts/report/html/app/viewer-map-shape.js +102 -0
  173. package/target/main/ts/report/html/app/viewer-metric-format.d.ts +23 -0
  174. package/target/main/ts/report/html/app/viewer-metric-format.js +93 -0
  175. package/target/main/ts/report/html/app/viewer-metric-registry.d.ts +0 -20
  176. package/target/main/ts/report/html/app/viewer-metric-registry.js +7 -84
  177. package/target/main/ts/report/html/app/viewer-metrics-view.d.ts +4 -0
  178. package/target/main/ts/report/html/app/viewer-metrics-view.js +162 -0
  179. package/target/main/ts/report/html/app/viewer-metrics.d.ts +6 -1
  180. package/target/main/ts/report/html/app/viewer-metrics.js +53 -35
  181. package/target/main/ts/report/html/app/viewer-overview-cards.d.ts +12 -0
  182. package/target/main/ts/report/html/app/viewer-overview-cards.js +118 -0
  183. package/target/main/ts/report/html/app/viewer-overview-hotspots.d.ts +9 -0
  184. package/target/main/ts/report/html/app/viewer-overview-hotspots.js +173 -0
  185. package/target/main/ts/report/html/app/viewer-overview-lead.d.ts +12 -0
  186. package/target/main/ts/report/html/app/viewer-overview-lead.js +116 -0
  187. package/target/main/ts/report/html/app/viewer-profile-badges.d.ts +11 -0
  188. package/target/main/ts/report/html/app/viewer-profile-badges.js +119 -0
  189. package/target/main/ts/report/html/app/viewer-profile-table.d.ts +29 -0
  190. package/target/main/ts/report/html/app/viewer-profile-table.js +124 -0
  191. package/target/main/ts/report/html/app/viewer-profile.d.ts +2 -6
  192. package/target/main/ts/report/html/app/viewer-profile.js +6 -248
  193. package/target/main/ts/report/html/app/viewer-pull-sections.d.ts +4 -0
  194. package/target/main/ts/report/html/app/viewer-pull-sections.js +118 -0
  195. package/target/main/ts/report/html/app/viewer-pull-trend.d.ts +5 -0
  196. package/target/main/ts/report/html/app/viewer-pull-trend.js +63 -0
  197. package/target/main/ts/report/html/app/viewer-pulls.d.ts +0 -1
  198. package/target/main/ts/report/html/app/viewer-pulls.js +28 -178
  199. package/target/main/ts/report/html/app/viewer-query-field.d.ts +19 -0
  200. package/target/main/ts/report/html/app/viewer-query-field.js +203 -0
  201. package/target/main/ts/report/html/app/viewer-route.d.ts +34 -0
  202. package/target/main/ts/report/html/app/viewer-route.js +55 -0
  203. package/target/main/ts/report/html/app/viewer-shell.d.ts +20 -0
  204. package/target/main/ts/report/html/app/viewer-shell.js +116 -0
  205. package/target/main/ts/report/html/app/viewer-source-view.d.ts +49 -0
  206. package/target/main/ts/report/html/app/viewer-source-view.js +150 -0
  207. package/target/main/ts/report/html/app/viewer-source.d.ts +0 -84
  208. package/target/main/ts/report/html/app/viewer-source.js +7 -365
  209. package/target/main/ts/report/html/app/viewer-suggest.d.ts +13 -0
  210. package/target/main/ts/report/html/app/viewer-suggest.js +91 -0
  211. package/target/main/ts/report/html/app/viewer-sunburst.d.ts +5 -0
  212. package/target/main/ts/report/html/app/viewer-sunburst.js +40 -0
  213. package/target/main/ts/report/html/app/viewer-table-cells.d.ts +25 -0
  214. package/target/main/ts/report/html/app/viewer-table-cells.js +129 -0
  215. package/target/main/ts/report/html/app/viewer-table-rows.d.ts +54 -0
  216. package/target/main/ts/report/html/app/viewer-table-rows.js +95 -0
  217. package/target/main/ts/report/html/app/viewer-tokenizer.d.ts +16 -0
  218. package/target/main/ts/report/html/app/viewer-tokenizer.js +192 -0
  219. package/target/main/ts/report/html/app/viewer-totals.d.ts +14 -0
  220. package/target/main/ts/report/html/app/viewer-totals.js +89 -0
  221. package/target/main/ts/report/html/app/viewer-treemap.d.ts +24 -0
  222. package/target/main/ts/report/html/app/viewer-treemap.js +112 -0
  223. package/target/main/ts/report/html/app/viewer-trend-data.d.ts +54 -0
  224. package/target/main/ts/report/html/app/viewer-trend-data.js +109 -0
  225. package/target/main/ts/report/html/app/viewer-trend-nav.d.ts +5 -0
  226. package/target/main/ts/report/html/app/viewer-trend-nav.js +85 -0
  227. package/target/main/ts/report/html/app/viewer-trend-points.d.ts +30 -0
  228. package/target/main/ts/report/html/app/viewer-trend-points.js +128 -0
  229. package/target/main/ts/report/html/app/viewer-trend-series.d.ts +26 -0
  230. package/target/main/ts/report/html/app/viewer-trend-series.js +98 -0
  231. package/target/main/ts/report/html/app/viewer-trends.d.ts +2 -70
  232. package/target/main/ts/report/html/app/viewer-trends.js +41 -392
  233. package/target/main/ts/report/html/app/viewer.js +152 -663
  234. package/target/main/ts/report/html/site/export-site.d.ts +3 -4
  235. package/target/main/ts/report/html/site/export-site.js +24 -41
  236. package/target/main/ts/report/html/site/exported-server.js +2 -1
  237. package/target/main/ts/report/html/site/local-server.d.ts +1 -1
  238. package/target/main/ts/report/html/site/local-server.js +13 -19
  239. package/target/main/ts/report/html/site/projects.js +8 -17
  240. package/target/main/ts/report/json/projections/commit-summary.d.ts +2 -2
  241. package/target/main/ts/report/json/projections/commit-summary.js +18 -19
  242. package/target/main/ts/report/json/projections/file-metrics.js +31 -24
  243. package/target/main/ts/report/json/projections/inspection-context.js +10 -1
  244. package/target/main/ts/report/json/projections/inspection-details.d.ts +1 -1
  245. package/target/main/ts/report/json/projections/inspection-details.js +2 -2
  246. package/target/main/ts/report/json/projections/metric-values.d.ts +1 -0
  247. package/target/main/ts/report/json/projections/metric-values.js +15 -5
  248. package/target/main/ts/report/json/store/local-store.js +2 -12
  249. package/target/main/ts/report/json/store/operation-cache.d.ts +8 -0
  250. package/target/main/ts/report/json/store/operation-cache.js +32 -0
  251. package/target/main/ts/report/json/store/pull-review-store.js +1 -2
  252. package/target/main/ts/report/json/store/replace-file.d.ts +1 -0
  253. package/target/main/ts/report/json/store/replace-file.js +14 -0
  254. package/target/main/ts/report/json/validation/report.d.ts +1 -1
  255. package/target/main/ts/report/json/validation/report.js +10 -8
  256. package/target/main/ts/report/json/validation/summary-validation.js +1 -3
  257. package/target/main/ts/report/json/wire/file-metrics-model.d.ts +2 -0
  258. package/target/main/ts/report/json/wire/inspection-details-model.d.ts +0 -5
  259. package/target/main/ts/report/json/wire/public-history-model.d.ts +0 -6
  260. package/target/main/ts/report/json/wire/public-history-model.js +0 -1
  261. package/target/main/ts/report.d.ts +3 -3
  262. package/target/main/ts/report.js +2 -2
  263. package/target/main/resources/report/json/inspection-context-v1.schema.json +0 -172
  264. package/target/main/resources/report/json/public-history-v1.schema.json +0 -50
  265. package/target/main/resources/report/json/quality-history-v1.schema.json +0 -51
  266. package/target/main/resources/report/json/report-v1.schema.json +0 -65
  267. package/target/main/resources/report/json/viewer-details-v1.schema.json +0 -346
  268. package/target/main/ts/report/json/projections/public-history.d.ts +0 -4
  269. package/target/main/ts/report/json/projections/public-history.js +0 -17
@@ -2,12 +2,524 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "urn:repometry:schema:viewer-inspection:1",
4
4
  "type": "object",
5
- "required": ["schema", "sha", "inspection"],
5
+ "required": [
6
+ "schema",
7
+ "sha",
8
+ "inspection"
9
+ ],
6
10
  "properties": {
7
- "schema": { "const": "urn:repometry:schema:viewer-inspection:1" },
8
- "sha": { "type": "string", "pattern": "^(?:[a-f0-9]{40}|[a-f0-9]{64})$" },
9
- "context": { "$ref": "urn:repometry:schema:inspection-context:1#/$defs/inspectionContext" },
10
- "inspection": { "$ref": "urn:repometry:schema:viewer-details:1#/$defs/inspection" }
11
+ "schema": {
12
+ "const": "urn:repometry:schema:viewer-inspection:1"
13
+ },
14
+ "sha": {
15
+ "type": "string",
16
+ "pattern": "^(?:[a-f0-9]{40}|[a-f0-9]{64})$"
17
+ },
18
+ "context": {
19
+ "$ref": "#/$defs/inspectionContext"
20
+ },
21
+ "inspection": {
22
+ "$ref": "#/$defs/inspection"
23
+ }
11
24
  },
12
- "additionalProperties": false
25
+ "additionalProperties": false,
26
+ "$defs": {
27
+ "inspection": {
28
+ "type": "object",
29
+ "required": [
30
+ "metrics",
31
+ "functions",
32
+ "diagnostics"
33
+ ],
34
+ "properties": {
35
+ "metrics": {
36
+ "$ref": "urn:repometry:schema:file-metrics:1"
37
+ },
38
+ "functions": {
39
+ "type": "array",
40
+ "items": {
41
+ "$ref": "#/$defs/function"
42
+ }
43
+ },
44
+ "diagnostics": {
45
+ "$ref": "urn:repometry:schema:report:2#/properties/diagnostics"
46
+ },
47
+ "findings": {
48
+ "$ref": "urn:repometry:schema:report:2#/properties/findings"
49
+ },
50
+ "lineCoverage": {
51
+ "$ref": "urn:repometry:schema:report:2#/$defs/lcovLines"
52
+ },
53
+ "components": {
54
+ "type": "array",
55
+ "items": {
56
+ "type": "object",
57
+ "required": [
58
+ "component",
59
+ "paths"
60
+ ],
61
+ "additionalProperties": false,
62
+ "properties": {
63
+ "component": {
64
+ "type": "object",
65
+ "required": [
66
+ "name",
67
+ "pathGlobs"
68
+ ],
69
+ "additionalProperties": false,
70
+ "properties": {
71
+ "name": {
72
+ "type": "string",
73
+ "minLength": 1,
74
+ "maxLength": 100
75
+ },
76
+ "description": {
77
+ "type": "string"
78
+ },
79
+ "pathGlobs": {
80
+ "type": "array",
81
+ "minItems": 1,
82
+ "items": {
83
+ "type": "string"
84
+ }
85
+ }
86
+ }
87
+ },
88
+ "paths": {
89
+ "type": "array",
90
+ "items": {
91
+ "type": "string"
92
+ }
93
+ }
94
+ }
95
+ }
96
+ },
97
+ "profile": {
98
+ "$ref": "#/$defs/profile"
99
+ },
100
+ "bands": {
101
+ "type": "object",
102
+ "additionalProperties": false,
103
+ "properties": {
104
+ "complexity": {
105
+ "type": "array",
106
+ "items": {
107
+ "type": "number"
108
+ }
109
+ },
110
+ "missedLines": {
111
+ "type": "array",
112
+ "items": {
113
+ "type": "number"
114
+ }
115
+ },
116
+ "duplication": {
117
+ "type": "array",
118
+ "items": {
119
+ "type": "number"
120
+ }
121
+ }
122
+ }
123
+ }
124
+ },
125
+ "additionalProperties": false
126
+ },
127
+ "profile": {
128
+ "type": "object",
129
+ "additionalProperties": false,
130
+ "required": [
131
+ "id",
132
+ "extensions",
133
+ "excludedPaths",
134
+ "excludedDirectories",
135
+ "rules",
136
+ "duplication",
137
+ "debtModel",
138
+ "churn",
139
+ "ignore",
140
+ "analyzers"
141
+ ],
142
+ "properties": {
143
+ "id": {
144
+ "type": [
145
+ "string",
146
+ "null"
147
+ ]
148
+ },
149
+ "extensions": {
150
+ "type": "array",
151
+ "items": {
152
+ "type": "string"
153
+ }
154
+ },
155
+ "excludedPaths": {
156
+ "type": "array",
157
+ "items": {
158
+ "type": "string"
159
+ }
160
+ },
161
+ "excludedDirectories": {
162
+ "type": "array",
163
+ "items": {
164
+ "type": "string"
165
+ }
166
+ },
167
+ "ruleCatalog": {
168
+ "type": "array",
169
+ "items": {
170
+ "type": "object",
171
+ "required": [
172
+ "source",
173
+ "kind",
174
+ "rule",
175
+ "category"
176
+ ],
177
+ "properties": {
178
+ "source": {
179
+ "type": "string"
180
+ },
181
+ "kind": {
182
+ "enum": [
183
+ "check",
184
+ "scanner"
185
+ ]
186
+ },
187
+ "rule": {
188
+ "type": "string"
189
+ },
190
+ "title": {
191
+ "type": "string"
192
+ },
193
+ "category": {
194
+ "type": "string"
195
+ },
196
+ "limit": {
197
+ "type": "number"
198
+ },
199
+ "minutesPerExcess": {
200
+ "type": "number"
201
+ },
202
+ "level": {
203
+ "type": "string"
204
+ },
205
+ "help": {
206
+ "type": "string"
207
+ }
208
+ },
209
+ "additionalProperties": false
210
+ }
211
+ },
212
+ "rules": {
213
+ "type": "array",
214
+ "items": {
215
+ "type": "object",
216
+ "additionalProperties": false,
217
+ "required": [
218
+ "plugin",
219
+ "rule",
220
+ "limit",
221
+ "minutesPerExcess"
222
+ ],
223
+ "properties": {
224
+ "rule": {
225
+ "type": "string"
226
+ },
227
+ "limit": {
228
+ "type": "number"
229
+ },
230
+ "minutesPerExcess": {
231
+ "type": "number"
232
+ },
233
+ "plugin": {
234
+ "type": "string"
235
+ }
236
+ }
237
+ }
238
+ },
239
+ "duplication": {
240
+ "oneOf": [
241
+ {
242
+ "type": "null"
243
+ },
244
+ {
245
+ "type": "object",
246
+ "additionalProperties": false,
247
+ "required": [
248
+ "minCodeLines",
249
+ "minNodes",
250
+ "minutesPerRepeatedLine"
251
+ ],
252
+ "properties": {
253
+ "minCodeLines": {
254
+ "type": "number"
255
+ },
256
+ "minNodes": {
257
+ "type": "number"
258
+ },
259
+ "minutesPerRepeatedLine": {
260
+ "type": "number"
261
+ }
262
+ }
263
+ }
264
+ ]
265
+ },
266
+ "debtModel": {
267
+ "oneOf": [
268
+ {
269
+ "type": "null"
270
+ },
271
+ {
272
+ "type": "object",
273
+ "additionalProperties": false,
274
+ "required": [
275
+ "name",
276
+ "scale",
277
+ "exponent",
278
+ "minutesPerPersonMonth"
279
+ ],
280
+ "properties": {
281
+ "name": {
282
+ "type": "string"
283
+ },
284
+ "scale": {
285
+ "type": "number"
286
+ },
287
+ "exponent": {
288
+ "type": "number"
289
+ },
290
+ "minutesPerPersonMonth": {
291
+ "type": "number"
292
+ }
293
+ }
294
+ }
295
+ ]
296
+ },
297
+ "churn": {
298
+ "oneOf": [
299
+ {
300
+ "type": "null"
301
+ },
302
+ {
303
+ "type": "object",
304
+ "additionalProperties": false,
305
+ "required": [
306
+ "lookbackDays",
307
+ "maxCommits"
308
+ ],
309
+ "properties": {
310
+ "lookbackDays": {
311
+ "type": "number"
312
+ },
313
+ "maxCommits": {
314
+ "type": "number"
315
+ }
316
+ }
317
+ }
318
+ ]
319
+ },
320
+ "ignore": {
321
+ "type": "array",
322
+ "items": {
323
+ "type": "object",
324
+ "additionalProperties": false,
325
+ "properties": {
326
+ "tool": {
327
+ "type": "string"
328
+ },
329
+ "rule": {
330
+ "type": "string"
331
+ },
332
+ "path": {
333
+ "type": "string"
334
+ },
335
+ "reason": {
336
+ "type": "string"
337
+ }
338
+ }
339
+ }
340
+ },
341
+ "analyzers": {
342
+ "type": "array",
343
+ "items": {
344
+ "type": "object",
345
+ "additionalProperties": false,
346
+ "required": [
347
+ "id",
348
+ "version",
349
+ "tools"
350
+ ],
351
+ "properties": {
352
+ "id": {
353
+ "type": "string"
354
+ },
355
+ "version": {
356
+ "type": "string"
357
+ },
358
+ "tools": {
359
+ "type": "object",
360
+ "additionalProperties": {
361
+ "type": "string"
362
+ }
363
+ }
364
+ }
365
+ }
366
+ }
367
+ }
368
+ },
369
+ "function": {
370
+ "type": "object",
371
+ "required": [
372
+ "name",
373
+ "path",
374
+ "line",
375
+ "complexity"
376
+ ],
377
+ "properties": {
378
+ "name": {
379
+ "type": "string"
380
+ },
381
+ "path": {
382
+ "type": "string"
383
+ },
384
+ "line": {
385
+ "type": [
386
+ "integer",
387
+ "null"
388
+ ],
389
+ "minimum": 1
390
+ },
391
+ "complexity": {
392
+ "type": "number"
393
+ }
394
+ },
395
+ "additionalProperties": false
396
+ },
397
+ "inspectionContext": {
398
+ "type": "object",
399
+ "required": [
400
+ "exclusions",
401
+ "boundary"
402
+ ],
403
+ "properties": {
404
+ "exclusions": {
405
+ "type": [
406
+ "object",
407
+ "null"
408
+ ],
409
+ "required": [
410
+ "paths",
411
+ "directories"
412
+ ],
413
+ "properties": {
414
+ "paths": {
415
+ "type": "array",
416
+ "items": {
417
+ "type": "string"
418
+ }
419
+ },
420
+ "directories": {
421
+ "type": "array",
422
+ "items": {
423
+ "type": "string"
424
+ }
425
+ }
426
+ },
427
+ "additionalProperties": false
428
+ },
429
+ "boundary": {
430
+ "enum": [
431
+ null,
432
+ "changed",
433
+ "unavailable"
434
+ ]
435
+ },
436
+ "scanners": {
437
+ "type": "array",
438
+ "items": {
439
+ "type": "object",
440
+ "required": [
441
+ "name",
442
+ "version"
443
+ ],
444
+ "properties": {
445
+ "name": {
446
+ "type": "string"
447
+ },
448
+ "version": {
449
+ "type": [
450
+ "string",
451
+ "null"
452
+ ]
453
+ }
454
+ },
455
+ "additionalProperties": false
456
+ }
457
+ },
458
+ "ignores": {
459
+ "type": "object",
460
+ "required": [
461
+ "rules",
462
+ "count"
463
+ ],
464
+ "properties": {
465
+ "count": {
466
+ "type": "integer",
467
+ "minimum": 0
468
+ },
469
+ "rules": {
470
+ "type": "array",
471
+ "items": {
472
+ "type": "object",
473
+ "properties": {
474
+ "tool": {
475
+ "type": "string"
476
+ },
477
+ "rule": {
478
+ "type": "string"
479
+ },
480
+ "path": {
481
+ "type": "string"
482
+ },
483
+ "reason": {
484
+ "type": "string"
485
+ }
486
+ },
487
+ "additionalProperties": false
488
+ }
489
+ }
490
+ },
491
+ "additionalProperties": false
492
+ },
493
+ "security": {
494
+ "type": "object",
495
+ "required": [
496
+ "low",
497
+ "medium",
498
+ "high",
499
+ "unknown"
500
+ ],
501
+ "properties": {
502
+ "low": {
503
+ "type": "integer",
504
+ "minimum": 0
505
+ },
506
+ "medium": {
507
+ "type": "integer",
508
+ "minimum": 0
509
+ },
510
+ "high": {
511
+ "type": "integer",
512
+ "minimum": 0
513
+ },
514
+ "unknown": {
515
+ "type": "integer",
516
+ "minimum": 0
517
+ }
518
+ },
519
+ "additionalProperties": false
520
+ }
521
+ },
522
+ "additionalProperties": false
523
+ }
524
+ }
13
525
  }
@@ -286,6 +286,11 @@ main:focus { outline: none; }
286
286
  .ring svg { width: 2.5rem; height: 2.5rem; }
287
287
  .ring-track { fill: none; stroke: var(--rule); stroke-width: 4.5; }
288
288
  .ring-arc { fill: none; stroke: var(--grade-a); stroke-width: 4.5; stroke-linecap: butt; transform: rotate(-90deg); transform-origin: 20px 20px; }
289
+ /* The ring takes the coverage grade's colour, as the coverage badge does. */
290
+ .ring[data-grade="B"] .ring-arc { stroke: var(--grade-b); }
291
+ .ring[data-grade="C"] .ring-arc { stroke: var(--grade-c); }
292
+ .ring[data-grade="D"] .ring-arc { stroke: var(--grade-d); }
293
+ .ring[data-grade="F"] .ring-arc { stroke: var(--grade-f); }
289
294
  .ring-label { fill: var(--ink); font-size: 12.5px; font-weight: 650; text-anchor: middle; }
290
295
  .severity { background: var(--grade-a); font-size: 1.125rem; }
291
296
  .severity[data-severity="none"] { background: var(--grade-none); }
@@ -417,9 +422,9 @@ a.tc-tip-entry:hover { background: var(--surface-2); }
417
422
  /* Trends page */
418
423
  .trend-nav { display: grid; gap: 1.125rem; }
419
424
  .trend-group h3 { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 1.5rem; margin: 0 0 .3rem; padding: 0 .5rem 0 .75rem; color: var(--muted); font-size: .75rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
420
- /* A group's reading: the grade or the coverage in its colour when it earns one, the size plain. */
425
+ /* A group's reading: the maintainability grade, or the coverage in its grade's colour, as the badges show them. */
421
426
  .trend-reading { flex: none; min-width: 1.25rem; padding: 0 .4rem; border-radius: 999px; background: var(--rule); color: var(--secondary); font-size: .75rem; font-weight: 600; letter-spacing: 0; line-height: 1.25rem; text-align: center; text-transform: none; font-variant-numeric: tabular-nums; }
422
- .trend-reading-grade, .trend-reading-good { color: #fff; background: var(--grade-a); }
427
+ .trend-reading-grade { color: #fff; background: var(--grade-a); }
423
428
  .trend-reading-grade[data-grade="B"] { background: var(--grade-b); }
424
429
  .trend-reading-grade[data-grade="C"] { background: var(--grade-c); }
425
430
  .trend-reading-grade[data-grade="D"] { background: var(--grade-d); }
@@ -8,7 +8,7 @@ export declare const diffMethod: {
8
8
  readonly renameLimit: 1000;
9
9
  };
10
10
  export declare function findMergeBase(repository: string, base: string, head: string): Promise<string>;
11
- export declare function readChanges(repository: string, base: string, head: SourceSnapshot, excludes: (path: string) => boolean): Promise<GitChanges>;
11
+ export declare function readChanges(repository: string, base: string, head: SourceSnapshot, excludes: (path: string) => boolean, isSource: (path: string) => boolean): Promise<GitChanges>;
12
12
  interface RawChange {
13
13
  readonly path: string;
14
14
  readonly mode: string;
@@ -1,5 +1,5 @@
1
1
  import { gitText, gitUtf8 } from './git.js';
2
- import { isSourcePath, physicalLines, utf8 } from '../../core/model/snapshot.js';
2
+ import { physicalLines, utf8 } from '../../core/model/snapshot.js';
3
3
  const oid = /^(?:[a-f0-9]{40}|[a-f0-9]{64})$/;
4
4
  const regularFile = /^100(?:644|755)$/;
5
5
  export const diffMethod = { algorithm: 'myers', indentHeuristic: false, renameThresholdPercent: 50, renameLimit: 1000 };
@@ -23,7 +23,7 @@ export async function findMergeBase(repository, base, head) {
23
23
  throw new Error('The selected commits need one unambiguous merge base');
24
24
  return first;
25
25
  }
26
- export async function readChanges(repository, base, head, excludes) {
26
+ export async function readChanges(repository, base, head, excludes, isSource) {
27
27
  if (!oid.test(base) || head.subject.kind !== 'commit' || !oid.test(head.subject.id))
28
28
  throw new Error('Git diff requires full commit IDs');
29
29
  const files = new Map();
@@ -37,7 +37,7 @@ export async function readChanges(repository, base, head, excludes) {
37
37
  const bytes = contents.get(change.path);
38
38
  if (!bytes || !regularFile.test(change.mode))
39
39
  continue;
40
- const before = change.previous && isSourcePath(change.previous.path) && !excludes(change.previous.path)
40
+ const before = change.previous && isSource(change.previous.path) && !excludes(change.previous.path)
41
41
  ? change.previous.oid : undefined;
42
42
  if (before === change.oid)
43
43
  continue;
@@ -5,11 +5,13 @@ export function commitMetadataReader(repository) {
5
5
  for (let start = 0; start < revisions.length; start += 128) {
6
6
  const batch = revisions.slice(start, start + 128);
7
7
  const log = await gitText(repository, ['log', '--ignore-missing', '--no-walk=unsorted', '-z', '--no-show-signature',
8
- '--format=%H%x00%an%x00%ae%x00%B', ...batch, '--']);
8
+ '--format=%H%x00%cI%x00%an%x00%ae%x00%B', ...batch, '--']);
9
9
  const fields = log.split('\0');
10
- for (let index = 0; index + 3 < fields.length; index += 4) {
11
- const [sha, name, email, message] = fields.slice(index, index + 4);
12
- result.set(sha, { subject: message.split(/\r?\n/, 1)[0], author: { name, email } });
10
+ for (let index = 0; index + 4 < fields.length; index += 5) {
11
+ const [sha, date, name, email, message] = fields.slice(index, index + 5);
12
+ const time = Date.parse(date);
13
+ result.set(sha, { ...(Number.isFinite(time) ? { committedAt: new Date(time).toISOString() } : {}),
14
+ subject: message.split(/\r?\n/, 1)[0], author: { name, email } });
13
15
  }
14
16
  }
15
17
  const requested = new Set(revisions);
@@ -3,6 +3,7 @@ export declare function gitRoot(directory: string): Promise<string>;
3
3
  export declare function physicalGitRoot(directory: string): Promise<string>;
4
4
  export declare function gitText(directory: string, args: readonly string[], timeout?: number): Promise<string>;
5
5
  export declare function gitUtf8(directory: string, args: readonly string[], timeout?: number): Promise<string>;
6
+ export declare function gitWorkingTreePaths(directory: string): Promise<readonly string[] | undefined>;
6
7
  export declare function resolveGitCommit(directory: string, revision: string): Promise<string>;
7
8
  /** Commits on the first-parent line of `head` after `base`, oldest first. */
8
9
  export declare function firstParentRange(directory: string, base: string, head: string): Promise<{
@@ -17,5 +18,5 @@ interface GitFile {
17
18
  }
18
19
  export declare function gitTreeFiles(directory: string, commit: string, prefix?: string, includeSize?: boolean): Promise<readonly GitFile[]>;
19
20
  export declare function gitBlobText(directory: string, oid: string): Promise<string>;
20
- export declare function readGitCommit(directory: string, revision: string, excludes: (path: string) => boolean, claims?: (path: string) => boolean): Promise<SourceSnapshot>;
21
+ export declare function readGitCommit(directory: string, revision: string, excludes: (path: string) => boolean, isSource: (path: string) => boolean, claims?: (path: string) => boolean): Promise<SourceSnapshot>;
21
22
  export {};
@@ -1,7 +1,7 @@
1
1
  import { realpath } from 'node:fs/promises';
2
2
  import { execFile, spawnSync } from 'node:child_process';
3
3
  import { promisify } from 'node:util';
4
- import { comparePaths, isExcludedDirectory, isSourcePath, textLineCount, utf8 } from '../../core/model/snapshot.js';
4
+ import { comparePaths, isExcludedDirectory, textLineCount, utf8 } from '../../core/model/snapshot.js';
5
5
  import { isClaimedText, maxClaimedFileBytes } from '../../core/model/source.js';
6
6
  import { isGeneratedSource } from '../../core/profile/exclusions.js';
7
7
  const git = promisify(execFile);
@@ -29,6 +29,18 @@ export async function gitUtf8(directory, args, timeout) {
29
29
  const result = await git('git', ['--no-replace-objects', ...args], { cwd: directory, env, encoding: 'buffer', maxBuffer, timeout });
30
30
  return utf8(result.stdout);
31
31
  }
32
+ export async function gitWorkingTreePaths(directory) {
33
+ try {
34
+ const { stdout } = await git('git', ['--no-replace-objects', 'ls-files', '--cached', '--others', '--exclude-standard', '-z', '--', '.'], { cwd: directory, env: { ...env, LC_ALL: 'C' }, encoding: 'buffer', maxBuffer });
35
+ return [...new Set(utf8(stdout).split('\0').filter(Boolean))];
36
+ }
37
+ catch (error) {
38
+ if (error instanceof Error && ('code' in error && error.code === 'ENOENT'
39
+ || 'stderr' in error && /fatal: not a git repository\b/.test(String(error.stderr))))
40
+ return undefined;
41
+ throw error;
42
+ }
43
+ }
32
44
  export async function resolveGitCommit(directory, revision) {
33
45
  let output;
34
46
  try {
@@ -83,10 +95,10 @@ export async function gitBlobText(directory, oid) {
83
95
  const result = await git('git', ['--no-replace-objects', 'cat-file', 'blob', oid], { cwd: directory, env, encoding: 'buffer', maxBuffer });
84
96
  return utf8(result.stdout);
85
97
  }
86
- export async function readGitCommit(directory, revision, excludes, claims) {
98
+ export async function readGitCommit(directory, revision, excludes, isSource, claims) {
87
99
  const id = await resolveGitCommit(directory, revision);
88
100
  const tracked = (await gitTreeFiles(directory, id, undefined, true)).filter(({ path }) => !path.split('/').slice(0, -1).some(isExcludedDirectory) && !excludes(path));
89
- const entries = tracked.filter(entry => isSourcePath(entry.path));
101
+ const entries = tracked.filter(entry => isSource(entry.path));
90
102
  const blobs = readBlobs(directory, [...new Set(entries.map(entry => entry.oid))]);
91
103
  const generated = new Set();
92
104
  const files = entries.flatMap(({ path, oid }) => {
@@ -98,7 +110,7 @@ export async function readGitCommit(directory, revision, excludes, claims) {
98
110
  generated.add(path);
99
111
  return [];
100
112
  });
101
- const claimed = tracked.filter(({ path }) => !isSourcePath(path) && claims?.(path));
113
+ const claimed = tracked.filter(({ path }) => !isSource(path) && claims?.(path));
102
114
  const oversized = new Set(claimed.filter(({ size }) => size !== undefined && size > maxClaimedFileBytes).map(({ path }) => path));
103
115
  const requested = new Set(claimed.filter(({ path }) => !oversized.has(path)).map(({ oid }) => oid));
104
116
  const claimedBlobs = new Map();
@@ -7,7 +7,7 @@ export interface SourceSelection {
7
7
  readonly revision: string;
8
8
  };
9
9
  }
10
- export declare function readInspectionSource(request: SourceSelection, excludes: (path: string) => boolean, claims?: (path: string) => boolean): Promise<{
10
+ export declare function readInspectionSource(request: SourceSelection, excludes: (path: string) => boolean, isSource: (path: string) => boolean, claims?: (path: string) => boolean): Promise<{
11
11
  root: string;
12
12
  snapshot: import("../../plugin.js").SourceSnapshot;
13
13
  excludedOutput: string | null;