@repometry/cli 0.0.0-dev.0 → 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.
- package/LICENSE +21 -0
- package/README.md +70 -3
- package/package.json +65 -2
- package/target/main/resources/language-catalog.json +61 -0
- package/target/main/resources/report/json/compact-json-v1.schema.json +24 -0
- package/target/main/resources/report/json/comparison-v1.schema.json +65 -0
- package/target/main/resources/report/json/config-v2.schema.json +224 -0
- package/target/main/resources/report/json/diff-coverage-v1.schema.json +55 -0
- package/target/main/resources/report/json/file-metrics-v1.schema.json +157 -0
- package/target/main/resources/report/json/metabranch-v1.schema.json +9 -0
- package/target/main/resources/report/json/metric-catalog-v1.schema.json +31 -0
- package/target/main/resources/report/json/pull-review-v1.schema.json +97 -0
- package/target/main/resources/report/json/pull-review-v2.schema.json +100 -0
- package/target/main/resources/report/json/report-v2.schema.json +530 -0
- package/target/main/resources/report/json/repository-summary-v1.schema.json +337 -0
- package/target/main/resources/report/json/viewer-inspection-v1.schema.json +534 -0
- package/target/main/resources/viewer/files.css +616 -0
- package/target/main/resources/viewer/index.html +120 -0
- package/target/main/resources/viewer/projects.html +52 -0
- package/target/main/resources/viewer/styles.css +579 -0
- package/target/main/resources/viewer/viewer-pulls.css +64 -0
- package/target/main/ts/api/cache/root.d.ts +2 -0
- package/target/main/ts/api/cache/root.js +21 -0
- package/target/main/ts/api/gh/github.d.ts +4 -0
- package/target/main/ts/api/gh/github.js +47 -0
- package/target/main/ts/api/git/blob-batch.d.ts +10 -0
- package/target/main/ts/api/git/blob-batch.js +107 -0
- package/target/main/ts/api/git/blob-history.d.ts +20 -0
- package/target/main/ts/api/git/blob-history.js +54 -0
- package/target/main/ts/api/git/changes.d.ts +27 -0
- package/target/main/ts/api/git/changes.js +117 -0
- package/target/main/ts/api/git/commit-metadata.d.ts +2 -0
- package/target/main/ts/api/git/commit-metadata.js +46 -0
- package/target/main/ts/api/git/git-churn.d.ts +9 -0
- package/target/main/ts/api/git/git-churn.js +72 -0
- package/target/main/ts/api/git/git-executable.d.ts +1 -0
- package/target/main/ts/api/git/git-executable.js +31 -0
- package/target/main/ts/api/git/git-reader.d.ts +24 -0
- package/target/main/ts/api/git/git-reader.js +113 -0
- package/target/main/ts/api/git/git.d.ts +47 -0
- package/target/main/ts/api/git/git.js +289 -0
- package/target/main/ts/api/git/inspection-source.d.ts +17 -0
- package/target/main/ts/api/git/inspection-source.js +36 -0
- package/target/main/ts/api/git/line-changes.d.ts +6 -0
- package/target/main/ts/api/git/line-changes.js +57 -0
- package/target/main/ts/api/git/local-sources.d.ts +5 -0
- package/target/main/ts/api/git/local-sources.js +48 -0
- package/target/main/ts/api/git/local.d.ts +7 -0
- package/target/main/ts/api/git/local.js +106 -0
- package/target/main/ts/api/git/source-cache.d.ts +1 -0
- package/target/main/ts/api/git/source-cache.js +42 -0
- package/target/main/ts/api/import/cobertura.d.ts +2 -0
- package/target/main/ts/api/import/cobertura.js +160 -0
- package/target/main/ts/api/import/coverage-xml.d.ts +7 -0
- package/target/main/ts/api/import/coverage-xml.js +135 -0
- package/target/main/ts/api/import/finding-import.d.ts +9 -0
- package/target/main/ts/api/import/finding-import.js +227 -0
- package/target/main/ts/api/import/go-cover.d.ts +13 -0
- package/target/main/ts/api/import/go-cover.js +150 -0
- package/target/main/ts/api/import/lcov-files.d.ts +12 -0
- package/target/main/ts/api/import/lcov-files.js +53 -0
- package/target/main/ts/api/import/profile-file.d.ts +4 -0
- package/target/main/ts/api/import/profile-file.js +17 -0
- package/target/main/ts/api/process/docker-tool-runner.d.ts +13 -0
- package/target/main/ts/api/process/docker-tool-runner.js +92 -0
- package/target/main/ts/api/process/failure.d.ts +1 -0
- package/target/main/ts/api/process/failure.js +12 -0
- package/target/main/ts/api/process/plugin.d.ts +13 -0
- package/target/main/ts/api/process/plugin.js +100 -0
- package/target/main/ts/api/process/tool-snapshot.d.ts +3 -0
- package/target/main/ts/api/process/tool-snapshot.js +26 -0
- package/target/main/ts/cli/arguments.d.ts +28 -0
- package/target/main/ts/cli/arguments.js +109 -0
- package/target/main/ts/cli/config.d.ts +63 -0
- package/target/main/ts/cli/config.js +165 -0
- package/target/main/ts/cli/imports.d.ts +9 -0
- package/target/main/ts/cli/imports.js +37 -0
- package/target/main/ts/cli/main.d.ts +2 -0
- package/target/main/ts/cli/main.js +4 -0
- package/target/main/ts/cli/range-inspection.d.ts +38 -0
- package/target/main/ts/cli/range-inspection.js +34 -0
- package/target/main/ts/cli/range-jobs.d.ts +23 -0
- package/target/main/ts/cli/range-jobs.js +152 -0
- package/target/main/ts/cli/range-worker.d.ts +1 -0
- package/target/main/ts/cli/range-worker.js +40 -0
- package/target/main/ts/cli/reporting.d.ts +42 -0
- package/target/main/ts/cli/reporting.js +98 -0
- package/target/main/ts/cli/revisions.d.ts +6 -0
- package/target/main/ts/cli/revisions.js +16 -0
- package/target/main/ts/cli/run.d.ts +2 -0
- package/target/main/ts/cli/run.js +306 -0
- package/target/main/ts/cli/store.d.ts +13 -0
- package/target/main/ts/cli/store.js +39 -0
- package/target/main/ts/compose/analysis-report.d.ts +6 -0
- package/target/main/ts/compose/analysis-report.js +131 -0
- package/target/main/ts/compose/analysis-results.d.ts +42 -0
- package/target/main/ts/compose/analysis-results.js +84 -0
- package/target/main/ts/compose/analysis-steps.d.ts +23 -0
- package/target/main/ts/compose/analysis-steps.js +217 -0
- package/target/main/ts/compose/analyze-snapshot.d.ts +7 -0
- package/target/main/ts/compose/analyze-snapshot.js +21 -0
- package/target/main/ts/compose/attach-churn.d.ts +2 -0
- package/target/main/ts/compose/attach-churn.js +50 -0
- package/target/main/ts/compose/built-ins.d.ts +6 -0
- package/target/main/ts/compose/built-ins.js +12 -0
- package/target/main/ts/compose/diff-coverage.d.ts +25 -0
- package/target/main/ts/compose/diff-coverage.js +82 -0
- package/target/main/ts/compose/distribution.d.ts +17 -0
- package/target/main/ts/compose/distribution.js +13 -0
- package/target/main/ts/compose/docker-image.d.ts +5 -0
- package/target/main/ts/compose/docker-image.js +49 -0
- package/target/main/ts/compose/file-selection.d.ts +9 -0
- package/target/main/ts/compose/file-selection.js +38 -0
- package/target/main/ts/compose/history-cache.d.ts +31 -0
- package/target/main/ts/compose/history-cache.js +62 -0
- package/target/main/ts/compose/inspect.d.ts +34 -0
- package/target/main/ts/compose/inspect.js +51 -0
- package/target/main/ts/compose/inspection-coverage.d.ts +9 -0
- package/target/main/ts/compose/inspection-coverage.js +9 -0
- package/target/main/ts/compose/js-plugin.d.ts +113 -0
- package/target/main/ts/compose/js-plugin.js +99 -0
- package/target/main/ts/compose/language-discovery.d.ts +12 -0
- package/target/main/ts/compose/language-discovery.js +51 -0
- package/target/main/ts/compose/languages.d.ts +64 -0
- package/target/main/ts/compose/languages.js +98 -0
- package/target/main/ts/compose/load-plugins.d.ts +6 -0
- package/target/main/ts/compose/load-plugins.js +71 -0
- package/target/main/ts/compose/parser-order.d.ts +20 -0
- package/target/main/ts/compose/parser-order.js +90 -0
- package/target/main/ts/compose/phases.d.ts +140 -0
- package/target/main/ts/compose/phases.js +147 -0
- package/target/main/ts/compose/plugin-list.d.ts +37 -0
- package/target/main/ts/compose/plugin-list.js +30 -0
- package/target/main/ts/compose/plugin-manifest.d.ts +14 -0
- package/target/main/ts/compose/plugin-manifest.js +50 -0
- package/target/main/ts/compose/plugin-options.d.ts +2 -0
- package/target/main/ts/compose/plugin-options.js +29 -0
- package/target/main/ts/compose/plugin-reference.d.ts +9 -0
- package/target/main/ts/compose/plugin-reference.js +40 -0
- package/target/main/ts/compose/plugin-requirements.d.ts +5 -0
- package/target/main/ts/compose/plugin-requirements.js +83 -0
- package/target/main/ts/compose/plugin-scope.d.ts +9 -0
- package/target/main/ts/compose/plugin-scope.js +60 -0
- package/target/main/ts/compose/process-plugins.d.ts +89 -0
- package/target/main/ts/compose/process-plugins.js +74 -0
- package/target/main/ts/compose/registered-plugin.d.ts +17 -0
- package/target/main/ts/compose/registered-plugin.js +8 -0
- package/target/main/ts/compose/review.d.ts +26 -0
- package/target/main/ts/compose/review.js +54 -0
- package/target/main/ts/compose/schema-error.d.ts +2 -0
- package/target/main/ts/compose/schema-error.js +16 -0
- package/target/main/ts/compose/sources.d.ts +2 -0
- package/target/main/ts/compose/sources.js +32 -0
- package/target/main/ts/compose/structure-measures.d.ts +9 -0
- package/target/main/ts/compose/structure-measures.js +63 -0
- package/target/main/ts/index.d.ts +8 -0
- package/target/main/ts/index.js +5 -0
- package/target/main/ts/plugin.d.ts +2 -0
- package/target/main/ts/plugin.js +2 -0
- package/target/main/ts/plugins/built-in.d.ts +3 -0
- package/target/main/ts/plugins/built-in.js +19 -0
- package/target/main/ts/plugins/coverage/coverage.d.ts +11 -0
- package/target/main/ts/plugins/coverage/coverage.js +289 -0
- package/target/main/ts/plugins/coverage/diff-coverage.d.ts +3 -0
- package/target/main/ts/plugins/coverage/diff-coverage.js +85 -0
- package/target/main/ts/plugins/duplication/duplication.d.ts +2 -0
- package/target/main/ts/plugins/duplication/duplication.js +95 -0
- package/target/main/ts/plugins/language-js/babel-provider.d.ts +10 -0
- package/target/main/ts/plugins/language-js/babel-provider.js +54 -0
- package/target/main/ts/plugins/language-js/clone-candidates.d.ts +3 -0
- package/target/main/ts/plugins/language-js/clone-candidates.js +65 -0
- package/target/main/ts/plugins/language-js/code-lines.d.ts +6 -0
- package/target/main/ts/plugins/language-js/code-lines.js +36 -0
- package/target/main/ts/plugins/language-js/extensions.d.ts +1 -0
- package/target/main/ts/plugins/language-js/extensions.js +3 -0
- package/target/main/ts/plugins/language-js/function-facts.d.ts +9 -0
- package/target/main/ts/plugins/language-js/function-facts.js +74 -0
- package/target/main/ts/plugins/language-js/js-security.d.ts +4 -0
- package/target/main/ts/plugins/language-js/js-security.js +497 -0
- package/target/main/ts/plugins/language-js/qualified-names.d.ts +11 -0
- package/target/main/ts/plugins/language-js/qualified-names.js +63 -0
- package/target/main/ts/plugins/language-js/structural-observations.d.ts +9 -0
- package/target/main/ts/plugins/language-js/structural-observations.js +85 -0
- package/target/main/ts/plugins/language-js/syntax.d.ts +2 -0
- package/target/main/ts/plugins/language-js/syntax.js +11 -0
- package/target/main/ts/plugins/maintainability/maintainability.d.ts +2 -0
- package/target/main/ts/plugins/maintainability/maintainability.js +38 -0
- package/target/main/ts/plugins/maintainability/structural-smells.d.ts +3 -0
- package/target/main/ts/plugins/maintainability/structural-smells.js +17 -0
- package/target/main/ts/plugins/security/actions-security.d.ts +2 -0
- package/target/main/ts/plugins/security/actions-security.js +581 -0
- package/target/main/ts/plugins/security/dockerfile.d.ts +2 -0
- package/target/main/ts/plugins/security/dockerfile.js +487 -0
- package/target/main/ts/plugins/security/npm-supply-chain.d.ts +4 -0
- package/target/main/ts/plugins/security/npm-supply-chain.js +368 -0
- package/target/main/ts/plugins/security/secrets.d.ts +12 -0
- package/target/main/ts/plugins/security/secrets.js +254 -0
- package/target/main/ts/plugins/source/forges.d.ts +4 -0
- package/target/main/ts/plugins/source/forges.js +80 -0
- package/target/main/ts/plugins/structure/structure.d.ts +2 -0
- package/target/main/ts/plugins/structure/structure.js +42 -0
- package/target/main/ts/report/html/app/viewer-chart-bars.d.ts +13 -0
- package/target/main/ts/report/html/app/viewer-chart-bars.js +59 -0
- package/target/main/ts/report/html/app/viewer-chart-label.d.ts +15 -0
- package/target/main/ts/report/html/app/viewer-chart-label.js +43 -0
- package/target/main/ts/report/html/app/viewer-chart-line.d.ts +33 -0
- package/target/main/ts/report/html/app/viewer-chart-line.js +88 -0
- package/target/main/ts/report/html/app/viewer-chart-points.d.ts +52 -0
- package/target/main/ts/report/html/app/viewer-chart-points.js +65 -0
- package/target/main/ts/report/html/app/viewer-chart-scale.d.ts +21 -0
- package/target/main/ts/report/html/app/viewer-chart-scale.js +93 -0
- package/target/main/ts/report/html/app/viewer-chart-svg.d.ts +28 -0
- package/target/main/ts/report/html/app/viewer-chart-svg.js +41 -0
- package/target/main/ts/report/html/app/viewer-chart-time.d.ts +26 -0
- package/target/main/ts/report/html/app/viewer-chart-time.js +150 -0
- package/target/main/ts/report/html/app/viewer-chart-tip.d.ts +4 -0
- package/target/main/ts/report/html/app/viewer-chart-tip.js +210 -0
- package/target/main/ts/report/html/app/viewer-chart-x.d.ts +12 -0
- package/target/main/ts/report/html/app/viewer-chart-x.js +50 -0
- package/target/main/ts/report/html/app/viewer-chart.d.ts +7 -0
- package/target/main/ts/report/html/app/viewer-chart.js +50 -0
- package/target/main/ts/report/html/app/viewer-code-map.d.ts +27 -0
- package/target/main/ts/report/html/app/viewer-code-map.js +176 -0
- package/target/main/ts/report/html/app/viewer-columns.d.ts +40 -0
- package/target/main/ts/report/html/app/viewer-columns.js +97 -0
- package/target/main/ts/report/html/app/viewer-commit-picker.d.ts +12 -0
- package/target/main/ts/report/html/app/viewer-commit-picker.js +229 -0
- package/target/main/ts/report/html/app/viewer-commits.d.ts +32 -0
- package/target/main/ts/report/html/app/viewer-commits.js +81 -0
- package/target/main/ts/report/html/app/viewer-controls.d.ts +43 -0
- package/target/main/ts/report/html/app/viewer-controls.js +141 -0
- package/target/main/ts/report/html/app/viewer-copy.d.ts +17 -0
- package/target/main/ts/report/html/app/viewer-copy.js +64 -0
- package/target/main/ts/report/html/app/viewer-data.d.ts +24 -0
- package/target/main/ts/report/html/app/viewer-data.js +78 -0
- package/target/main/ts/report/html/app/viewer-diagnostics.d.ts +4 -0
- package/target/main/ts/report/html/app/viewer-diagnostics.js +60 -0
- package/target/main/ts/report/html/app/viewer-dom.d.ts +27 -0
- package/target/main/ts/report/html/app/viewer-dom.js +99 -0
- package/target/main/ts/report/html/app/viewer-file-aside.d.ts +15 -0
- package/target/main/ts/report/html/app/viewer-file-aside.js +134 -0
- package/target/main/ts/report/html/app/viewer-file-figures.d.ts +17 -0
- package/target/main/ts/report/html/app/viewer-file-figures.js +65 -0
- package/target/main/ts/report/html/app/viewer-file-source.d.ts +7 -0
- package/target/main/ts/report/html/app/viewer-file-source.js +119 -0
- package/target/main/ts/report/html/app/viewer-files.d.ts +11 -0
- package/target/main/ts/report/html/app/viewer-files.js +40 -0
- package/target/main/ts/report/html/app/viewer-filter.d.ts +65 -0
- package/target/main/ts/report/html/app/viewer-filter.js +161 -0
- package/target/main/ts/report/html/app/viewer-hotspots.d.ts +4 -0
- package/target/main/ts/report/html/app/viewer-hotspots.js +133 -0
- package/target/main/ts/report/html/app/viewer-inspection.d.ts +69 -0
- package/target/main/ts/report/html/app/viewer-inspection.js +38 -0
- package/target/main/ts/report/html/app/viewer-issue-group.d.ts +27 -0
- package/target/main/ts/report/html/app/viewer-issue-group.js +174 -0
- package/target/main/ts/report/html/app/viewer-issues.d.ts +4 -0
- package/target/main/ts/report/html/app/viewer-issues.js +173 -0
- package/target/main/ts/report/html/app/viewer-language-bar.d.ts +11 -0
- package/target/main/ts/report/html/app/viewer-language-bar.js +76 -0
- package/target/main/ts/report/html/app/viewer-languages.d.ts +35 -0
- package/target/main/ts/report/html/app/viewer-languages.js +97 -0
- package/target/main/ts/report/html/app/viewer-layout.d.ts +14 -0
- package/target/main/ts/report/html/app/viewer-layout.js +134 -0
- package/target/main/ts/report/html/app/viewer-line-coverage.d.ts +47 -0
- package/target/main/ts/report/html/app/viewer-line-coverage.js +108 -0
- package/target/main/ts/report/html/app/viewer-locations.d.ts +16 -0
- package/target/main/ts/report/html/app/viewer-locations.js +31 -0
- package/target/main/ts/report/html/app/viewer-map-scale.d.ts +26 -0
- package/target/main/ts/report/html/app/viewer-map-scale.js +147 -0
- package/target/main/ts/report/html/app/viewer-map-shape.d.ts +42 -0
- package/target/main/ts/report/html/app/viewer-map-shape.js +102 -0
- package/target/main/ts/report/html/app/viewer-metric-format.d.ts +23 -0
- package/target/main/ts/report/html/app/viewer-metric-format.js +93 -0
- package/target/main/ts/report/html/app/viewer-metric-registry.d.ts +47 -0
- package/target/main/ts/report/html/app/viewer-metric-registry.js +138 -0
- package/target/main/ts/report/html/app/viewer-metrics-view.d.ts +4 -0
- package/target/main/ts/report/html/app/viewer-metrics-view.js +159 -0
- package/target/main/ts/report/html/app/viewer-metrics.d.ts +51 -0
- package/target/main/ts/report/html/app/viewer-metrics.js +195 -0
- package/target/main/ts/report/html/app/viewer-overview-cards.d.ts +12 -0
- package/target/main/ts/report/html/app/viewer-overview-cards.js +121 -0
- package/target/main/ts/report/html/app/viewer-overview-hotspots.d.ts +9 -0
- package/target/main/ts/report/html/app/viewer-overview-hotspots.js +173 -0
- package/target/main/ts/report/html/app/viewer-overview-lead.d.ts +12 -0
- package/target/main/ts/report/html/app/viewer-overview-lead.js +116 -0
- package/target/main/ts/report/html/app/viewer-profile-badges.d.ts +11 -0
- package/target/main/ts/report/html/app/viewer-profile-badges.js +119 -0
- package/target/main/ts/report/html/app/viewer-profile-table.d.ts +29 -0
- package/target/main/ts/report/html/app/viewer-profile-table.js +124 -0
- package/target/main/ts/report/html/app/viewer-profile.d.ts +13 -0
- package/target/main/ts/report/html/app/viewer-profile.js +180 -0
- package/target/main/ts/report/html/app/viewer-projects.d.ts +1 -0
- package/target/main/ts/report/html/app/viewer-projects.js +90 -0
- package/target/main/ts/report/html/app/viewer-pull-sections.d.ts +4 -0
- package/target/main/ts/report/html/app/viewer-pull-sections.js +118 -0
- package/target/main/ts/report/html/app/viewer-pull-trend.d.ts +5 -0
- package/target/main/ts/report/html/app/viewer-pull-trend.js +63 -0
- package/target/main/ts/report/html/app/viewer-pulls.d.ts +2 -0
- package/target/main/ts/report/html/app/viewer-pulls.js +92 -0
- package/target/main/ts/report/html/app/viewer-query-field.d.ts +19 -0
- package/target/main/ts/report/html/app/viewer-query-field.js +203 -0
- package/target/main/ts/report/html/app/viewer-route.d.ts +34 -0
- package/target/main/ts/report/html/app/viewer-route.js +55 -0
- package/target/main/ts/report/html/app/viewer-shell.d.ts +20 -0
- package/target/main/ts/report/html/app/viewer-shell.js +113 -0
- package/target/main/ts/report/html/app/viewer-source-view.d.ts +49 -0
- package/target/main/ts/report/html/app/viewer-source-view.js +150 -0
- package/target/main/ts/report/html/app/viewer-source.d.ts +27 -0
- package/target/main/ts/report/html/app/viewer-source.js +57 -0
- package/target/main/ts/report/html/app/viewer-suggest.d.ts +13 -0
- package/target/main/ts/report/html/app/viewer-suggest.js +91 -0
- package/target/main/ts/report/html/app/viewer-sunburst.d.ts +5 -0
- package/target/main/ts/report/html/app/viewer-sunburst.js +40 -0
- package/target/main/ts/report/html/app/viewer-table-cells.d.ts +25 -0
- package/target/main/ts/report/html/app/viewer-table-cells.js +135 -0
- package/target/main/ts/report/html/app/viewer-table-rows.d.ts +56 -0
- package/target/main/ts/report/html/app/viewer-table-rows.js +97 -0
- package/target/main/ts/report/html/app/viewer-tokenizer.d.ts +15 -0
- package/target/main/ts/report/html/app/viewer-tokenizer.js +241 -0
- package/target/main/ts/report/html/app/viewer-totals.d.ts +20 -0
- package/target/main/ts/report/html/app/viewer-totals.js +100 -0
- package/target/main/ts/report/html/app/viewer-treemap.d.ts +24 -0
- package/target/main/ts/report/html/app/viewer-treemap.js +112 -0
- package/target/main/ts/report/html/app/viewer-trend-data.d.ts +54 -0
- package/target/main/ts/report/html/app/viewer-trend-data.js +109 -0
- package/target/main/ts/report/html/app/viewer-trend-nav.d.ts +5 -0
- package/target/main/ts/report/html/app/viewer-trend-nav.js +86 -0
- package/target/main/ts/report/html/app/viewer-trend-points.d.ts +30 -0
- package/target/main/ts/report/html/app/viewer-trend-points.js +128 -0
- package/target/main/ts/report/html/app/viewer-trend-series.d.ts +32 -0
- package/target/main/ts/report/html/app/viewer-trend-series.js +128 -0
- package/target/main/ts/report/html/app/viewer-trends.d.ts +5 -0
- package/target/main/ts/report/html/app/viewer-trends.js +89 -0
- package/target/main/ts/report/html/app/viewer.d.ts +1 -0
- package/target/main/ts/report/html/app/viewer.js +222 -0
- package/target/main/ts/report/html/site/badges.d.ts +11 -0
- package/target/main/ts/report/html/site/badges.js +72 -0
- package/target/main/ts/report/html/site/export-site.d.ts +16 -0
- package/target/main/ts/report/html/site/export-site.js +129 -0
- package/target/main/ts/report/html/site/exported-server.d.ts +6 -0
- package/target/main/ts/report/html/site/exported-server.js +72 -0
- package/target/main/ts/report/html/site/local-server.d.ts +7 -0
- package/target/main/ts/report/html/site/local-server.js +59 -0
- package/target/main/ts/report/html/site/projects.d.ts +1 -0
- package/target/main/ts/report/html/site/projects.js +69 -0
- package/target/main/ts/report/html/site/server.d.ts +4 -0
- package/target/main/ts/report/html/site/server.js +65 -0
- package/target/main/ts/report/html/site/source-route.d.ts +6 -0
- package/target/main/ts/report/html/site/source-route.js +23 -0
- package/target/main/ts/report/json/projections/commit-summary.d.ts +13 -0
- package/target/main/ts/report/json/projections/commit-summary.js +125 -0
- package/target/main/ts/report/json/projections/components.d.ts +4 -0
- package/target/main/ts/report/json/projections/components.js +30 -0
- package/target/main/ts/report/json/projections/file-metrics.d.ts +4 -0
- package/target/main/ts/report/json/projections/file-metrics.js +260 -0
- package/target/main/ts/report/json/projections/ignore-view.d.ts +2 -0
- package/target/main/ts/report/json/projections/ignore-view.js +13 -0
- package/target/main/ts/report/json/projections/inspection-context.d.ts +5 -0
- package/target/main/ts/report/json/projections/inspection-context.js +104 -0
- package/target/main/ts/report/json/projections/inspection-details.d.ts +14 -0
- package/target/main/ts/report/json/projections/inspection-details.js +98 -0
- package/target/main/ts/report/json/projections/metric-values.d.ts +14 -0
- package/target/main/ts/report/json/projections/metric-values.js +104 -0
- package/target/main/ts/report/json/projections/profile-selectors.d.ts +8 -0
- package/target/main/ts/report/json/projections/profile-selectors.js +34 -0
- package/target/main/ts/report/json/projections/security-summary.d.ts +11 -0
- package/target/main/ts/report/json/projections/security-summary.js +22 -0
- package/target/main/ts/report/json/store/directory.d.ts +3 -0
- package/target/main/ts/report/json/store/directory.js +19 -0
- package/target/main/ts/report/json/store/local-store.d.ts +25 -0
- package/target/main/ts/report/json/store/local-store.js +214 -0
- package/target/main/ts/report/json/store/object-store.d.ts +14 -0
- package/target/main/ts/report/json/store/object-store.js +73 -0
- package/target/main/ts/report/json/store/operation-cache.d.ts +8 -0
- package/target/main/ts/report/json/store/operation-cache.js +32 -0
- package/target/main/ts/report/json/store/pull-review-store.d.ts +2 -0
- package/target/main/ts/report/json/store/pull-review-store.js +33 -0
- package/target/main/ts/report/json/store/replace-file.d.ts +1 -0
- package/target/main/ts/report/json/store/replace-file.js +35 -0
- package/target/main/ts/report/json/store/report-tree.d.ts +46 -0
- package/target/main/ts/report/json/store/report-tree.js +295 -0
- package/target/main/ts/report/json/store/store-check.d.ts +32 -0
- package/target/main/ts/report/json/store/store-check.js +153 -0
- package/target/main/ts/report/json/validation/metabranch.d.ts +4 -0
- package/target/main/ts/report/json/validation/metabranch.js +11 -0
- package/target/main/ts/report/json/validation/report.d.ts +20 -0
- package/target/main/ts/report/json/validation/report.js +77 -0
- package/target/main/ts/report/json/validation/summary-validation.d.ts +4 -0
- package/target/main/ts/report/json/validation/summary-validation.js +26 -0
- package/target/main/ts/report/json/wire/compact-json.d.ts +11 -0
- package/target/main/ts/report/json/wire/compact-json.js +76 -0
- package/target/main/ts/report/json/wire/component-model.d.ts +9 -0
- package/target/main/ts/report/json/wire/component-model.js +1 -0
- package/target/main/ts/report/json/wire/domain-types.d.ts +2 -0
- package/target/main/ts/report/json/wire/domain-types.js +1 -0
- package/target/main/ts/report/json/wire/file-metrics-model.d.ts +81 -0
- package/target/main/ts/report/json/wire/file-metrics-model.js +1 -0
- package/target/main/ts/report/json/wire/inspection-context-model.d.ts +31 -0
- package/target/main/ts/report/json/wire/inspection-context-model.js +1 -0
- package/target/main/ts/report/json/wire/inspection-details-model.d.ts +87 -0
- package/target/main/ts/report/json/wire/inspection-details-model.js +1 -0
- package/target/main/ts/report/json/wire/project-model.d.ts +7 -0
- package/target/main/ts/report/json/wire/project-model.js +1 -0
- package/target/main/ts/report/json/wire/public-history-model.d.ts +36 -0
- package/target/main/ts/report/json/wire/public-history-model.js +5 -0
- package/target/main/ts/report/json/wire/pull-review-model.d.ts +54 -0
- package/target/main/ts/report/json/wire/pull-review-model.js +3 -0
- package/target/main/ts/report/json/wire/summary-model.d.ts +45 -0
- package/target/main/ts/report/json/wire/summary-model.js +1 -0
- package/target/main/ts/report/markdown/pull-review.d.ts +5 -0
- package/target/main/ts/report/markdown/pull-review.js +132 -0
- package/target/main/ts/report.d.ts +23 -0
- package/target/main/ts/report.js +12 -0
- package/target/main/ts/runtime.d.ts +17 -0
- package/target/main/ts/runtime.js +30 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { isClass, isFunction, isIdentifier, isMemberExpression, isObjectExpression, isStringLiteral } from '@babel/types';
|
|
2
|
+
import { children } from './function-facts.js';
|
|
3
|
+
/**
|
|
4
|
+
* Names every function by the classes, object literals and functions around it, joined with dots, as in
|
|
5
|
+
* `commands.review.run`. A function without a name of its own is `(anonymous)` in the anchors of it and its contents.
|
|
6
|
+
*/
|
|
7
|
+
export function qualifiedNames(ast) {
|
|
8
|
+
const names = new Map();
|
|
9
|
+
const scope = [];
|
|
10
|
+
visit(ast, undefined);
|
|
11
|
+
return names;
|
|
12
|
+
function visit(node, parent) {
|
|
13
|
+
const own = segment(node, parent);
|
|
14
|
+
const opens = own !== undefined || isFunction(node);
|
|
15
|
+
if (isFunction(node)) {
|
|
16
|
+
const anchor = [...scope, own ?? '(anonymous)'].join('.');
|
|
17
|
+
names.set(node, own === undefined ? { anchor } : { name: anchor, anchor });
|
|
18
|
+
}
|
|
19
|
+
if (opens)
|
|
20
|
+
scope.push(own ?? '(anonymous)');
|
|
21
|
+
for (const child of children(node))
|
|
22
|
+
visit(child, node);
|
|
23
|
+
if (opens)
|
|
24
|
+
scope.pop();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function segment(node, parent) {
|
|
28
|
+
if (isFunction(node))
|
|
29
|
+
return ('id' in node && node.id ? node.id.name : 'key' in node ? keyName(node.key) : undefined)
|
|
30
|
+
?? binding(node, parent);
|
|
31
|
+
if (isClass(node))
|
|
32
|
+
return node.id?.name ?? binding(node, parent);
|
|
33
|
+
return isObjectExpression(node) ? binding(node, parent) : undefined;
|
|
34
|
+
}
|
|
35
|
+
/** The name a value takes from the declaration, property or assignment that holds it. */
|
|
36
|
+
function binding(node, parent) {
|
|
37
|
+
switch (parent?.type) {
|
|
38
|
+
case 'VariableDeclarator':
|
|
39
|
+
return parent.init === node && isIdentifier(parent.id) ? parent.id.name : undefined;
|
|
40
|
+
case 'ObjectProperty':
|
|
41
|
+
case 'ClassProperty':
|
|
42
|
+
case 'ClassPrivateProperty':
|
|
43
|
+
return parent.value === node ? keyName(parent.key) : undefined;
|
|
44
|
+
case 'AssignmentExpression': {
|
|
45
|
+
if (parent.right !== node)
|
|
46
|
+
return undefined;
|
|
47
|
+
const target = parent.left;
|
|
48
|
+
if (isIdentifier(target))
|
|
49
|
+
return target.name;
|
|
50
|
+
return isMemberExpression(target) && !target.computed && isIdentifier(target.property) ? target.property.name : undefined;
|
|
51
|
+
}
|
|
52
|
+
default:
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function keyName(key) {
|
|
57
|
+
if (isIdentifier(key))
|
|
58
|
+
return key.name;
|
|
59
|
+
if (isStringLiteral(key))
|
|
60
|
+
return key.value;
|
|
61
|
+
return key.type === 'PrivateName' ? `#${key.id.name}` : undefined;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=qualified-names.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Node } from '@babel/types';
|
|
2
|
+
import type { FunctionComplexity, StructuralObservation } from '@repometry/core/internal/model/code-structure.js';
|
|
3
|
+
import type { FunctionNaming } from './qualified-names.js';
|
|
4
|
+
export declare function structuralObservations(ast: Node, names: ReadonlyMap<Node, FunctionNaming>): {
|
|
5
|
+
observations: StructuralObservation[];
|
|
6
|
+
cognitiveFunctions: FunctionComplexity[];
|
|
7
|
+
cognitiveComplexity: number;
|
|
8
|
+
classes: number;
|
|
9
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { isClass, isFunction } from '@babel/types';
|
|
2
|
+
import { children } from './function-facts.js';
|
|
3
|
+
const complexityBlocks = new Set([
|
|
4
|
+
'IfStatement', 'ConditionalExpression', 'ForStatement', 'ForInStatement', 'ForOfStatement',
|
|
5
|
+
'WhileStatement', 'DoWhileStatement', 'CatchClause', 'SwitchStatement',
|
|
6
|
+
]);
|
|
7
|
+
export function structuralObservations(ast, names) {
|
|
8
|
+
const observations = [];
|
|
9
|
+
const cognitiveFunctions = [];
|
|
10
|
+
let cognitive = 0;
|
|
11
|
+
let classes = 0;
|
|
12
|
+
const topLevel = { cognitive: 0, returns: 0, maxNesting: 0 };
|
|
13
|
+
visit(ast, topLevel, 0);
|
|
14
|
+
if (topLevel.nestedRange !== undefined)
|
|
15
|
+
observe('nested-control-flow', topLevel.maxNesting, 'Module control-flow depth', topLevel.nestedRange);
|
|
16
|
+
cognitive += topLevel.cognitive;
|
|
17
|
+
observe('file-complexity', cognitive, 'File cognitive complexity');
|
|
18
|
+
return { observations, cognitiveFunctions, cognitiveComplexity: cognitive, classes };
|
|
19
|
+
function visit(node, frame, depth, parent) {
|
|
20
|
+
if (isClass(node))
|
|
21
|
+
classes++;
|
|
22
|
+
if (isFunction(node) && node.body) {
|
|
23
|
+
const naming = names.get(node);
|
|
24
|
+
const own = { cognitive: 0, returns: 0, maxNesting: 0, anchor: naming?.anchor };
|
|
25
|
+
visit(node.body, own, 0, node);
|
|
26
|
+
for (const parameter of node.params)
|
|
27
|
+
visit(parameter, own, 0, node);
|
|
28
|
+
const name = naming?.name;
|
|
29
|
+
const start = node.loc?.start;
|
|
30
|
+
cognitiveFunctions.push({ line: start?.line,
|
|
31
|
+
column: start === undefined ? undefined : start.column + 1, name, value: own.cognitive });
|
|
32
|
+
const label = name ?? '(anonymous)';
|
|
33
|
+
cognitive += own.cognitive;
|
|
34
|
+
observe('function-parameters', node.params.length, `${label} · Parameters`, node, own.anchor);
|
|
35
|
+
observe('return-statements', own.returns, `${label} · Return statements`, node, own.anchor);
|
|
36
|
+
observe('function-complexity', own.cognitive, `${label} · Cognitive complexity`, node, own.anchor);
|
|
37
|
+
if (own.nestedRange !== undefined) {
|
|
38
|
+
observe('nested-control-flow', own.maxNesting, `${label} · Control-flow depth`, own.nestedRange, own.anchor);
|
|
39
|
+
}
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (node.type === 'ReturnStatement')
|
|
43
|
+
frame.returns++;
|
|
44
|
+
if ((node.type === 'BreakStatement' || node.type === 'ContinueStatement') && node.label)
|
|
45
|
+
frame.cognitive++;
|
|
46
|
+
if (node.type === 'LogicalExpression') {
|
|
47
|
+
if (parent?.type !== 'LogicalExpression' || parent.operator !== node.operator)
|
|
48
|
+
frame.cognitive++;
|
|
49
|
+
if (parent?.type !== 'LogicalExpression') {
|
|
50
|
+
observe('boolean-logic', countLogicalOperators(node), 'Logical operators in one expression', node, frame.anchor);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const block = complexityBlocks.has(node.type);
|
|
54
|
+
const chained = node.type === 'IfStatement' && parent?.type === 'IfStatement' && parent.alternate === node;
|
|
55
|
+
if (block) {
|
|
56
|
+
frame.cognitive += chained ? 1 : 1 + depth;
|
|
57
|
+
if (depth + 1 > frame.maxNesting) {
|
|
58
|
+
frame.maxNesting = depth + 1;
|
|
59
|
+
frame.nestedRange = node;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
for (const child of children(node)) {
|
|
63
|
+
if (node.type === 'IfStatement' && child === node.alternate) {
|
|
64
|
+
if (child.type === 'IfStatement')
|
|
65
|
+
visit(child, frame, depth, node);
|
|
66
|
+
else {
|
|
67
|
+
frame.cognitive++;
|
|
68
|
+
visit(child, frame, depth + 1, node);
|
|
69
|
+
}
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
visit(child, frame, depth + Number(block), node);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function observe(rule, value, label, location, anchor) {
|
|
76
|
+
observations.push({ rule, value, label, line: location?.loc?.start.line, endLine: location?.loc?.end.line,
|
|
77
|
+
...(anchor === undefined ? {} : { anchor }) });
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function countLogicalOperators(node) {
|
|
81
|
+
if (node.type !== 'LogicalExpression')
|
|
82
|
+
return 0;
|
|
83
|
+
return 1 + countLogicalOperators(node.left) + countLogicalOperators(node.right);
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=structural-observations.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const jsSyntax = {
|
|
2
|
+
lineComments: ['//'],
|
|
3
|
+
blockComments: [['/*', '*/']],
|
|
4
|
+
strings: [{ quote: "'" }, { quote: '"' }, { quote: '`', multiline: true }],
|
|
5
|
+
keywords: ('abstract as async await break case catch class const continue debugger declare default delete do else enum '
|
|
6
|
+
+ 'export extends false finally for from function get if implements import in instanceof interface let new null of '
|
|
7
|
+
+ 'package private protected public readonly return satisfies set static super switch this throw true try type typeof '
|
|
8
|
+
+ 'undefined var void while with yield').split(' '),
|
|
9
|
+
regexAfter: 'return typeof instanceof in of new delete void throw case do else yield await'.split(' '),
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=syntax.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { pluginApi } from '@repometry/core/internal/engine/plugin.js';
|
|
2
|
+
import { codeStructure, structureCodeLines } from '@repometry/core/internal/model/code-structure.js';
|
|
3
|
+
import { findingResult } from '@repometry/core/internal/model/finding.js';
|
|
4
|
+
import { definitions } from '@repometry/core/internal/model/measurement.js';
|
|
5
|
+
import { sourceFile } from '@repometry/core/internal/model/snapshot.js';
|
|
6
|
+
import { structuralRules } from '@repometry/core/internal/profile/maintainability.js';
|
|
7
|
+
import { structuralSmells } from './structural-smells.js';
|
|
8
|
+
export const maintainability = {
|
|
9
|
+
id: 'maintainability', version: '1.0.0', api: pluginApi,
|
|
10
|
+
kinds: ['analysis'],
|
|
11
|
+
produces: [{ contract: findingResult.id, persistence: 'report', metrics: [
|
|
12
|
+
{ id: definitions.cognitiveComplexity, label: 'Cognitive complexity', unit: 'count', scope: 'file', aggregate: 'sum',
|
|
13
|
+
better: 'lower', group: 'Maintainability' },
|
|
14
|
+
{ id: definitions.classes, label: 'Classes', unit: 'count', scope: 'file', aggregate: 'sum', better: 'none', group: 'Size' },
|
|
15
|
+
{ id: definitions.codeLines, label: 'Lines of code', short: 'Code lines', unit: 'count', scope: 'file', aggregate: 'sum', better: 'none',
|
|
16
|
+
group: 'Size' },
|
|
17
|
+
{ id: definitions.comments, label: 'Comment lines', unit: 'count', scope: 'file', aggregate: 'sum', better: 'none', group: 'Size' },
|
|
18
|
+
] }],
|
|
19
|
+
rules: Object.entries(structuralRules).map(([id, { limit, minutesPerExcess }]) => ({ id, category: 'structure', defaults: { limit, cost: minutesPerExcess } })),
|
|
20
|
+
operations: [{
|
|
21
|
+
id: 'file', role: 'inspection', inputs: { syntax: codeStructure, source: sourceFile }, output: findingResult,
|
|
22
|
+
execute(inputs) {
|
|
23
|
+
const facts = inputs.read('syntax', codeStructure);
|
|
24
|
+
const { path, observations = [], cognitiveFunctions = [], cognitiveComplexity, classes, commentLines } = facts;
|
|
25
|
+
const codeLines = structureCodeLines(facts);
|
|
26
|
+
const counts = [[definitions.cognitiveComplexity, cognitiveComplexity], [definitions.classes, classes],
|
|
27
|
+
[definitions.codeLines, codeLines?.length], [definitions.comments, commentLines]];
|
|
28
|
+
return {
|
|
29
|
+
findings: structuralSmells(path, observations),
|
|
30
|
+
measurements: [
|
|
31
|
+
...cognitiveFunctions.map(({ line, column, name, value }) => ({ definition: definitions.cognitiveComplexity, target: 'function', path, line, column, name, value })),
|
|
32
|
+
...counts.flatMap(([definition, value]) => value === undefined ? [] : [{ definition, target: 'file', path, value }]),
|
|
33
|
+
],
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
}],
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=maintainability.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { StructuralObservation } from '@repometry/core/internal/model/code-structure.js';
|
|
2
|
+
import type { Finding } from '@repometry/core/internal/model/finding.js';
|
|
3
|
+
export declare function structuralSmells(path: string, observations: readonly StructuralObservation[]): Finding[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { structuralRules } from '@repometry/core/internal/profile/maintainability.js';
|
|
2
|
+
export function structuralSmells(path, observations) {
|
|
3
|
+
const findings = [];
|
|
4
|
+
const functionLimit = structuralRules['function-complexity'].limit;
|
|
5
|
+
const functionExcess = observations.reduce((total, { rule, value }) => total + (rule === 'function-complexity' ? Math.max(0, value - functionLimit) : 0), 0);
|
|
6
|
+
for (const { rule, value, label, line, endLine, anchor } of observations) {
|
|
7
|
+
const { limit, minutesPerExcess } = structuralRules[rule];
|
|
8
|
+
if (value <= limit)
|
|
9
|
+
continue;
|
|
10
|
+
const chargedExcess = rule === 'file-complexity' ? Math.max(0, value - limit - functionExcess) : value - limit;
|
|
11
|
+
findings.push({ tool: 'repometry', rule, category: 'structure', level: 'medium', path,
|
|
12
|
+
message: `${label} ${value} (limit ${limit})`, line, endLine, effortMinutes: chargedExcess * minutesPerExcess,
|
|
13
|
+
value, limit, anchor: anchor ?? '(file)' });
|
|
14
|
+
}
|
|
15
|
+
return findings;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=structural-smells.js.map
|