@repometry/cli 0.0.0-stage → 0.0.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 (415) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +70 -2
  3. package/package.json +75 -4
  4. package/target/main/resources/language-catalog.json +61 -0
  5. package/target/main/resources/report/json/compact-json-v1.schema.json +24 -0
  6. package/target/main/resources/report/json/comparison-v1.schema.json +65 -0
  7. package/target/main/resources/report/json/config-v2.schema.json +224 -0
  8. package/target/main/resources/report/json/diff-coverage-v1.schema.json +55 -0
  9. package/target/main/resources/report/json/file-metrics-v1.schema.json +157 -0
  10. package/target/main/resources/report/json/metabranch-v1.schema.json +9 -0
  11. package/target/main/resources/report/json/metric-catalog-v1.schema.json +31 -0
  12. package/target/main/resources/report/json/pull-review-v1.schema.json +97 -0
  13. package/target/main/resources/report/json/pull-review-v2.schema.json +100 -0
  14. package/target/main/resources/report/json/report-v2.schema.json +530 -0
  15. package/target/main/resources/report/json/repository-summary-v1.schema.json +337 -0
  16. package/target/main/resources/report/json/viewer-inspection-v1.schema.json +534 -0
  17. package/target/main/resources/viewer/files.css +616 -0
  18. package/target/main/resources/viewer/index.html +120 -0
  19. package/target/main/resources/viewer/projects.html +52 -0
  20. package/target/main/resources/viewer/styles.css +579 -0
  21. package/target/main/resources/viewer/viewer-pulls.css +64 -0
  22. package/target/main/ts/api/cache/root.d.ts +2 -0
  23. package/target/main/ts/api/cache/root.js +21 -0
  24. package/target/main/ts/api/gh/github.d.ts +4 -0
  25. package/target/main/ts/api/gh/github.js +47 -0
  26. package/target/main/ts/api/git/blob-batch.d.ts +10 -0
  27. package/target/main/ts/api/git/blob-batch.js +107 -0
  28. package/target/main/ts/api/git/blob-history.d.ts +20 -0
  29. package/target/main/ts/api/git/blob-history.js +54 -0
  30. package/target/main/ts/api/git/changes.d.ts +27 -0
  31. package/target/main/ts/api/git/changes.js +117 -0
  32. package/target/main/ts/api/git/commit-metadata.d.ts +2 -0
  33. package/target/main/ts/api/git/commit-metadata.js +46 -0
  34. package/target/main/ts/api/git/git-churn.d.ts +9 -0
  35. package/target/main/ts/api/git/git-churn.js +72 -0
  36. package/target/main/ts/api/git/git-executable.d.ts +1 -0
  37. package/target/main/ts/api/git/git-executable.js +31 -0
  38. package/target/main/ts/api/git/git-reader.d.ts +24 -0
  39. package/target/main/ts/api/git/git-reader.js +113 -0
  40. package/target/main/ts/api/git/git.d.ts +47 -0
  41. package/target/main/ts/api/git/git.js +289 -0
  42. package/target/main/ts/api/git/inspection-source.d.ts +17 -0
  43. package/target/main/ts/api/git/inspection-source.js +36 -0
  44. package/target/main/ts/api/git/line-changes.d.ts +6 -0
  45. package/target/main/ts/api/git/line-changes.js +57 -0
  46. package/target/main/ts/api/git/local-sources.d.ts +5 -0
  47. package/target/main/ts/api/git/local-sources.js +48 -0
  48. package/target/main/ts/api/git/local.d.ts +7 -0
  49. package/target/main/ts/api/git/local.js +106 -0
  50. package/target/main/ts/api/git/source-cache.d.ts +1 -0
  51. package/target/main/ts/api/git/source-cache.js +42 -0
  52. package/target/main/ts/api/import/cobertura.d.ts +2 -0
  53. package/target/main/ts/api/import/cobertura.js +160 -0
  54. package/target/main/ts/api/import/coverage-xml.d.ts +7 -0
  55. package/target/main/ts/api/import/coverage-xml.js +135 -0
  56. package/target/main/ts/api/import/finding-import.d.ts +9 -0
  57. package/target/main/ts/api/import/finding-import.js +227 -0
  58. package/target/main/ts/api/import/go-cover.d.ts +13 -0
  59. package/target/main/ts/api/import/go-cover.js +150 -0
  60. package/target/main/ts/api/import/lcov-files.d.ts +12 -0
  61. package/target/main/ts/api/import/lcov-files.js +53 -0
  62. package/target/main/ts/api/import/profile-file.d.ts +4 -0
  63. package/target/main/ts/api/import/profile-file.js +17 -0
  64. package/target/main/ts/api/process/docker-tool-runner.d.ts +13 -0
  65. package/target/main/ts/api/process/docker-tool-runner.js +92 -0
  66. package/target/main/ts/api/process/failure.d.ts +1 -0
  67. package/target/main/ts/api/process/failure.js +12 -0
  68. package/target/main/ts/api/process/plugin.d.ts +13 -0
  69. package/target/main/ts/api/process/plugin.js +100 -0
  70. package/target/main/ts/api/process/tool-snapshot.d.ts +3 -0
  71. package/target/main/ts/api/process/tool-snapshot.js +26 -0
  72. package/target/main/ts/cli/arguments.d.ts +28 -0
  73. package/target/main/ts/cli/arguments.js +109 -0
  74. package/target/main/ts/cli/config.d.ts +63 -0
  75. package/target/main/ts/cli/config.js +165 -0
  76. package/target/main/ts/cli/imports.d.ts +9 -0
  77. package/target/main/ts/cli/imports.js +37 -0
  78. package/target/main/ts/cli/main.d.ts +2 -0
  79. package/target/main/ts/cli/main.js +4 -0
  80. package/target/main/ts/cli/range-inspection.d.ts +38 -0
  81. package/target/main/ts/cli/range-inspection.js +34 -0
  82. package/target/main/ts/cli/range-jobs.d.ts +23 -0
  83. package/target/main/ts/cli/range-jobs.js +152 -0
  84. package/target/main/ts/cli/range-worker.d.ts +1 -0
  85. package/target/main/ts/cli/range-worker.js +40 -0
  86. package/target/main/ts/cli/reporting.d.ts +42 -0
  87. package/target/main/ts/cli/reporting.js +98 -0
  88. package/target/main/ts/cli/revisions.d.ts +6 -0
  89. package/target/main/ts/cli/revisions.js +16 -0
  90. package/target/main/ts/cli/run.d.ts +2 -0
  91. package/target/main/ts/cli/run.js +306 -0
  92. package/target/main/ts/cli/store.d.ts +13 -0
  93. package/target/main/ts/cli/store.js +39 -0
  94. package/target/main/ts/compose/analysis-report.d.ts +6 -0
  95. package/target/main/ts/compose/analysis-report.js +131 -0
  96. package/target/main/ts/compose/analysis-results.d.ts +42 -0
  97. package/target/main/ts/compose/analysis-results.js +84 -0
  98. package/target/main/ts/compose/analysis-steps.d.ts +23 -0
  99. package/target/main/ts/compose/analysis-steps.js +217 -0
  100. package/target/main/ts/compose/analyze-snapshot.d.ts +7 -0
  101. package/target/main/ts/compose/analyze-snapshot.js +21 -0
  102. package/target/main/ts/compose/attach-churn.d.ts +2 -0
  103. package/target/main/ts/compose/attach-churn.js +50 -0
  104. package/target/main/ts/compose/built-ins.d.ts +6 -0
  105. package/target/main/ts/compose/built-ins.js +12 -0
  106. package/target/main/ts/compose/diff-coverage.d.ts +25 -0
  107. package/target/main/ts/compose/diff-coverage.js +82 -0
  108. package/target/main/ts/compose/distribution.d.ts +17 -0
  109. package/target/main/ts/compose/distribution.js +13 -0
  110. package/target/main/ts/compose/docker-image.d.ts +5 -0
  111. package/target/main/ts/compose/docker-image.js +49 -0
  112. package/target/main/ts/compose/file-selection.d.ts +9 -0
  113. package/target/main/ts/compose/file-selection.js +38 -0
  114. package/target/main/ts/compose/history-cache.d.ts +31 -0
  115. package/target/main/ts/compose/history-cache.js +62 -0
  116. package/target/main/ts/compose/inspect.d.ts +34 -0
  117. package/target/main/ts/compose/inspect.js +51 -0
  118. package/target/main/ts/compose/inspection-coverage.d.ts +9 -0
  119. package/target/main/ts/compose/inspection-coverage.js +9 -0
  120. package/target/main/ts/compose/js-plugin.d.ts +113 -0
  121. package/target/main/ts/compose/js-plugin.js +99 -0
  122. package/target/main/ts/compose/language-discovery.d.ts +12 -0
  123. package/target/main/ts/compose/language-discovery.js +51 -0
  124. package/target/main/ts/compose/languages.d.ts +64 -0
  125. package/target/main/ts/compose/languages.js +98 -0
  126. package/target/main/ts/compose/load-plugins.d.ts +6 -0
  127. package/target/main/ts/compose/load-plugins.js +71 -0
  128. package/target/main/ts/compose/parser-order.d.ts +20 -0
  129. package/target/main/ts/compose/parser-order.js +90 -0
  130. package/target/main/ts/compose/phases.d.ts +140 -0
  131. package/target/main/ts/compose/phases.js +147 -0
  132. package/target/main/ts/compose/plugin-list.d.ts +37 -0
  133. package/target/main/ts/compose/plugin-list.js +30 -0
  134. package/target/main/ts/compose/plugin-manifest.d.ts +14 -0
  135. package/target/main/ts/compose/plugin-manifest.js +50 -0
  136. package/target/main/ts/compose/plugin-options.d.ts +2 -0
  137. package/target/main/ts/compose/plugin-options.js +29 -0
  138. package/target/main/ts/compose/plugin-reference.d.ts +9 -0
  139. package/target/main/ts/compose/plugin-reference.js +40 -0
  140. package/target/main/ts/compose/plugin-requirements.d.ts +5 -0
  141. package/target/main/ts/compose/plugin-requirements.js +83 -0
  142. package/target/main/ts/compose/plugin-scope.d.ts +9 -0
  143. package/target/main/ts/compose/plugin-scope.js +60 -0
  144. package/target/main/ts/compose/process-plugins.d.ts +89 -0
  145. package/target/main/ts/compose/process-plugins.js +74 -0
  146. package/target/main/ts/compose/registered-plugin.d.ts +17 -0
  147. package/target/main/ts/compose/registered-plugin.js +8 -0
  148. package/target/main/ts/compose/review.d.ts +26 -0
  149. package/target/main/ts/compose/review.js +54 -0
  150. package/target/main/ts/compose/schema-error.d.ts +2 -0
  151. package/target/main/ts/compose/schema-error.js +16 -0
  152. package/target/main/ts/compose/sources.d.ts +2 -0
  153. package/target/main/ts/compose/sources.js +32 -0
  154. package/target/main/ts/compose/structure-measures.d.ts +9 -0
  155. package/target/main/ts/compose/structure-measures.js +63 -0
  156. package/target/main/ts/index.d.ts +8 -0
  157. package/target/main/ts/index.js +5 -0
  158. package/target/main/ts/plugin.d.ts +2 -0
  159. package/target/main/ts/plugin.js +2 -0
  160. package/target/main/ts/plugins/built-in.d.ts +3 -0
  161. package/target/main/ts/plugins/built-in.js +19 -0
  162. package/target/main/ts/plugins/coverage/coverage.d.ts +11 -0
  163. package/target/main/ts/plugins/coverage/coverage.js +289 -0
  164. package/target/main/ts/plugins/coverage/diff-coverage.d.ts +3 -0
  165. package/target/main/ts/plugins/coverage/diff-coverage.js +85 -0
  166. package/target/main/ts/plugins/duplication/duplication.d.ts +2 -0
  167. package/target/main/ts/plugins/duplication/duplication.js +95 -0
  168. package/target/main/ts/plugins/language-js/babel-provider.d.ts +10 -0
  169. package/target/main/ts/plugins/language-js/babel-provider.js +54 -0
  170. package/target/main/ts/plugins/language-js/clone-candidates.d.ts +3 -0
  171. package/target/main/ts/plugins/language-js/clone-candidates.js +65 -0
  172. package/target/main/ts/plugins/language-js/code-lines.d.ts +6 -0
  173. package/target/main/ts/plugins/language-js/code-lines.js +36 -0
  174. package/target/main/ts/plugins/language-js/extensions.d.ts +1 -0
  175. package/target/main/ts/plugins/language-js/extensions.js +3 -0
  176. package/target/main/ts/plugins/language-js/function-facts.d.ts +9 -0
  177. package/target/main/ts/plugins/language-js/function-facts.js +74 -0
  178. package/target/main/ts/plugins/language-js/js-security.d.ts +4 -0
  179. package/target/main/ts/plugins/language-js/js-security.js +497 -0
  180. package/target/main/ts/plugins/language-js/qualified-names.d.ts +11 -0
  181. package/target/main/ts/plugins/language-js/qualified-names.js +63 -0
  182. package/target/main/ts/plugins/language-js/structural-observations.d.ts +9 -0
  183. package/target/main/ts/plugins/language-js/structural-observations.js +85 -0
  184. package/target/main/ts/plugins/language-js/syntax.d.ts +2 -0
  185. package/target/main/ts/plugins/language-js/syntax.js +11 -0
  186. package/target/main/ts/plugins/maintainability/maintainability.d.ts +2 -0
  187. package/target/main/ts/plugins/maintainability/maintainability.js +38 -0
  188. package/target/main/ts/plugins/maintainability/structural-smells.d.ts +3 -0
  189. package/target/main/ts/plugins/maintainability/structural-smells.js +17 -0
  190. package/target/main/ts/plugins/security/actions-security.d.ts +2 -0
  191. package/target/main/ts/plugins/security/actions-security.js +581 -0
  192. package/target/main/ts/plugins/security/dockerfile.d.ts +2 -0
  193. package/target/main/ts/plugins/security/dockerfile.js +487 -0
  194. package/target/main/ts/plugins/security/npm-supply-chain.d.ts +4 -0
  195. package/target/main/ts/plugins/security/npm-supply-chain.js +368 -0
  196. package/target/main/ts/plugins/security/secrets.d.ts +12 -0
  197. package/target/main/ts/plugins/security/secrets.js +254 -0
  198. package/target/main/ts/plugins/source/forges.d.ts +4 -0
  199. package/target/main/ts/plugins/source/forges.js +80 -0
  200. package/target/main/ts/plugins/structure/structure.d.ts +2 -0
  201. package/target/main/ts/plugins/structure/structure.js +42 -0
  202. package/target/main/ts/report/html/app/viewer-chart-bars.d.ts +13 -0
  203. package/target/main/ts/report/html/app/viewer-chart-bars.js +59 -0
  204. package/target/main/ts/report/html/app/viewer-chart-label.d.ts +15 -0
  205. package/target/main/ts/report/html/app/viewer-chart-label.js +43 -0
  206. package/target/main/ts/report/html/app/viewer-chart-line.d.ts +33 -0
  207. package/target/main/ts/report/html/app/viewer-chart-line.js +88 -0
  208. package/target/main/ts/report/html/app/viewer-chart-points.d.ts +52 -0
  209. package/target/main/ts/report/html/app/viewer-chart-points.js +65 -0
  210. package/target/main/ts/report/html/app/viewer-chart-scale.d.ts +21 -0
  211. package/target/main/ts/report/html/app/viewer-chart-scale.js +93 -0
  212. package/target/main/ts/report/html/app/viewer-chart-svg.d.ts +28 -0
  213. package/target/main/ts/report/html/app/viewer-chart-svg.js +41 -0
  214. package/target/main/ts/report/html/app/viewer-chart-time.d.ts +26 -0
  215. package/target/main/ts/report/html/app/viewer-chart-time.js +150 -0
  216. package/target/main/ts/report/html/app/viewer-chart-tip.d.ts +4 -0
  217. package/target/main/ts/report/html/app/viewer-chart-tip.js +210 -0
  218. package/target/main/ts/report/html/app/viewer-chart-x.d.ts +12 -0
  219. package/target/main/ts/report/html/app/viewer-chart-x.js +50 -0
  220. package/target/main/ts/report/html/app/viewer-chart.d.ts +7 -0
  221. package/target/main/ts/report/html/app/viewer-chart.js +50 -0
  222. package/target/main/ts/report/html/app/viewer-code-map.d.ts +27 -0
  223. package/target/main/ts/report/html/app/viewer-code-map.js +176 -0
  224. package/target/main/ts/report/html/app/viewer-columns.d.ts +40 -0
  225. package/target/main/ts/report/html/app/viewer-columns.js +97 -0
  226. package/target/main/ts/report/html/app/viewer-commit-picker.d.ts +12 -0
  227. package/target/main/ts/report/html/app/viewer-commit-picker.js +229 -0
  228. package/target/main/ts/report/html/app/viewer-commits.d.ts +32 -0
  229. package/target/main/ts/report/html/app/viewer-commits.js +81 -0
  230. package/target/main/ts/report/html/app/viewer-controls.d.ts +43 -0
  231. package/target/main/ts/report/html/app/viewer-controls.js +141 -0
  232. package/target/main/ts/report/html/app/viewer-copy.d.ts +17 -0
  233. package/target/main/ts/report/html/app/viewer-copy.js +64 -0
  234. package/target/main/ts/report/html/app/viewer-data.d.ts +24 -0
  235. package/target/main/ts/report/html/app/viewer-data.js +78 -0
  236. package/target/main/ts/report/html/app/viewer-diagnostics.d.ts +4 -0
  237. package/target/main/ts/report/html/app/viewer-diagnostics.js +60 -0
  238. package/target/main/ts/report/html/app/viewer-dom.d.ts +27 -0
  239. package/target/main/ts/report/html/app/viewer-dom.js +99 -0
  240. package/target/main/ts/report/html/app/viewer-file-aside.d.ts +15 -0
  241. package/target/main/ts/report/html/app/viewer-file-aside.js +134 -0
  242. package/target/main/ts/report/html/app/viewer-file-figures.d.ts +17 -0
  243. package/target/main/ts/report/html/app/viewer-file-figures.js +65 -0
  244. package/target/main/ts/report/html/app/viewer-file-source.d.ts +7 -0
  245. package/target/main/ts/report/html/app/viewer-file-source.js +119 -0
  246. package/target/main/ts/report/html/app/viewer-files.d.ts +11 -0
  247. package/target/main/ts/report/html/app/viewer-files.js +40 -0
  248. package/target/main/ts/report/html/app/viewer-filter.d.ts +65 -0
  249. package/target/main/ts/report/html/app/viewer-filter.js +161 -0
  250. package/target/main/ts/report/html/app/viewer-hotspots.d.ts +4 -0
  251. package/target/main/ts/report/html/app/viewer-hotspots.js +133 -0
  252. package/target/main/ts/report/html/app/viewer-inspection.d.ts +69 -0
  253. package/target/main/ts/report/html/app/viewer-inspection.js +38 -0
  254. package/target/main/ts/report/html/app/viewer-issue-group.d.ts +27 -0
  255. package/target/main/ts/report/html/app/viewer-issue-group.js +174 -0
  256. package/target/main/ts/report/html/app/viewer-issues.d.ts +4 -0
  257. package/target/main/ts/report/html/app/viewer-issues.js +173 -0
  258. package/target/main/ts/report/html/app/viewer-language-bar.d.ts +11 -0
  259. package/target/main/ts/report/html/app/viewer-language-bar.js +76 -0
  260. package/target/main/ts/report/html/app/viewer-languages.d.ts +35 -0
  261. package/target/main/ts/report/html/app/viewer-languages.js +97 -0
  262. package/target/main/ts/report/html/app/viewer-layout.d.ts +14 -0
  263. package/target/main/ts/report/html/app/viewer-layout.js +134 -0
  264. package/target/main/ts/report/html/app/viewer-line-coverage.d.ts +47 -0
  265. package/target/main/ts/report/html/app/viewer-line-coverage.js +108 -0
  266. package/target/main/ts/report/html/app/viewer-locations.d.ts +16 -0
  267. package/target/main/ts/report/html/app/viewer-locations.js +31 -0
  268. package/target/main/ts/report/html/app/viewer-map-scale.d.ts +26 -0
  269. package/target/main/ts/report/html/app/viewer-map-scale.js +147 -0
  270. package/target/main/ts/report/html/app/viewer-map-shape.d.ts +42 -0
  271. package/target/main/ts/report/html/app/viewer-map-shape.js +102 -0
  272. package/target/main/ts/report/html/app/viewer-metric-format.d.ts +23 -0
  273. package/target/main/ts/report/html/app/viewer-metric-format.js +93 -0
  274. package/target/main/ts/report/html/app/viewer-metric-registry.d.ts +47 -0
  275. package/target/main/ts/report/html/app/viewer-metric-registry.js +138 -0
  276. package/target/main/ts/report/html/app/viewer-metrics-view.d.ts +4 -0
  277. package/target/main/ts/report/html/app/viewer-metrics-view.js +159 -0
  278. package/target/main/ts/report/html/app/viewer-metrics.d.ts +51 -0
  279. package/target/main/ts/report/html/app/viewer-metrics.js +195 -0
  280. package/target/main/ts/report/html/app/viewer-overview-cards.d.ts +12 -0
  281. package/target/main/ts/report/html/app/viewer-overview-cards.js +121 -0
  282. package/target/main/ts/report/html/app/viewer-overview-hotspots.d.ts +9 -0
  283. package/target/main/ts/report/html/app/viewer-overview-hotspots.js +173 -0
  284. package/target/main/ts/report/html/app/viewer-overview-lead.d.ts +12 -0
  285. package/target/main/ts/report/html/app/viewer-overview-lead.js +116 -0
  286. package/target/main/ts/report/html/app/viewer-profile-badges.d.ts +11 -0
  287. package/target/main/ts/report/html/app/viewer-profile-badges.js +119 -0
  288. package/target/main/ts/report/html/app/viewer-profile-table.d.ts +29 -0
  289. package/target/main/ts/report/html/app/viewer-profile-table.js +124 -0
  290. package/target/main/ts/report/html/app/viewer-profile.d.ts +13 -0
  291. package/target/main/ts/report/html/app/viewer-profile.js +180 -0
  292. package/target/main/ts/report/html/app/viewer-projects.d.ts +1 -0
  293. package/target/main/ts/report/html/app/viewer-projects.js +90 -0
  294. package/target/main/ts/report/html/app/viewer-pull-sections.d.ts +4 -0
  295. package/target/main/ts/report/html/app/viewer-pull-sections.js +118 -0
  296. package/target/main/ts/report/html/app/viewer-pull-trend.d.ts +5 -0
  297. package/target/main/ts/report/html/app/viewer-pull-trend.js +63 -0
  298. package/target/main/ts/report/html/app/viewer-pulls.d.ts +2 -0
  299. package/target/main/ts/report/html/app/viewer-pulls.js +92 -0
  300. package/target/main/ts/report/html/app/viewer-query-field.d.ts +19 -0
  301. package/target/main/ts/report/html/app/viewer-query-field.js +203 -0
  302. package/target/main/ts/report/html/app/viewer-route.d.ts +34 -0
  303. package/target/main/ts/report/html/app/viewer-route.js +55 -0
  304. package/target/main/ts/report/html/app/viewer-shell.d.ts +20 -0
  305. package/target/main/ts/report/html/app/viewer-shell.js +113 -0
  306. package/target/main/ts/report/html/app/viewer-source-view.d.ts +49 -0
  307. package/target/main/ts/report/html/app/viewer-source-view.js +150 -0
  308. package/target/main/ts/report/html/app/viewer-source.d.ts +27 -0
  309. package/target/main/ts/report/html/app/viewer-source.js +57 -0
  310. package/target/main/ts/report/html/app/viewer-suggest.d.ts +13 -0
  311. package/target/main/ts/report/html/app/viewer-suggest.js +91 -0
  312. package/target/main/ts/report/html/app/viewer-sunburst.d.ts +5 -0
  313. package/target/main/ts/report/html/app/viewer-sunburst.js +40 -0
  314. package/target/main/ts/report/html/app/viewer-table-cells.d.ts +25 -0
  315. package/target/main/ts/report/html/app/viewer-table-cells.js +135 -0
  316. package/target/main/ts/report/html/app/viewer-table-rows.d.ts +56 -0
  317. package/target/main/ts/report/html/app/viewer-table-rows.js +97 -0
  318. package/target/main/ts/report/html/app/viewer-tokenizer.d.ts +15 -0
  319. package/target/main/ts/report/html/app/viewer-tokenizer.js +241 -0
  320. package/target/main/ts/report/html/app/viewer-totals.d.ts +20 -0
  321. package/target/main/ts/report/html/app/viewer-totals.js +100 -0
  322. package/target/main/ts/report/html/app/viewer-treemap.d.ts +24 -0
  323. package/target/main/ts/report/html/app/viewer-treemap.js +112 -0
  324. package/target/main/ts/report/html/app/viewer-trend-data.d.ts +54 -0
  325. package/target/main/ts/report/html/app/viewer-trend-data.js +109 -0
  326. package/target/main/ts/report/html/app/viewer-trend-nav.d.ts +5 -0
  327. package/target/main/ts/report/html/app/viewer-trend-nav.js +86 -0
  328. package/target/main/ts/report/html/app/viewer-trend-points.d.ts +30 -0
  329. package/target/main/ts/report/html/app/viewer-trend-points.js +128 -0
  330. package/target/main/ts/report/html/app/viewer-trend-series.d.ts +32 -0
  331. package/target/main/ts/report/html/app/viewer-trend-series.js +128 -0
  332. package/target/main/ts/report/html/app/viewer-trends.d.ts +5 -0
  333. package/target/main/ts/report/html/app/viewer-trends.js +89 -0
  334. package/target/main/ts/report/html/app/viewer.d.ts +1 -0
  335. package/target/main/ts/report/html/app/viewer.js +222 -0
  336. package/target/main/ts/report/html/site/badges.d.ts +11 -0
  337. package/target/main/ts/report/html/site/badges.js +72 -0
  338. package/target/main/ts/report/html/site/export-site.d.ts +16 -0
  339. package/target/main/ts/report/html/site/export-site.js +129 -0
  340. package/target/main/ts/report/html/site/exported-server.d.ts +6 -0
  341. package/target/main/ts/report/html/site/exported-server.js +72 -0
  342. package/target/main/ts/report/html/site/local-server.d.ts +7 -0
  343. package/target/main/ts/report/html/site/local-server.js +59 -0
  344. package/target/main/ts/report/html/site/projects.d.ts +1 -0
  345. package/target/main/ts/report/html/site/projects.js +69 -0
  346. package/target/main/ts/report/html/site/server.d.ts +4 -0
  347. package/target/main/ts/report/html/site/server.js +65 -0
  348. package/target/main/ts/report/html/site/source-route.d.ts +6 -0
  349. package/target/main/ts/report/html/site/source-route.js +23 -0
  350. package/target/main/ts/report/json/projections/commit-summary.d.ts +13 -0
  351. package/target/main/ts/report/json/projections/commit-summary.js +125 -0
  352. package/target/main/ts/report/json/projections/components.d.ts +4 -0
  353. package/target/main/ts/report/json/projections/components.js +30 -0
  354. package/target/main/ts/report/json/projections/file-metrics.d.ts +4 -0
  355. package/target/main/ts/report/json/projections/file-metrics.js +260 -0
  356. package/target/main/ts/report/json/projections/ignore-view.d.ts +2 -0
  357. package/target/main/ts/report/json/projections/ignore-view.js +13 -0
  358. package/target/main/ts/report/json/projections/inspection-context.d.ts +5 -0
  359. package/target/main/ts/report/json/projections/inspection-context.js +104 -0
  360. package/target/main/ts/report/json/projections/inspection-details.d.ts +14 -0
  361. package/target/main/ts/report/json/projections/inspection-details.js +98 -0
  362. package/target/main/ts/report/json/projections/metric-values.d.ts +14 -0
  363. package/target/main/ts/report/json/projections/metric-values.js +104 -0
  364. package/target/main/ts/report/json/projections/profile-selectors.d.ts +8 -0
  365. package/target/main/ts/report/json/projections/profile-selectors.js +34 -0
  366. package/target/main/ts/report/json/projections/security-summary.d.ts +11 -0
  367. package/target/main/ts/report/json/projections/security-summary.js +22 -0
  368. package/target/main/ts/report/json/store/directory.d.ts +3 -0
  369. package/target/main/ts/report/json/store/directory.js +19 -0
  370. package/target/main/ts/report/json/store/local-store.d.ts +25 -0
  371. package/target/main/ts/report/json/store/local-store.js +214 -0
  372. package/target/main/ts/report/json/store/object-store.d.ts +14 -0
  373. package/target/main/ts/report/json/store/object-store.js +73 -0
  374. package/target/main/ts/report/json/store/operation-cache.d.ts +8 -0
  375. package/target/main/ts/report/json/store/operation-cache.js +32 -0
  376. package/target/main/ts/report/json/store/pull-review-store.d.ts +2 -0
  377. package/target/main/ts/report/json/store/pull-review-store.js +33 -0
  378. package/target/main/ts/report/json/store/replace-file.d.ts +1 -0
  379. package/target/main/ts/report/json/store/replace-file.js +35 -0
  380. package/target/main/ts/report/json/store/report-tree.d.ts +46 -0
  381. package/target/main/ts/report/json/store/report-tree.js +295 -0
  382. package/target/main/ts/report/json/store/store-check.d.ts +32 -0
  383. package/target/main/ts/report/json/store/store-check.js +153 -0
  384. package/target/main/ts/report/json/validation/metabranch.d.ts +4 -0
  385. package/target/main/ts/report/json/validation/metabranch.js +11 -0
  386. package/target/main/ts/report/json/validation/report.d.ts +20 -0
  387. package/target/main/ts/report/json/validation/report.js +77 -0
  388. package/target/main/ts/report/json/validation/summary-validation.d.ts +4 -0
  389. package/target/main/ts/report/json/validation/summary-validation.js +26 -0
  390. package/target/main/ts/report/json/wire/compact-json.d.ts +11 -0
  391. package/target/main/ts/report/json/wire/compact-json.js +76 -0
  392. package/target/main/ts/report/json/wire/component-model.d.ts +9 -0
  393. package/target/main/ts/report/json/wire/component-model.js +1 -0
  394. package/target/main/ts/report/json/wire/domain-types.d.ts +2 -0
  395. package/target/main/ts/report/json/wire/domain-types.js +1 -0
  396. package/target/main/ts/report/json/wire/file-metrics-model.d.ts +81 -0
  397. package/target/main/ts/report/json/wire/file-metrics-model.js +1 -0
  398. package/target/main/ts/report/json/wire/inspection-context-model.d.ts +31 -0
  399. package/target/main/ts/report/json/wire/inspection-context-model.js +1 -0
  400. package/target/main/ts/report/json/wire/inspection-details-model.d.ts +87 -0
  401. package/target/main/ts/report/json/wire/inspection-details-model.js +1 -0
  402. package/target/main/ts/report/json/wire/project-model.d.ts +7 -0
  403. package/target/main/ts/report/json/wire/project-model.js +1 -0
  404. package/target/main/ts/report/json/wire/public-history-model.d.ts +36 -0
  405. package/target/main/ts/report/json/wire/public-history-model.js +5 -0
  406. package/target/main/ts/report/json/wire/pull-review-model.d.ts +54 -0
  407. package/target/main/ts/report/json/wire/pull-review-model.js +3 -0
  408. package/target/main/ts/report/json/wire/summary-model.d.ts +45 -0
  409. package/target/main/ts/report/json/wire/summary-model.js +1 -0
  410. package/target/main/ts/report/markdown/pull-review.d.ts +5 -0
  411. package/target/main/ts/report/markdown/pull-review.js +132 -0
  412. package/target/main/ts/report.d.ts +23 -0
  413. package/target/main/ts/report.js +12 -0
  414. package/target/main/ts/runtime.d.ts +17 -0
  415. package/target/main/ts/runtime.js +30 -0
@@ -0,0 +1,76 @@
1
+ export const compactJsonSchema = 'urn:repometry:schema:compact-json:1';
2
+ export function packJson(value) {
3
+ const strings = [];
4
+ const shapes = [];
5
+ const stringIds = new Map();
6
+ const shapeIds = new Map();
7
+ function pack(item, depth) {
8
+ if (depth > 512)
9
+ throw new Error('Compact JSON exceeds the nesting limit');
10
+ if (item === null || item === undefined)
11
+ return null;
12
+ if (typeof item === 'boolean')
13
+ return item;
14
+ if (typeof item === 'number')
15
+ return Number.isFinite(item) ? item : null;
16
+ if (typeof item === 'string') {
17
+ let index = stringIds.get(item);
18
+ if (index === undefined) {
19
+ index = strings.length;
20
+ strings.push(item);
21
+ stringIds.set(item, index);
22
+ }
23
+ return [0, index];
24
+ }
25
+ if (Array.isArray(item))
26
+ return [1, ...item.map(value => pack(value, depth + 1))];
27
+ if (typeof item !== 'object')
28
+ throw new Error('Unsupported value in compact JSON');
29
+ const entries = Object.entries(item).filter(([, value]) => value !== undefined);
30
+ const keys = entries.map(([key]) => key);
31
+ const signature = JSON.stringify(keys);
32
+ let index = shapeIds.get(signature);
33
+ if (index === undefined) {
34
+ index = shapes.length;
35
+ shapes.push(keys);
36
+ shapeIds.set(signature, index);
37
+ }
38
+ return [index + 2, ...entries.map(([, value]) => pack(value, depth + 1))];
39
+ }
40
+ const data = pack(value, 0);
41
+ return { schema: compactJsonSchema, strings, shapes, data };
42
+ }
43
+ export function unpackJson(value) {
44
+ if (typeof value !== 'object' || value === null || !('schema' in value) || value.schema !== compactJsonSchema)
45
+ return value;
46
+ const candidate = value;
47
+ if (!Array.isArray(candidate.strings) || !candidate.strings.every(item => typeof item === 'string')
48
+ || !Array.isArray(candidate.shapes) || !candidate.shapes.every(shape => Array.isArray(shape)
49
+ && shape.every(key => typeof key === 'string') && new Set(shape).size === shape.length)) {
50
+ throw new Error('Invalid compact JSON dictionary');
51
+ }
52
+ const { strings, shapes } = candidate;
53
+ function unpack(item, depth) {
54
+ if (depth > 512)
55
+ throw new Error('Compact JSON exceeds the nesting limit');
56
+ if (item === null || typeof item === 'boolean' || typeof item === 'number')
57
+ return item;
58
+ if (!Array.isArray(item) || !Number.isSafeInteger(item[0]))
59
+ throw new Error('Invalid compact JSON node');
60
+ const [tag, ...values] = item;
61
+ if (tag === 0) {
62
+ const id = values[0];
63
+ if (values.length !== 1 || typeof id !== 'number' || !Number.isSafeInteger(id) || id < 0 || id >= strings.length) {
64
+ throw new Error('Invalid compact JSON string reference');
65
+ }
66
+ return strings[id];
67
+ }
68
+ if (tag === 1)
69
+ return values.map(child => unpack(child, depth + 1));
70
+ const keys = tag >= 2 ? shapes[tag - 2] : undefined;
71
+ if (!keys || keys.length !== values.length)
72
+ throw new Error('Invalid compact JSON object reference');
73
+ return Object.fromEntries(keys.map((key, index) => [key, unpack(values[index], depth + 1)]));
74
+ }
75
+ return unpack(candidate.data, 0);
76
+ }
@@ -0,0 +1,9 @@
1
+ export interface Component {
2
+ readonly name: string;
3
+ readonly pathGlobs: readonly string[];
4
+ readonly description?: string;
5
+ }
6
+ export interface ComponentMetrics {
7
+ readonly component: Component;
8
+ readonly paths: readonly string[];
9
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export type { Finding } from '@repometry/core/internal/model/finding.js';
2
+ export type { QualitySummary } from '@repometry/core/internal/model/quality-summary.js';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,81 @@
1
+ import type { LanguageSyntax } from '@repometry/core/internal/model/language.js';
2
+ import type { Report } from '@repometry/core/internal/model/report.js';
3
+ import type { ChurnWindow } from '@repometry/core/internal/model/churn.js';
4
+ import type { MetricDescriptor, MetricValues } from './summary-model.js';
5
+ export type { LanguageSyntax } from '@repometry/core/internal/model/language.js';
6
+ export declare const fileMetricsSchema = "urn:repometry:schema:file-metrics:1";
7
+ export interface Complexity {
8
+ readonly sum: number;
9
+ readonly maximum: number | null;
10
+ readonly measuredFunctions: number;
11
+ }
12
+ interface LineCoverage {
13
+ readonly covered: number;
14
+ readonly total: number;
15
+ }
16
+ interface Duplication {
17
+ readonly duplicatedLines: number;
18
+ readonly codeLines: number;
19
+ }
20
+ export interface Maintainability {
21
+ readonly smells: number;
22
+ readonly effortMinutes: number | null;
23
+ }
24
+ export interface Quality {
25
+ codeLines?: number;
26
+ commentLines?: number;
27
+ classes?: number;
28
+ cognitiveComplexity?: number;
29
+ churn?: number;
30
+ duplication?: Duplication;
31
+ maintainability?: Maintainability;
32
+ }
33
+ export interface Metrics {
34
+ readonly path: string;
35
+ lines: number | null;
36
+ /** Size in bytes; absent in reports made before sizes were recorded. */
37
+ bytes?: number;
38
+ functions: number | null;
39
+ complexity: Complexity | null;
40
+ lineCoverage: LineCoverage | null;
41
+ diagnosticCount: number;
42
+ quality?: Quality;
43
+ values?: MetricValues;
44
+ language?: number;
45
+ provider?: string;
46
+ analysed?: boolean;
47
+ }
48
+ export interface DirectoryMetrics extends Metrics {
49
+ files: number;
50
+ sizeMeasuredFiles: number;
51
+ coverageMeasuredFiles: number;
52
+ }
53
+ export interface FileMetricsReport {
54
+ readonly schema: typeof fileMetricsSchema;
55
+ readonly subject: Report['subject'];
56
+ readonly generatedAt: string;
57
+ readonly status: Report['status'];
58
+ readonly scope: Report['scope'];
59
+ readonly files: readonly Metrics[];
60
+ readonly directories: readonly DirectoryMetrics[];
61
+ readonly unassignedDiagnostics: number;
62
+ readonly catalog?: readonly MetricDescriptor[];
63
+ readonly languages?: readonly {
64
+ readonly id: string;
65
+ readonly label?: string;
66
+ readonly color?: string;
67
+ readonly analysed: boolean;
68
+ readonly syntax?: LanguageSyntax;
69
+ }[];
70
+ readonly churnWindow?: ChurnWindow & {
71
+ readonly lookbackDays: number;
72
+ readonly maxCommits: number;
73
+ };
74
+ readonly hotspots: {
75
+ readonly complexity: readonly string[];
76
+ readonly missedLines: readonly string[];
77
+ readonly cognitive?: readonly string[];
78
+ readonly duplication?: readonly string[];
79
+ readonly churn?: readonly string[];
80
+ };
81
+ }
@@ -0,0 +1 @@
1
+ export const fileMetricsSchema = 'urn:repometry:schema:file-metrics:1';
@@ -0,0 +1,31 @@
1
+ export interface IgnoreView {
2
+ readonly tool?: string;
3
+ readonly rule?: string;
4
+ readonly path?: string;
5
+ readonly reason?: string;
6
+ }
7
+ export type ProfileBoundary = 'changed' | 'unavailable';
8
+ export interface SourceExclusions {
9
+ readonly paths: readonly string[];
10
+ readonly directories: readonly string[];
11
+ }
12
+ export interface InspectionContext {
13
+ readonly exclusions: SourceExclusions | null;
14
+ readonly boundary: ProfileBoundary | null;
15
+ /** Sensitive findings by severity; critical appears once the scanners' severity scores are read for it. */
16
+ readonly security?: {
17
+ readonly critical?: number;
18
+ readonly low: number;
19
+ readonly medium: number;
20
+ readonly high: number;
21
+ readonly unknown: number;
22
+ };
23
+ readonly scanners?: readonly {
24
+ readonly name: string;
25
+ readonly version: string | null;
26
+ }[];
27
+ readonly ignores?: {
28
+ readonly rules: readonly IgnoreView[];
29
+ readonly count: number;
30
+ };
31
+ }
@@ -0,0 +1,87 @@
1
+ import type { Report } from '@repometry/core/internal/model/report.js';
2
+ import type { FileMetricsReport } from './file-metrics-model.js';
3
+ import type { InspectionContext } from './inspection-context-model.js';
4
+ import type { ComplexFunction } from './public-history-model.js';
5
+ import type { ComponentMetrics } from './component-model.js';
6
+ import type { LineCoverage } from '@repometry/core/internal/model/line-coverage.js';
7
+ export interface InspectionDetails {
8
+ readonly metrics: FileMetricsReport;
9
+ readonly functions: readonly ComplexFunction[];
10
+ readonly diagnostics: Report['diagnostics'];
11
+ readonly findings?: Report['findings'];
12
+ readonly components?: readonly ComponentMetrics[];
13
+ readonly lineCoverage?: LineCoverage;
14
+ /**
15
+ * The colour band limits the profile sets for the metrics with a meaningful scale: four ascending upper bounds
16
+ * (three for duplication, whose first band is zero). Absent, the viewer uses its defaults.
17
+ */
18
+ readonly bands?: Readonly<Partial<Record<'complexity' | 'missedLines' | 'duplication', readonly number[]>>>;
19
+ /** The profile the inspection applied, as the Profile page shows it. Local and private views only. */
20
+ readonly profile?: ProfileSettings;
21
+ }
22
+ /** What the inspection read and how it scored it: a projection of the report's applied configuration. */
23
+ export interface ProfileSettings {
24
+ readonly id: string | null;
25
+ readonly languages?: readonly ProfileLanguage[];
26
+ readonly excludedPaths: readonly string[];
27
+ readonly excludedDirectories: readonly string[];
28
+ /** Every check the profile applies, each named with the plugin that runs it. */
29
+ readonly rules: readonly {
30
+ readonly plugin: string;
31
+ readonly rule: string;
32
+ readonly limit: number;
33
+ readonly minutesPerExcess: number;
34
+ }[];
35
+ readonly ruleCatalog?: readonly ProfileRule[];
36
+ readonly duplication: {
37
+ readonly minCodeLines: number;
38
+ readonly minNodes: number;
39
+ readonly minutesPerRepeatedLine: number;
40
+ } | null;
41
+ readonly debtModel: {
42
+ readonly name: string;
43
+ readonly scale: number;
44
+ readonly exponent: number;
45
+ readonly minutesPerPersonMonth: number;
46
+ } | null;
47
+ readonly churn: {
48
+ readonly lookbackDays: number;
49
+ readonly maxCommits: number;
50
+ } | null;
51
+ readonly ignore: readonly {
52
+ readonly tool?: string;
53
+ readonly rule?: string;
54
+ readonly path?: string;
55
+ readonly reason?: string;
56
+ }[];
57
+ readonly analyzers: readonly {
58
+ readonly id: string;
59
+ readonly version: string;
60
+ readonly tools: Readonly<Record<string, string>>;
61
+ }[];
62
+ }
63
+ export interface ProfileLanguage {
64
+ readonly plugin: string;
65
+ readonly id: string;
66
+ readonly label: string;
67
+ readonly extensions: readonly string[];
68
+ readonly globs: readonly string[];
69
+ readonly unavailableReason?: string;
70
+ }
71
+ export interface ProfileRule {
72
+ readonly source: string;
73
+ readonly kind: 'check' | 'scanner';
74
+ readonly rule: string;
75
+ readonly title?: string;
76
+ readonly category: string;
77
+ readonly limit?: number;
78
+ readonly minutesPerExcess?: number;
79
+ readonly level?: string;
80
+ readonly help?: string;
81
+ }
82
+ export interface InspectionAsset {
83
+ readonly schema: 'urn:repometry:schema:viewer-inspection:1';
84
+ readonly sha: string;
85
+ readonly context?: InspectionContext;
86
+ readonly inspection: InspectionDetails;
87
+ }
@@ -0,0 +1,7 @@
1
+ import type { QualitySummary } from '@repometry/core/internal/model/quality-summary.js';
2
+ import type { PublicHistoryEntry } from './public-history-model.js';
3
+ export interface ProjectEntry {
4
+ readonly name: string;
5
+ readonly inspection: PublicHistoryEntry | null;
6
+ readonly quality: QualitySummary | null;
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,36 @@
1
+ import type { Report } from '@repometry/core/internal/model/report.js';
2
+ import type { QualitySummary } from '@repometry/core/internal/model/quality-summary.js';
3
+ export interface PublicHistoryEntry {
4
+ readonly sha: string;
5
+ readonly generatedAt: string;
6
+ /** Committer time of the inspected commit; absent when the inspection did not read Git history. */
7
+ readonly committedAt?: string;
8
+ /** First line of the commit message; absent in exports made before commit metadata was recorded. */
9
+ readonly subject?: string;
10
+ readonly author?: {
11
+ readonly name: string;
12
+ readonly email?: string;
13
+ };
14
+ /** Names of the tags pointing at the commit. */
15
+ readonly tags?: readonly string[];
16
+ readonly status: Report['status'];
17
+ readonly files: number;
18
+ readonly parsed: number;
19
+ readonly lines: number | null;
20
+ readonly functions: number | null;
21
+ readonly maxComplexity: number | null;
22
+ readonly lineCoverage: {
23
+ readonly covered: number;
24
+ readonly total: number;
25
+ } | null;
26
+ }
27
+ export declare function compareHistoryEntries(a: PublicHistoryEntry, b: PublicHistoryEntry): number;
28
+ export interface QualityHistory {
29
+ readonly reports: Record<string, QualitySummary>;
30
+ }
31
+ export interface ComplexFunction {
32
+ readonly name: string;
33
+ readonly path: string;
34
+ readonly line: number | null;
35
+ readonly complexity: number;
36
+ }
@@ -0,0 +1,5 @@
1
+ export function compareHistoryEntries(a, b) {
2
+ return Number(b.committedAt !== undefined) - Number(a.committedAt !== undefined)
3
+ || (b.committedAt ?? b.generatedAt).localeCompare(a.committedAt ?? a.generatedAt)
4
+ || a.sha.localeCompare(b.sha);
5
+ }
@@ -0,0 +1,54 @@
1
+ import type { DiffCoverage } from '@repometry/core/internal/model/diff-coverage.js';
2
+ import type { InspectionComparison } from '@repometry/core/internal/model/comparison.js';
3
+ import type { Finding } from '@repometry/core/internal/model/finding.js';
4
+ /** Reviews saved before 0.9 under `reviews/<number>.json`; the viewer lists them. */
5
+ export declare const storedPullReviewSchema = "urn:repometry:schema:pull-review:1";
6
+ type LineCoverage = InspectionComparison['metrics']['lineCoverage'];
7
+ type GateStatus = 'passed' | 'failed' | 'not-applicable' | 'indeterminate';
8
+ export interface PullReview {
9
+ readonly schema: typeof storedPullReviewSchema;
10
+ readonly number: number | null;
11
+ readonly generatedAt: string;
12
+ readonly base: string;
13
+ readonly mergeBase: string;
14
+ readonly head: string;
15
+ readonly coverage: {
16
+ readonly base: LineCoverage['baseline'] | null;
17
+ readonly head: LineCoverage['current'] | null;
18
+ readonly delta: number | null;
19
+ readonly reason: LineCoverage['reason'] | 'reports-unavailable' | 'head-coverage-changed';
20
+ readonly gate: {
21
+ readonly status: GateStatus;
22
+ readonly maxDrop: number;
23
+ } | null;
24
+ };
25
+ readonly diff: Pick<DiffCoverage, 'covered' | 'total' | 'percent' | 'files' | 'gaps'> & {
26
+ readonly status: DiffCoverage['status'] | 'unavailable';
27
+ readonly excludedPaths: readonly string[] | null;
28
+ readonly coverageInputDigest: string | null;
29
+ readonly uncovered: readonly {
30
+ readonly path: string;
31
+ readonly lines: readonly number[];
32
+ }[];
33
+ readonly gate: {
34
+ readonly status: GateStatus;
35
+ readonly minimumPercent: number;
36
+ readonly minimumLines: number;
37
+ } | null;
38
+ };
39
+ readonly findings: {
40
+ readonly added: readonly Finding[] | null;
41
+ readonly qualityCount: number | null;
42
+ readonly reason: 'reports-unavailable' | 'findings-unavailable' | 'partial-inspection' | 'analysis-changed' | null;
43
+ readonly gate: {
44
+ readonly status: GateStatus;
45
+ readonly maximum: number;
46
+ } | null;
47
+ };
48
+ }
49
+ export declare const pullReviewsSchema = "urn:repometry:schema:pull-reviews:1";
50
+ export interface PullReviews {
51
+ readonly schema: typeof pullReviewsSchema;
52
+ readonly reviews: readonly PullReview[];
53
+ }
54
+ export {};
@@ -0,0 +1,3 @@
1
+ /** Reviews saved before 0.9 under `reviews/<number>.json`; the viewer lists them. */
2
+ export const storedPullReviewSchema = 'urn:repometry:schema:pull-review:1';
3
+ export const pullReviewsSchema = 'urn:repometry:schema:pull-reviews:1';
@@ -0,0 +1,45 @@
1
+ import type { QualitySummary } from '@repometry/core/internal/model/quality-summary.js';
2
+ import type { MetricDescriptor } from '@repometry/core/internal/model/metric-descriptor.js';
3
+ import type { SourceLocator } from '@repometry/core/internal/model/source-locator.js';
4
+ import type { PublicHistoryEntry } from './public-history-model.js';
5
+ import type { ProfileBoundary } from './inspection-context-model.js';
6
+ export declare const summarySchema = "urn:repometry:schema:repository-summary:1";
7
+ export type MetricValues = Readonly<Record<number, number | null>>;
8
+ export type { MetricDescriptor } from '@repometry/core/internal/model/metric-descriptor.js';
9
+ export type { SourceLocator } from '@repometry/core/internal/model/source-locator.js';
10
+ export interface InspectionCounts {
11
+ readonly findingCount: number;
12
+ readonly diagnosticCount: number;
13
+ readonly componentCount: number;
14
+ readonly hasCoverage: boolean;
15
+ readonly security?: {
16
+ readonly low: number;
17
+ readonly medium: number;
18
+ readonly high: number;
19
+ readonly unknown: number;
20
+ };
21
+ }
22
+ export interface CommitSummary extends PublicHistoryEntry {
23
+ readonly quality: QualitySummary;
24
+ readonly counts?: InspectionCounts;
25
+ readonly detail?: string;
26
+ readonly revision?: string;
27
+ readonly profileDigest?: string;
28
+ readonly profileBoundary?: ProfileBoundary;
29
+ /** Local report headers carry their own catalog. Repository summaries lift it to the document root. */
30
+ readonly metrics?: readonly MetricDescriptor[];
31
+ readonly values?: MetricValues;
32
+ readonly privateMetrics?: readonly string[];
33
+ }
34
+ export interface RepositorySummary {
35
+ readonly schema: typeof summarySchema;
36
+ readonly commits: readonly CommitSummary[];
37
+ readonly pullReviewCount?: number;
38
+ readonly metrics?: readonly MetricDescriptor[];
39
+ readonly privateMetrics?: readonly string[];
40
+ /** Where the commits come from; the branch is the one the configuration names, never guessed. */
41
+ readonly source?: {
42
+ readonly branch?: string;
43
+ };
44
+ readonly sources?: SourceLocator;
45
+ }
@@ -0,0 +1 @@
1
+ export const summarySchema = 'urn:repometry:schema:repository-summary:1';
@@ -0,0 +1,5 @@
1
+ import type { PullReview } from '@repometry/core/internal/model/pull-review.js';
2
+ /** The first line of every review comment, which finds the comment to update. */
3
+ export declare const reviewMarker = "<!-- repometry-review -->";
4
+ /** The review as Markdown: the run summary and the pull request comment carry the same text. */
5
+ export declare function pullReviewMarkdown(review: PullReview): string;
@@ -0,0 +1,132 @@
1
+ import { annotationLimit } from '@repometry/core/internal/model/pull-review.js';
2
+ /** The first line of every review comment, which finds the comment to update. */
3
+ export const reviewMarker = '<!-- repometry-review -->';
4
+ const maxLength = 60_000;
5
+ const assets = 'https://raw.githubusercontent.com/idleware/repometry/master/.github/assets';
6
+ const groups = [
7
+ { effect: 'new', title: 'New', folded: false }, { effect: 'worsened', title: 'Worsened', folded: false },
8
+ { effect: 'improved', title: 'Improved', folded: true }, { effect: 'touched', title: 'Touched', folded: true },
9
+ ];
10
+ const verdicts = { passed: 'Passed', failed: 'Failed', unmeasured: 'Not measured' };
11
+ /** The review as Markdown: the run summary and the pull request comment carry the same text. */
12
+ export function pullReviewMarkdown(review) {
13
+ const head = [reviewMarker, `## ${review.verdict === 'unmeasured' ? '' : `${flag(review.verdict)} `}repometry`, '', headline(review), '',
14
+ ...facts(review).map(line => `- ${line}`), ''];
15
+ const annotated = review.issues.filter(issue => issue.effect === 'new' || issue.effect === 'worsened').length;
16
+ const ranges = review.coverage.uncovered.length;
17
+ const tail = [...annotated > annotationLimit ? [`Annotated on the diff: ${annotationLimit} of ${annotated}.`, ''] : [],
18
+ ...ranges > annotationLimit ? [`Annotated on the diff: ${annotationLimit} of ${ranges} uncovered ranges.`, ''] : []];
19
+ const { lines, cut } = issueTables(review, maxLength - [...head, ...tail].join('\n').length - 200);
20
+ return [...head, ...lines, ...tail, ...cut ? [`${cut} more issues not shown.`, ''] : []].join('\n');
21
+ }
22
+ /**
23
+ * One table per group, then the uncovered changed lines, with as many rows as the budget allows. Rows keep their order
24
+ * of importance: once one doesn't fit, every later row is counted as cut.
25
+ */
26
+ function issueTables(review, budget) {
27
+ const tables = [...groups.map(({ effect, title, folded }) => ({ title, folded, heads: ['File', 'Issue'],
28
+ rows: review.issues.filter(issue => issue.effect === effect).map(issue => `| ${place(issue.finding)} | ${describe(issue)} |`) })),
29
+ { title: 'Changed lines without coverage', folded: true, heads: ['Changed lines'],
30
+ rows: review.coverage.uncovered.map(({ path, first, last }) => `| ${location({ path, line: first, endLine: last })} |`) }];
31
+ const lines = [];
32
+ let left = budget;
33
+ let cut = 0;
34
+ for (const table of tables) {
35
+ const rendered = cut ? { lines: [], length: 0, cut: table.rows.length } : fitTable(table, left);
36
+ lines.push(...rendered.lines);
37
+ left -= rendered.length;
38
+ cut += rendered.cut;
39
+ }
40
+ return { lines, cut };
41
+ }
42
+ function fitTable({ title, folded, heads, rows }, budget) {
43
+ const header = [...folded ? [`<details><summary>${title} (${rows.length})</summary>`, ''] : [`### ${title}`, ''],
44
+ `| ${heads.join(' | ')} |`, `| ${heads.map(() => '---').join(' | ')} |`];
45
+ const closing = folded ? ['', '</details>', ''] : [''];
46
+ const kept = [];
47
+ let length = [...header, ...closing].join('\n').length + 1;
48
+ for (const row of rows) {
49
+ if (length + row.length + 1 > budget)
50
+ break;
51
+ length += row.length + 1;
52
+ kept.push(row);
53
+ }
54
+ const cut = rows.length - kept.length;
55
+ return kept.length ? { lines: [...header, ...kept, ...closing], length, cut } : { lines: [], length: 0, cut };
56
+ }
57
+ /**
58
+ * The verdict flag that, with the name, forms the logo. Comments load it from master, so these paths must never change.
59
+ * It is cropped to its ink: at 17 px it stands on the heading's baseline at cap height.
60
+ */
61
+ function flag(verdict) {
62
+ const asset = (theme) => `${assets}/flag-${verdict}-${theme}.svg`;
63
+ return `<picture><source media="(prefers-color-scheme: dark)" srcset="${asset('dark')}">`
64
+ + `<img src="${asset('light')}" alt="" width="17" height="17"></picture>`;
65
+ }
66
+ function headline({ verdict, issues, base, mergeBase, head, changedFiles }) {
67
+ const counts = groups.map(({ effect }) => [effect, issues.filter(issue => issue.effect === effect).length])
68
+ .filter(([, count]) => count > 0).map(([effect, count]) => `${count} ${effect}`);
69
+ const what = changedFiles === 0 ? `no changes since \`${base}\``
70
+ : `${counts.length ? counts.join(' · ') : 'no issues'} on the lines changed since \`${base}\``;
71
+ return `**${verdicts[verdict]}** · ${what} (\`${mergeBase.slice(0, 7)}\` → \`${head.slice(0, 7)}\`)`;
72
+ }
73
+ function facts({ coverage, debt, unmeasured, notes }) {
74
+ const lines = [coverageLine(coverage)];
75
+ if (debt.added || debt.removed)
76
+ lines.push(`Debt: +${debt.added} min added, −${debt.removed} min removed`);
77
+ lines.push(...few(unmeasured).map(reason => `Not measured: ${typeof reason === 'string' ? reason : reasonText(reason)}`));
78
+ const unmapped = coverage.unmapped.map(({ path }) => code(path));
79
+ if (unmapped.length) {
80
+ const named = unmapped.length > 3 ? `${unmapped.slice(0, 3).join(', ')} and ${unmapped.length - 3} more` : unmapped.join(', ');
81
+ lines.push(`Coverage has no record for ${unmapped.length} changed ${unmapped.length === 1 ? 'file' : 'files'}: ${named}`);
82
+ }
83
+ lines.push(...few(notes).map(reason => `Note: ${typeof reason === 'string' ? reason : reasonText(reason)}`));
84
+ return lines;
85
+ }
86
+ /** The first reasons, and a count of the rest. */
87
+ function few(reasons, shown = 5) {
88
+ return reasons.length > shown ? [...reasons.slice(0, shown), `${reasons.length - shown} more`] : [...reasons];
89
+ }
90
+ function coverageLine({ imported, covered, total, percent, gate }) {
91
+ if (!imported)
92
+ return 'Coverage not imported';
93
+ const measured = percent === null ? 'no measured lines' : `${percent.toFixed(2)}% (${covered} of ${total} lines)`;
94
+ if (gate === null)
95
+ return `Changed-line coverage: ${measured}`;
96
+ const status = gate.status === 'not-applicable' ? `applies from ${gate.minimumLines} measured lines` : gate.status;
97
+ return `Changed-line coverage: ${measured}, minimum ${gate.minimumPercent}%, ${status}`;
98
+ }
99
+ function reasonText({ operation, path, message }) {
100
+ return [operation, path === undefined ? undefined : `on ${code(path)}`].filter(Boolean).join(' ') + (operation || path ? ': ' : '')
101
+ + cell(message);
102
+ }
103
+ function describe({ effect, finding, before, fixed, context }) {
104
+ const parts = [clip(cell(finding.message))];
105
+ if (fixed)
106
+ parts.push('fixed');
107
+ else if ((effect === 'worsened' || effect === 'improved') && before !== null)
108
+ parts.push(`was ${before}`);
109
+ if (context.length)
110
+ parts.push(`same code as ${context.map(location).join(', ')}`);
111
+ return parts.join(', ');
112
+ }
113
+ function place({ path, line, endLine }) {
114
+ if (path === undefined)
115
+ return '—';
116
+ return line === undefined ? code(path) : location({ path, line, endLine: endLine ?? line });
117
+ }
118
+ function location({ path, line, endLine }) {
119
+ return code(`${path}:${line}${endLine > line ? `–${endLine}` : ''}`);
120
+ }
121
+ function code(value) {
122
+ return `<code>${cell(value)}</code>`;
123
+ }
124
+ /** A long message is shortened, so one issue can't push the others out of the comment. */
125
+ function clip(value, length = 500) {
126
+ return value.length > length ? `${value.slice(0, length - 1)}…` : value;
127
+ }
128
+ function cell(value) {
129
+ return value.replaceAll('&', '&amp;').replaceAll('<', '&lt;').replaceAll('>', '&gt;').replaceAll('|', '&#124;')
130
+ .replace(/[\r\n]+/g, ' ');
131
+ }
132
+ //# sourceMappingURL=pull-review.js.map
@@ -0,0 +1,23 @@
1
+ export { readReport, reportSchema } from './report/json/validation/report.js';
2
+ export type { Diagnostic, Report, ReportReader, ReportStore } from './report/json/validation/report.js';
3
+ export type { ReportWriter } from '@repometry/core/internal/ports/report.js';
4
+ export { LocalReportStore } from './report/json/store/local-store.js';
5
+ export { GitReportReader } from './api/git/git-reader.js';
6
+ export { validateSummary } from './report/json/validation/summary-validation.js';
7
+ export type { PublicHistoryEntry } from './report/json/wire/public-history-model.js';
8
+ export { summarySchema } from './report/json/wire/summary-model.js';
9
+ export type { CommitSummary, RepositorySummary } from './report/json/wire/summary-model.js';
10
+ export type { SourceLocator } from './report/json/wire/summary-model.js';
11
+ export { fileMetricsSchema } from './report/json/wire/file-metrics-model.js';
12
+ export type { FileMetricsReport } from './report/json/wire/file-metrics-model.js';
13
+ export { fileMetrics } from './report/json/projections/file-metrics.js';
14
+ export { coverageGrade, qualitySummary } from '@repometry/core/internal/model/quality-summary.js';
15
+ export type { Grade, QualitySummary } from '@repometry/core/internal/model/quality-summary.js';
16
+ export { diffCoverageSchema } from '@repometry/core/internal/usecases/diff-coverage.js';
17
+ export type { DiffCoverageReport } from '@repometry/core/internal/usecases/diff-coverage.js';
18
+ export { pullReviewSchema } from '@repometry/core/internal/model/pull-review.js';
19
+ export type { IssueEffect, PullReview, ReviewedIssue, ReviewReason } from '@repometry/core/internal/model/pull-review.js';
20
+ export { pullReviewsSchema } from './report/json/wire/pull-review-model.js';
21
+ export type { PullReviews } from './report/json/wire/pull-review-model.js';
22
+ export type { IgnoredFinding } from '@repometry/core/internal/model/finding-ignore.js';
23
+ export type { Subject } from '@repometry/core/internal/model/snapshot.js';
@@ -0,0 +1,12 @@
1
+ export { readReport, reportSchema } from './report/json/validation/report.js';
2
+ export { LocalReportStore } from './report/json/store/local-store.js';
3
+ export { GitReportReader } from './api/git/git-reader.js';
4
+ export { validateSummary } from './report/json/validation/summary-validation.js';
5
+ export { summarySchema } from './report/json/wire/summary-model.js';
6
+ export { fileMetricsSchema } from './report/json/wire/file-metrics-model.js';
7
+ export { fileMetrics } from './report/json/projections/file-metrics.js';
8
+ export { coverageGrade, qualitySummary } from '@repometry/core/internal/model/quality-summary.js';
9
+ export { diffCoverageSchema } from '@repometry/core/internal/usecases/diff-coverage.js';
10
+ export { pullReviewSchema } from '@repometry/core/internal/model/pull-review.js';
11
+ export { pullReviewsSchema } from './report/json/wire/pull-review-model.js';
12
+ //# sourceMappingURL=report.js.map