@vyuhlabs/dxkit 2.4.5 → 2.4.7
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/CHANGELOG.md +1022 -0
- package/README.md +160 -45
- package/dist/analysis-result.d.ts +112 -0
- package/dist/analysis-result.d.ts.map +1 -0
- package/dist/analysis-result.js +52 -0
- package/dist/analysis-result.js.map +1 -0
- package/dist/analyzers/bom/detailed.d.ts.map +1 -1
- package/dist/analyzers/bom/detailed.js +19 -0
- package/dist/analyzers/bom/detailed.js.map +1 -1
- package/dist/analyzers/bom/gather.d.ts +27 -26
- package/dist/analyzers/bom/gather.d.ts.map +1 -1
- package/dist/analyzers/bom/gather.js +26 -87
- package/dist/analyzers/bom/gather.js.map +1 -1
- package/dist/analyzers/bom/index.d.ts +0 -7
- package/dist/analyzers/bom/index.d.ts.map +1 -1
- package/dist/analyzers/bom/index.js +98 -48
- package/dist/analyzers/bom/index.js.map +1 -1
- package/dist/analyzers/bom/types.d.ts +11 -13
- package/dist/analyzers/bom/types.d.ts.map +1 -1
- package/dist/analyzers/cache.d.ts +95 -0
- package/dist/analyzers/cache.d.ts.map +1 -0
- package/dist/analyzers/cache.js +309 -0
- package/dist/analyzers/cache.js.map +1 -0
- package/dist/analyzers/coverage-runner.d.ts +56 -0
- package/dist/analyzers/coverage-runner.d.ts.map +1 -0
- package/dist/analyzers/coverage-runner.js +72 -0
- package/dist/analyzers/coverage-runner.js.map +1 -0
- package/dist/analyzers/dashboard/index.d.ts +24 -0
- package/dist/analyzers/dashboard/index.d.ts.map +1 -0
- package/dist/analyzers/dashboard/index.js +666 -0
- package/dist/analyzers/dashboard/index.js.map +1 -0
- package/dist/analyzers/developer/gather.d.ts.map +1 -1
- package/dist/analyzers/developer/gather.js +205 -37
- package/dist/analyzers/developer/gather.js.map +1 -1
- package/dist/analyzers/developer/index.d.ts +1 -1
- package/dist/analyzers/developer/index.d.ts.map +1 -1
- package/dist/analyzers/developer/index.js +19 -8
- package/dist/analyzers/developer/index.js.map +1 -1
- package/dist/analyzers/dispatcher.d.ts +37 -0
- package/dist/analyzers/dispatcher.d.ts.map +1 -1
- package/dist/analyzers/dispatcher.js +56 -9
- package/dist/analyzers/dispatcher.js.map +1 -1
- package/dist/analyzers/docs/shallow.d.ts +17 -5
- package/dist/analyzers/docs/shallow.d.ts.map +1 -1
- package/dist/analyzers/docs/shallow.js +65 -2
- package/dist/analyzers/docs/shallow.js.map +1 -1
- package/dist/analyzers/dx/shallow.d.ts +17 -5
- package/dist/analyzers/dx/shallow.d.ts.map +1 -1
- package/dist/analyzers/dx/shallow.js +66 -2
- package/dist/analyzers/dx/shallow.js.map +1 -1
- package/dist/analyzers/health/actions.d.ts +1 -1
- package/dist/analyzers/health/actions.d.ts.map +1 -1
- package/dist/analyzers/health/actions.js +27 -9
- package/dist/analyzers/health/actions.js.map +1 -1
- package/dist/analyzers/health/detailed.d.ts +2 -1
- package/dist/analyzers/health/detailed.d.ts.map +1 -1
- package/dist/analyzers/health/detailed.js +11 -7
- package/dist/analyzers/health/detailed.js.map +1 -1
- package/dist/analyzers/health.d.ts +27 -0
- package/dist/analyzers/health.d.ts.map +1 -1
- package/dist/analyzers/health.js +271 -33
- package/dist/analyzers/health.js.map +1 -1
- package/dist/analyzers/licenses/gather.d.ts +35 -8
- package/dist/analyzers/licenses/gather.d.ts.map +1 -1
- package/dist/analyzers/licenses/gather.js +70 -13
- package/dist/analyzers/licenses/gather.js.map +1 -1
- package/dist/analyzers/licenses/index.d.ts +1 -1
- package/dist/analyzers/licenses/index.d.ts.map +1 -1
- package/dist/analyzers/licenses/index.js +52 -11
- package/dist/analyzers/licenses/index.js.map +1 -1
- package/dist/analyzers/licenses/types.d.ts +15 -0
- package/dist/analyzers/licenses/types.d.ts.map +1 -1
- package/dist/analyzers/maintainability/shallow.d.ts +17 -5
- package/dist/analyzers/maintainability/shallow.d.ts.map +1 -1
- package/dist/analyzers/maintainability/shallow.js +80 -2
- package/dist/analyzers/maintainability/shallow.js.map +1 -1
- package/dist/analyzers/quality/detailed.d.ts.map +1 -1
- package/dist/analyzers/quality/detailed.js +4 -6
- package/dist/analyzers/quality/detailed.js.map +1 -1
- package/dist/analyzers/quality/gather.d.ts +1 -14
- package/dist/analyzers/quality/gather.d.ts.map +1 -1
- package/dist/analyzers/quality/gather.js +48 -137
- package/dist/analyzers/quality/gather.js.map +1 -1
- package/dist/analyzers/quality/index.d.ts +9 -2
- package/dist/analyzers/quality/index.d.ts.map +1 -1
- package/dist/analyzers/quality/index.js +189 -117
- package/dist/analyzers/quality/index.js.map +1 -1
- package/dist/analyzers/quality/shallow.d.ts +50 -5
- package/dist/analyzers/quality/shallow.d.ts.map +1 -1
- package/dist/analyzers/quality/shallow.js +155 -2
- package/dist/analyzers/quality/shallow.js.map +1 -1
- package/dist/analyzers/quality/types.d.ts +14 -0
- package/dist/analyzers/quality/types.d.ts.map +1 -1
- package/dist/analyzers/security/actions.d.ts +11 -4
- package/dist/analyzers/security/actions.d.ts.map +1 -1
- package/dist/analyzers/security/actions.js +87 -37
- package/dist/analyzers/security/actions.js.map +1 -1
- package/dist/analyzers/security/aggregator.d.ts +236 -0
- package/dist/analyzers/security/aggregator.d.ts.map +1 -0
- package/dist/analyzers/security/aggregator.js +347 -0
- package/dist/analyzers/security/aggregator.js.map +1 -0
- package/dist/analyzers/security/detailed.d.ts +2 -2
- package/dist/analyzers/security/detailed.d.ts.map +1 -1
- package/dist/analyzers/security/detailed.js +10 -9
- package/dist/analyzers/security/detailed.js.map +1 -1
- package/dist/analyzers/security/gather.d.ts +103 -1
- package/dist/analyzers/security/gather.d.ts.map +1 -1
- package/dist/analyzers/security/gather.js +281 -9
- package/dist/analyzers/security/gather.js.map +1 -1
- package/dist/analyzers/security/index.d.ts +15 -0
- package/dist/analyzers/security/index.d.ts.map +1 -1
- package/dist/analyzers/security/index.js +463 -50
- package/dist/analyzers/security/index.js.map +1 -1
- package/dist/analyzers/security/shallow.d.ts +50 -6
- package/dist/analyzers/security/shallow.d.ts.map +1 -1
- package/dist/analyzers/security/shallow.js +154 -2
- package/dist/analyzers/security/shallow.js.map +1 -1
- package/dist/analyzers/security/types.d.ts +51 -0
- package/dist/analyzers/security/types.d.ts.map +1 -1
- package/dist/analyzers/tests/detailed.d.ts.map +1 -1
- package/dist/analyzers/tests/detailed.js +2 -3
- package/dist/analyzers/tests/detailed.js.map +1 -1
- package/dist/analyzers/tests/gather.d.ts +2 -1
- package/dist/analyzers/tests/gather.d.ts.map +1 -1
- package/dist/analyzers/tests/gather.js +98 -69
- package/dist/analyzers/tests/gather.js.map +1 -1
- package/dist/analyzers/tests/index.d.ts +11 -2
- package/dist/analyzers/tests/index.d.ts.map +1 -1
- package/dist/analyzers/tests/index.js +85 -18
- package/dist/analyzers/tests/index.js.map +1 -1
- package/dist/analyzers/tests/shallow.d.ts +19 -5
- package/dist/analyzers/tests/shallow.d.ts.map +1 -1
- package/dist/analyzers/tests/shallow.js +89 -2
- package/dist/analyzers/tests/shallow.js.map +1 -1
- package/dist/analyzers/tests/types.d.ts +41 -1
- package/dist/analyzers/tests/types.d.ts.map +1 -1
- package/dist/analyzers/tools/autogen-header.d.ts +8 -0
- package/dist/analyzers/tools/autogen-header.d.ts.map +1 -0
- package/dist/analyzers/tools/autogen-header.js +107 -0
- package/dist/analyzers/tools/autogen-header.js.map +1 -0
- package/dist/analyzers/tools/cloc.d.ts.map +1 -1
- package/dist/analyzers/tools/cloc.js +36 -5
- package/dist/analyzers/tools/cloc.js.map +1 -1
- package/dist/analyzers/tools/coverage.d.ts +1 -1
- package/dist/analyzers/tools/coverage.d.ts.map +1 -1
- package/dist/analyzers/tools/coverage.js.map +1 -1
- package/dist/analyzers/tools/debug-statements.d.ts +17 -0
- package/dist/analyzers/tools/debug-statements.d.ts.map +1 -0
- package/dist/analyzers/tools/debug-statements.js +58 -0
- package/dist/analyzers/tools/debug-statements.js.map +1 -0
- package/dist/analyzers/tools/default-exclusions.gitignore +28 -0
- package/dist/analyzers/tools/exclusions.d.ts +33 -6
- package/dist/analyzers/tools/exclusions.d.ts.map +1 -1
- package/dist/analyzers/tools/exclusions.js +95 -26
- package/dist/analyzers/tools/exclusions.js.map +1 -1
- package/dist/analyzers/tools/generic.d.ts +17 -2
- package/dist/analyzers/tools/generic.d.ts.map +1 -1
- package/dist/analyzers/tools/generic.js +206 -109
- package/dist/analyzers/tools/generic.js.map +1 -1
- package/dist/analyzers/tools/gitleaks.d.ts.map +1 -1
- package/dist/analyzers/tools/gitleaks.js +48 -1
- package/dist/analyzers/tools/gitleaks.js.map +1 -1
- package/dist/analyzers/tools/graphify.d.ts +30 -2
- package/dist/analyzers/tools/graphify.d.ts.map +1 -1
- package/dist/analyzers/tools/graphify.js +131 -15
- package/dist/analyzers/tools/graphify.js.map +1 -1
- package/dist/analyzers/tools/jscpd.d.ts +12 -2
- package/dist/analyzers/tools/jscpd.d.ts.map +1 -1
- package/dist/analyzers/tools/jscpd.js +129 -6
- package/dist/analyzers/tools/jscpd.js.map +1 -1
- package/dist/analyzers/tools/minified-detection.d.ts +9 -0
- package/dist/analyzers/tools/minified-detection.d.ts.map +1 -0
- package/dist/analyzers/tools/minified-detection.js +147 -0
- package/dist/analyzers/tools/minified-detection.js.map +1 -0
- package/dist/analyzers/tools/nuget-package-reference.d.ts +131 -0
- package/dist/analyzers/tools/nuget-package-reference.d.ts.map +1 -0
- package/dist/analyzers/tools/nuget-package-reference.js +175 -0
- package/dist/analyzers/tools/nuget-package-reference.js.map +1 -0
- package/dist/analyzers/tools/osv-scanner-deps.d.ts +48 -0
- package/dist/analyzers/tools/osv-scanner-deps.d.ts.map +1 -0
- package/dist/analyzers/tools/{osv-scanner-maven.js → osv-scanner-deps.js} +78 -46
- package/dist/analyzers/tools/osv-scanner-deps.js.map +1 -0
- package/dist/analyzers/tools/osv.d.ts +36 -0
- package/dist/analyzers/tools/osv.d.ts.map +1 -1
- package/dist/analyzers/tools/osv.js +26 -0
- package/dist/analyzers/tools/osv.js.map +1 -1
- package/dist/analyzers/tools/parallel.d.ts +1 -1
- package/dist/analyzers/tools/parallel.d.ts.map +1 -1
- package/dist/analyzers/tools/parallel.js +2 -2
- package/dist/analyzers/tools/parallel.js.map +1 -1
- package/dist/analyzers/tools/risk-score.d.ts +7 -0
- package/dist/analyzers/tools/risk-score.d.ts.map +1 -1
- package/dist/analyzers/tools/risk-score.js +9 -2
- package/dist/analyzers/tools/risk-score.js.map +1 -1
- package/dist/analyzers/tools/run-tests-helper.d.ts +43 -0
- package/dist/analyzers/tools/run-tests-helper.d.ts.map +1 -0
- package/dist/analyzers/tools/run-tests-helper.js +156 -0
- package/dist/analyzers/tools/run-tests-helper.js.map +1 -0
- package/dist/analyzers/tools/runner.d.ts.map +1 -1
- package/dist/analyzers/tools/runner.js +75 -12
- package/dist/analyzers/tools/runner.js.map +1 -1
- package/dist/analyzers/tools/semgrep.d.ts +39 -2
- package/dist/analyzers/tools/semgrep.d.ts.map +1 -1
- package/dist/analyzers/tools/semgrep.js +131 -9
- package/dist/analyzers/tools/semgrep.js.map +1 -1
- package/dist/analyzers/tools/timing.d.ts +17 -3
- package/dist/analyzers/tools/timing.d.ts.map +1 -1
- package/dist/analyzers/tools/timing.js +36 -14
- package/dist/analyzers/tools/timing.js.map +1 -1
- package/dist/analyzers/tools/tool-registry.d.ts +10 -0
- package/dist/analyzers/tools/tool-registry.d.ts.map +1 -1
- package/dist/analyzers/tools/tool-registry.js +120 -1
- package/dist/analyzers/tools/tool-registry.js.map +1 -1
- package/dist/analyzers/tools/tools-unavailable-prose.d.ts +18 -0
- package/dist/analyzers/tools/tools-unavailable-prose.d.ts.map +1 -0
- package/dist/analyzers/tools/tools-unavailable-prose.js +69 -0
- package/dist/analyzers/tools/tools-unavailable-prose.js.map +1 -0
- package/dist/analyzers/tools/upgrade-plan-resolver.d.ts.map +1 -1
- package/dist/analyzers/tools/upgrade-plan-resolver.js +7 -0
- package/dist/analyzers/tools/upgrade-plan-resolver.js.map +1 -1
- package/dist/analyzers/tools/vendored-advisor.d.ts +43 -0
- package/dist/analyzers/tools/vendored-advisor.d.ts.map +1 -0
- package/dist/analyzers/tools/vendored-advisor.js +107 -0
- package/dist/analyzers/tools/vendored-advisor.js.map +1 -0
- package/dist/analyzers/tools/walk-paths.d.ts +78 -0
- package/dist/analyzers/tools/walk-paths.d.ts.map +1 -0
- package/dist/analyzers/tools/walk-paths.js +150 -0
- package/dist/analyzers/tools/walk-paths.js.map +1 -0
- package/dist/analyzers/tools/walk-source-files.d.ts +70 -0
- package/dist/analyzers/tools/walk-source-files.d.ts.map +1 -0
- package/dist/analyzers/tools/walk-source-files.js +369 -0
- package/dist/analyzers/tools/walk-source-files.js.map +1 -0
- package/dist/analyzers/types.d.ts +204 -4
- package/dist/analyzers/types.d.ts.map +1 -1
- package/dist/analyzers/xlsx/bom.d.ts.map +1 -1
- package/dist/analyzers/xlsx/bom.js +8 -1
- package/dist/analyzers/xlsx/bom.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +557 -189
- package/dist/cli.js.map +1 -1
- package/dist/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/detect.d.ts.map +1 -1
- package/dist/detect.js +24 -7
- package/dist/detect.js.map +1 -1
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +103 -53
- package/dist/doctor.js.map +1 -1
- package/dist/languages/capabilities/provider.d.ts +130 -1
- package/dist/languages/capabilities/provider.d.ts.map +1 -1
- package/dist/languages/capabilities/types.d.ts +68 -7
- package/dist/languages/capabilities/types.d.ts.map +1 -1
- package/dist/languages/csharp.d.ts +15 -1
- package/dist/languages/csharp.d.ts.map +1 -1
- package/dist/languages/csharp.js +624 -146
- package/dist/languages/csharp.js.map +1 -1
- package/dist/languages/go.d.ts.map +1 -1
- package/dist/languages/go.js +89 -11
- package/dist/languages/go.js.map +1 -1
- package/dist/languages/index.d.ts +131 -2
- package/dist/languages/index.d.ts.map +1 -1
- package/dist/languages/index.js +208 -0
- package/dist/languages/index.js.map +1 -1
- package/dist/languages/java.d.ts.map +1 -1
- package/dist/languages/java.js +121 -32
- package/dist/languages/java.js.map +1 -1
- package/dist/languages/kotlin.d.ts.map +1 -1
- package/dist/languages/kotlin.js +140 -32
- package/dist/languages/kotlin.js.map +1 -1
- package/dist/languages/python.d.ts.map +1 -1
- package/dist/languages/python.js +149 -44
- package/dist/languages/python.js.map +1 -1
- package/dist/languages/ruby.d.ts +115 -0
- package/dist/languages/ruby.d.ts.map +1 -0
- package/dist/languages/ruby.js +665 -0
- package/dist/languages/ruby.js.map +1 -0
- package/dist/languages/rust.d.ts.map +1 -1
- package/dist/languages/rust.js +103 -16
- package/dist/languages/rust.js.map +1 -1
- package/dist/languages/types.d.ts +228 -5
- package/dist/languages/types.d.ts.map +1 -1
- package/dist/languages/typescript.d.ts.map +1 -1
- package/dist/languages/typescript.js +201 -14
- package/dist/languages/typescript.js.map +1 -1
- package/dist/scoring/dimensions/documentation.d.ts +53 -0
- package/dist/scoring/dimensions/documentation.d.ts.map +1 -0
- package/dist/scoring/dimensions/documentation.js +106 -0
- package/dist/scoring/dimensions/documentation.js.map +1 -0
- package/dist/scoring/dimensions/dx.d.ts +53 -0
- package/dist/scoring/dimensions/dx.d.ts.map +1 -0
- package/dist/scoring/dimensions/dx.js +105 -0
- package/dist/scoring/dimensions/dx.js.map +1 -0
- package/dist/scoring/dimensions/maintainability.d.ts +53 -0
- package/dist/scoring/dimensions/maintainability.d.ts.map +1 -0
- package/dist/scoring/dimensions/maintainability.js +101 -0
- package/dist/scoring/dimensions/maintainability.js.map +1 -0
- package/dist/scoring/dimensions/quality.d.ts +108 -0
- package/dist/scoring/dimensions/quality.d.ts.map +1 -0
- package/dist/scoring/dimensions/quality.js +174 -0
- package/dist/scoring/dimensions/quality.js.map +1 -0
- package/dist/scoring/dimensions/security.d.ts +84 -0
- package/dist/scoring/dimensions/security.d.ts.map +1 -0
- package/dist/scoring/dimensions/security.js +135 -0
- package/dist/scoring/dimensions/security.js.map +1 -0
- package/dist/scoring/dimensions/testing.d.ts +56 -0
- package/dist/scoring/dimensions/testing.d.ts.map +1 -0
- package/dist/scoring/dimensions/testing.js +98 -0
- package/dist/scoring/dimensions/testing.js.map +1 -0
- package/dist/scoring/evaluator.d.ts +27 -0
- package/dist/scoring/evaluator.d.ts.map +1 -0
- package/dist/scoring/evaluator.js +124 -0
- package/dist/scoring/evaluator.js.map +1 -0
- package/dist/scoring/format.d.ts +34 -0
- package/dist/scoring/format.d.ts.map +1 -0
- package/dist/scoring/format.js +63 -0
- package/dist/scoring/format.js.map +1 -0
- package/dist/scoring/index.d.ts +37 -0
- package/dist/scoring/index.d.ts.map +1 -0
- package/dist/scoring/index.js +57 -0
- package/dist/scoring/index.js.map +1 -0
- package/dist/scoring/overall.d.ts +54 -0
- package/dist/scoring/overall.d.ts.map +1 -0
- package/dist/scoring/overall.js +76 -0
- package/dist/scoring/overall.js.map +1 -0
- package/dist/scoring/result.d.ts +111 -0
- package/dist/scoring/result.d.ts.map +1 -0
- package/dist/scoring/result.js +14 -0
- package/dist/scoring/result.js.map +1 -0
- package/dist/scoring/spec.d.ts +76 -0
- package/dist/scoring/spec.d.ts.map +1 -0
- package/dist/scoring/spec.js +22 -0
- package/dist/scoring/spec.js.map +1 -0
- package/dist/scoring/thresholds.d.ts +56 -0
- package/dist/scoring/thresholds.d.ts.map +1 -0
- package/dist/scoring/thresholds.js +75 -0
- package/dist/scoring/thresholds.js.map +1 -0
- package/dist/tools-cli.d.ts.map +1 -1
- package/dist/tools-cli.js +21 -2
- package/dist/tools-cli.js.map +1 -1
- package/dist/types.d.ts +17 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/templates/.claude/commands/dashboard.md +17 -9
- package/templates/.claude/rules/ruby.md +11 -0
- package/templates/configs/ruby/README.md +6 -0
- package/dist/analyzers/scoring.d.ts +0 -49
- package/dist/analyzers/scoring.d.ts.map +0 -1
- package/dist/analyzers/scoring.js +0 -422
- package/dist/analyzers/scoring.js.map +0 -1
- package/dist/analyzers/security/scoring.d.ts +0 -29
- package/dist/analyzers/security/scoring.d.ts.map +0 -1
- package/dist/analyzers/security/scoring.js +0 -40
- package/dist/analyzers/security/scoring.js.map +0 -1
- package/dist/analyzers/tools/osv-scanner-maven.d.ts +0 -42
- package/dist/analyzers/tools/osv-scanner-maven.d.ts.map +0 -1
- package/dist/analyzers/tools/osv-scanner-maven.js.map +0 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Developer Experience dimension — declarative scoring spec.
|
|
3
|
+
*
|
|
4
|
+
* Methodology: subtractive checklist over operational-readiness
|
|
5
|
+
* signals — CI configuration, container build, pre-commit hooks,
|
|
6
|
+
* Makefile or task-runner equivalent, .env.example, automation
|
|
7
|
+
* entry-points (npm scripts), CONTRIBUTING guide, substantial
|
|
8
|
+
* README, CHANGELOG. Baseline 100; each missing or substandard
|
|
9
|
+
* artifact deducts points sized by its importance to onboarding
|
|
10
|
+
* speed and contributor friction.
|
|
11
|
+
*
|
|
12
|
+
* Shape mirrors OpenSSF Scorecard's weighted-checks model. dxkit's
|
|
13
|
+
* specific point allocations are documented in
|
|
14
|
+
* `src/scoring/STANDARDS.md` Layer 3 (no single Layer-1 standard
|
|
15
|
+
* prescribes DevEx checklists; these values are dxkit's own choice
|
|
16
|
+
* weighted to favor CI + Docker + .env.example + automation scripts
|
|
17
|
+
* — the artifacts most directly tied to repository onboarding).
|
|
18
|
+
*
|
|
19
|
+
* The "subtractive over checklist" framing (rather than the
|
|
20
|
+
* additive-from-zero shape used pre-2.4.7) means
|
|
21
|
+
* `ScoreResult.deductions` reads as missing items the customer can
|
|
22
|
+
* fix — uniform actionable semantics across all six dimensions.
|
|
23
|
+
* Numeric scores are unchanged from the pre-inversion additive form.
|
|
24
|
+
*
|
|
25
|
+
* No caps in this spec. The baseline + penalty distribution enforce
|
|
26
|
+
* the rating contract by construction.
|
|
27
|
+
*/
|
|
28
|
+
import type { DimensionScoringSpec } from '../spec';
|
|
29
|
+
export interface DxScoreInput {
|
|
30
|
+
/** Count of CI workflow files discovered (e.g. .github/workflows/*,
|
|
31
|
+
* .circleci/config.yml, .gitlab-ci.yml). */
|
|
32
|
+
ciConfigCount: number;
|
|
33
|
+
/** Count of Dockerfile / compose / Containerfile artifacts. */
|
|
34
|
+
dockerConfigCount: number;
|
|
35
|
+
/** Count of pre-commit hook configs (.husky, .pre-commit-config.yaml). */
|
|
36
|
+
precommitConfigCount: number;
|
|
37
|
+
/** Top-level Makefile or task-runner equivalent. */
|
|
38
|
+
makefileExists: boolean;
|
|
39
|
+
/** `.env.example` (or `.env.sample`) present — onboarding hint
|
|
40
|
+
* about required env vars without leaking real values. */
|
|
41
|
+
envExampleExists: boolean;
|
|
42
|
+
/** Count of npm scripts (or equivalent task entry-points). */
|
|
43
|
+
npmScriptsCount: number;
|
|
44
|
+
/** CONTRIBUTING.md present. */
|
|
45
|
+
contributingExists: boolean;
|
|
46
|
+
/** Line count of the discovered README. Adds a small penalty when
|
|
47
|
+
* the README is too thin to onboard a new contributor. */
|
|
48
|
+
readmeLines: number;
|
|
49
|
+
/** CHANGELOG.md present. */
|
|
50
|
+
changelogExists: boolean;
|
|
51
|
+
}
|
|
52
|
+
export declare const DX_SCORING_SPEC: DimensionScoringSpec<DxScoreInput>;
|
|
53
|
+
//# sourceMappingURL=dx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dx.d.ts","sourceRoot":"","sources":["../../../src/scoring/dimensions/dx.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,MAAM,WAAW,YAAY;IAC3B;iDAC6C;IAC7C,aAAa,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,iBAAiB,EAAE,MAAM,CAAC;IAC1B,0EAA0E;IAC1E,oBAAoB,EAAE,MAAM,CAAC;IAC7B,oDAAoD;IACpD,cAAc,EAAE,OAAO,CAAC;IACxB;+DAC2D;IAC3D,gBAAgB,EAAE,OAAO,CAAC;IAC1B,8DAA8D;IAC9D,eAAe,EAAE,MAAM,CAAC;IACxB,+BAA+B;IAC/B,kBAAkB,EAAE,OAAO,CAAC;IAC5B;+DAC2D;IAC3D,WAAW,EAAE,MAAM,CAAC;IACpB,4BAA4B;IAC5B,eAAe,EAAE,OAAO,CAAC;CAC1B;AAUD,eAAO,MAAM,eAAe,EAAE,oBAAoB,CAAC,YAAY,CAgE9D,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Developer Experience dimension — declarative scoring spec.
|
|
4
|
+
*
|
|
5
|
+
* Methodology: subtractive checklist over operational-readiness
|
|
6
|
+
* signals — CI configuration, container build, pre-commit hooks,
|
|
7
|
+
* Makefile or task-runner equivalent, .env.example, automation
|
|
8
|
+
* entry-points (npm scripts), CONTRIBUTING guide, substantial
|
|
9
|
+
* README, CHANGELOG. Baseline 100; each missing or substandard
|
|
10
|
+
* artifact deducts points sized by its importance to onboarding
|
|
11
|
+
* speed and contributor friction.
|
|
12
|
+
*
|
|
13
|
+
* Shape mirrors OpenSSF Scorecard's weighted-checks model. dxkit's
|
|
14
|
+
* specific point allocations are documented in
|
|
15
|
+
* `src/scoring/STANDARDS.md` Layer 3 (no single Layer-1 standard
|
|
16
|
+
* prescribes DevEx checklists; these values are dxkit's own choice
|
|
17
|
+
* weighted to favor CI + Docker + .env.example + automation scripts
|
|
18
|
+
* — the artifacts most directly tied to repository onboarding).
|
|
19
|
+
*
|
|
20
|
+
* The "subtractive over checklist" framing (rather than the
|
|
21
|
+
* additive-from-zero shape used pre-2.4.7) means
|
|
22
|
+
* `ScoreResult.deductions` reads as missing items the customer can
|
|
23
|
+
* fix — uniform actionable semantics across all six dimensions.
|
|
24
|
+
* Numeric scores are unchanged from the pre-inversion additive form.
|
|
25
|
+
*
|
|
26
|
+
* No caps in this spec. The baseline + penalty distribution enforce
|
|
27
|
+
* the rating contract by construction.
|
|
28
|
+
*/
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.DX_SCORING_SPEC = void 0;
|
|
31
|
+
/** Automation-scripts penalty: tiered shortfall from the recommended 8+. */
|
|
32
|
+
function automationPenalty(i) {
|
|
33
|
+
if (i.npmScriptsCount >= 8)
|
|
34
|
+
return 0;
|
|
35
|
+
if (i.npmScriptsCount >= 4)
|
|
36
|
+
return -5;
|
|
37
|
+
if (i.npmScriptsCount >= 1)
|
|
38
|
+
return -10;
|
|
39
|
+
return -15;
|
|
40
|
+
}
|
|
41
|
+
exports.DX_SCORING_SPEC = {
|
|
42
|
+
dimension: 'dx',
|
|
43
|
+
methodology: 'openssf-scorecard-shape',
|
|
44
|
+
baseline: 100,
|
|
45
|
+
penalties: [
|
|
46
|
+
{
|
|
47
|
+
id: 'ci-missing',
|
|
48
|
+
describe: () => `no CI workflow files configured`,
|
|
49
|
+
applies: (i) => i.ciConfigCount === 0,
|
|
50
|
+
delta: () => -20,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: 'docker-missing',
|
|
54
|
+
describe: () => `no container build configured (Dockerfile / compose)`,
|
|
55
|
+
applies: (i) => i.dockerConfigCount === 0,
|
|
56
|
+
delta: () => -15,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: 'precommit-hooks-missing',
|
|
60
|
+
describe: () => `no pre-commit hooks configured`,
|
|
61
|
+
applies: (i) => i.precommitConfigCount === 0,
|
|
62
|
+
delta: () => -10,
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: 'makefile-missing',
|
|
66
|
+
describe: () => `no Makefile (task-runner entry-point)`,
|
|
67
|
+
applies: (i) => !i.makefileExists,
|
|
68
|
+
delta: () => -10,
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: 'env-example-missing',
|
|
72
|
+
describe: () => `.env.example missing (env-var onboarding hint)`,
|
|
73
|
+
applies: (i) => !i.envExampleExists,
|
|
74
|
+
delta: () => -10,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: 'automation-scripts-short',
|
|
78
|
+
describe: (i) => i.npmScriptsCount === 0
|
|
79
|
+
? `no npm-script entry-points (recommended ≥ 8)`
|
|
80
|
+
: `${i.npmScriptsCount} npm-script entry-point(s); recommended ≥ 8`,
|
|
81
|
+
applies: (i) => automationPenalty(i) < 0,
|
|
82
|
+
delta: automationPenalty,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
id: 'contributing-missing',
|
|
86
|
+
describe: () => `CONTRIBUTING.md missing`,
|
|
87
|
+
applies: (i) => !i.contributingExists,
|
|
88
|
+
delta: () => -10,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: 'readme-thin-for-onboarding',
|
|
92
|
+
describe: (i) => `README is thin (${i.readmeLines} lines; recommended > 50 for onboarding)`,
|
|
93
|
+
applies: (i) => i.readmeLines <= 50,
|
|
94
|
+
delta: () => -5,
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: 'changelog-missing',
|
|
98
|
+
describe: () => `CHANGELOG.md missing`,
|
|
99
|
+
applies: (i) => !i.changelogExists,
|
|
100
|
+
delta: () => -5,
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
caps: [],
|
|
104
|
+
};
|
|
105
|
+
//# sourceMappingURL=dx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dx.js","sourceRoot":"","sources":["../../../src/scoring/dimensions/dx.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;AA4BH,4EAA4E;AAC5E,SAAS,iBAAiB,CAAC,CAAe;IACxC,IAAI,CAAC,CAAC,eAAe,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IACrC,IAAI,CAAC,CAAC,eAAe,IAAI,CAAC;QAAE,OAAO,CAAC,CA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,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE;SACjB;QACD;YACE,EAAE,EAAE,0BAA0B;YAC9B,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CACd,CAAC,CAAC,eAAe,KAAK,CAAC;gBACrB,CAAC,CAAC,8CAA8C;gBAChD,CAAC,CAAC,GAAG,CAAC,CAAC,eAAe,6CAA6C;YACvE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC,GAAG,CAAC;YACxC,KAAK,EAAE,iBAAiB;SACzB;QACD;YACE,EAAE,EAAE,sBAAsB;YAC1B,QAAQ,EAAE,GAAG,EAAE,CAAC,yBAAyB;YACzC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,kBAAkB;YACrC,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE;SACjB;QACD;YACE,EAAE,EAAE,4BAA4B;YAChC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,mBAAmB,CAAC,CAAC,WAAW,0CAA0C;YAC3F,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,IAAI,EAAE;YACnC,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;SAChB;QACD;YACE,EAAE,EAAE,mBAAmB;YACvB,QAAQ,EAAE,GAAG,EAAE,CAAC,sBAAsB;YACtC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,eAAe;YAClC,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;SAChB;KACF;IACD,IAAI,EAAE,EAAE;CACT,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maintainability dimension — declarative scoring spec.
|
|
3
|
+
*
|
|
4
|
+
* Methodology: ISO/IEC 25010 maintainability sub-characteristics
|
|
5
|
+
* (modularity, modifiability, analysability) combined with the
|
|
6
|
+
* SQALE method (Letouzey 2012) for the "technical debt produces
|
|
7
|
+
* downgraded rating" mental model. Step-style penalty thresholds
|
|
8
|
+
* are calibrated so a single major violation drops the rating one
|
|
9
|
+
* tier — matching SQALE rating-band semantics on typical repos
|
|
10
|
+
* without requiring a dynamic per-repo debt-ratio computation.
|
|
11
|
+
*
|
|
12
|
+
* Penalty rules cover the canonical Maintainability violation
|
|
13
|
+
* classes: god files (single largest file), file-size sprawl
|
|
14
|
+
* (count of files past the recommended-extraction line), runtime
|
|
15
|
+
* console/debug residue, outdated language runtimes, AST-derived
|
|
16
|
+
* god-classes (graphify), and low architectural cohesion.
|
|
17
|
+
*
|
|
18
|
+
* No caps in this spec. The full-marks-minus-violations baseline
|
|
19
|
+
* (100, subtractive) plus the calibrated penalty values produce
|
|
20
|
+
* the rating contract by construction: a fully clean repo lands
|
|
21
|
+
* at A, a repo with one major violation lands at B, a deeply
|
|
22
|
+
* troubled repo lands at D or E. The Label Contract emerges from
|
|
23
|
+
* the math; no cap is needed to enforce it externally.
|
|
24
|
+
*
|
|
25
|
+
* Behavior change from pre-2.4.7: the legacy scorer baseline was
|
|
26
|
+
* 70 (with a "small-repo bonus" of +5/+10 to compensate). The new
|
|
27
|
+
* baseline is 100 with no special-case bonus — small-repo bonus
|
|
28
|
+
* was an overfit, removed. Customers with healthy codebases
|
|
29
|
+
* will see Maintainability scores rise by ~30 points; documented
|
|
30
|
+
* in the 2.4.7 CHANGELOG.
|
|
31
|
+
*/
|
|
32
|
+
import type { DimensionScoringSpec } from '../spec';
|
|
33
|
+
export interface MaintainabilityScoreInput {
|
|
34
|
+
/** Total source-file count. Denominator for `godNodeCount` density. */
|
|
35
|
+
sourceFiles: number;
|
|
36
|
+
/** Largest single source file by line count (the "god file" probe). */
|
|
37
|
+
largestFileLines: number;
|
|
38
|
+
/** Count of source files exceeding 500 lines. */
|
|
39
|
+
filesOver500Lines: number;
|
|
40
|
+
/** Console / debugger statement count across source. */
|
|
41
|
+
consoleLogCount: number;
|
|
42
|
+
/** `engines.node` field from package.json, e.g. ">=14.0.0", or null
|
|
43
|
+
* for non-Node projects. */
|
|
44
|
+
nodeEngineVersion: string | null;
|
|
45
|
+
/** From graphify: count of "god" AST nodes (classes / files with
|
|
46
|
+
* ≥ N functions or methods). Null when graphify didn't run. */
|
|
47
|
+
godNodeCount: number | null;
|
|
48
|
+
/** From graphify: average inter-module cohesion (0.0–1.0). Null when
|
|
49
|
+
* graphify didn't run. */
|
|
50
|
+
avgCohesion: number | null;
|
|
51
|
+
}
|
|
52
|
+
export declare const MAINTAINABILITY_SCORING_SPEC: DimensionScoringSpec<MaintainabilityScoreInput>;
|
|
53
|
+
//# sourceMappingURL=maintainability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maintainability.d.ts","sourceRoot":"","sources":["../../../src/scoring/dimensions/maintainability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,MAAM,WAAW,yBAAyB;IACxC,uEAAuE;IACvE,WAAW,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,gBAAgB,EAAE,MAAM,CAAC;IACzB,iDAAiD;IACjD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,wDAAwD;IACxD,eAAe,EAAE,MAAM,CAAC;IACxB;iCAC6B;IAC7B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC;oEACgE;IAChE,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;+BAC2B;IAC3B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AASD,eAAO,MAAM,4BAA4B,EAAE,oBAAoB,CAAC,yBAAyB,CA4DxF,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Maintainability dimension — declarative scoring spec.
|
|
4
|
+
*
|
|
5
|
+
* Methodology: ISO/IEC 25010 maintainability sub-characteristics
|
|
6
|
+
* (modularity, modifiability, analysability) combined with the
|
|
7
|
+
* SQALE method (Letouzey 2012) for the "technical debt produces
|
|
8
|
+
* downgraded rating" mental model. Step-style penalty thresholds
|
|
9
|
+
* are calibrated so a single major violation drops the rating one
|
|
10
|
+
* tier — matching SQALE rating-band semantics on typical repos
|
|
11
|
+
* without requiring a dynamic per-repo debt-ratio computation.
|
|
12
|
+
*
|
|
13
|
+
* Penalty rules cover the canonical Maintainability violation
|
|
14
|
+
* classes: god files (single largest file), file-size sprawl
|
|
15
|
+
* (count of files past the recommended-extraction line), runtime
|
|
16
|
+
* console/debug residue, outdated language runtimes, AST-derived
|
|
17
|
+
* god-classes (graphify), and low architectural cohesion.
|
|
18
|
+
*
|
|
19
|
+
* No caps in this spec. The full-marks-minus-violations baseline
|
|
20
|
+
* (100, subtractive) plus the calibrated penalty values produce
|
|
21
|
+
* the rating contract by construction: a fully clean repo lands
|
|
22
|
+
* at A, a repo with one major violation lands at B, a deeply
|
|
23
|
+
* troubled repo lands at D or E. The Label Contract emerges from
|
|
24
|
+
* the math; no cap is needed to enforce it externally.
|
|
25
|
+
*
|
|
26
|
+
* Behavior change from pre-2.4.7: the legacy scorer baseline was
|
|
27
|
+
* 70 (with a "small-repo bonus" of +5/+10 to compensate). The new
|
|
28
|
+
* baseline is 100 with no special-case bonus — small-repo bonus
|
|
29
|
+
* was an overfit, removed. Customers with healthy codebases
|
|
30
|
+
* will see Maintainability scores rise by ~30 points; documented
|
|
31
|
+
* in the 2.4.7 CHANGELOG.
|
|
32
|
+
*/
|
|
33
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
|
+
exports.MAINTAINABILITY_SCORING_SPEC = void 0;
|
|
35
|
+
/** Parse the major node-engine version from a semver-range string. */
|
|
36
|
+
function nodeEngineMajor(engine) {
|
|
37
|
+
if (!engine)
|
|
38
|
+
return null;
|
|
39
|
+
const match = engine.match(/(\d+)/);
|
|
40
|
+
return match ? parseInt(match[1], 10) : null;
|
|
41
|
+
}
|
|
42
|
+
exports.MAINTAINABILITY_SCORING_SPEC = {
|
|
43
|
+
dimension: 'maintainability',
|
|
44
|
+
methodology: 'iso-iec-25010-maintainability + sqale-inspired-thresholds',
|
|
45
|
+
baseline: 100,
|
|
46
|
+
penalties: [
|
|
47
|
+
{
|
|
48
|
+
id: 'largest-file-size',
|
|
49
|
+
describe: (i) => `largest source file is ${i.largestFileLines} lines`,
|
|
50
|
+
applies: (i) => i.largestFileLines > 1000,
|
|
51
|
+
delta: (i) => i.largestFileLines > 10000
|
|
52
|
+
? -25
|
|
53
|
+
: i.largestFileLines > 5000
|
|
54
|
+
? -15
|
|
55
|
+
: i.largestFileLines > 2000
|
|
56
|
+
? -10
|
|
57
|
+
: -5,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: 'files-over-500-density',
|
|
61
|
+
describe: (i) => `${i.filesOver500Lines} files over 500 lines (extraction recommended)`,
|
|
62
|
+
applies: (i) => i.filesOver500Lines > 5,
|
|
63
|
+
delta: (i) => (i.filesOver500Lines > 30 ? -15 : i.filesOver500Lines > 15 ? -10 : -5),
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: 'console-statements',
|
|
67
|
+
describe: (i) => `${i.consoleLogCount} console/debug statements in source`,
|
|
68
|
+
applies: (i) => i.consoleLogCount > 100,
|
|
69
|
+
delta: (i) => (i.consoleLogCount > 500 ? -10 : -5),
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: 'outdated-node-engine',
|
|
73
|
+
describe: (i) => `Node.js engine ${i.nodeEngineVersion} predates current LTS`,
|
|
74
|
+
applies: (i) => {
|
|
75
|
+
const major = nodeEngineMajor(i.nodeEngineVersion);
|
|
76
|
+
return major !== null && major < 18;
|
|
77
|
+
},
|
|
78
|
+
delta: (i) => {
|
|
79
|
+
const major = nodeEngineMajor(i.nodeEngineVersion);
|
|
80
|
+
return major !== null && major < 16 ? -10 : -5;
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: 'god-node-density',
|
|
85
|
+
describe: (i) => `${i.godNodeCount} god classes / files (high function-count concentration)`,
|
|
86
|
+
applies: (i) => i.godNodeCount !== null && i.godNodeCount / Math.max(i.sourceFiles, 1) > 0.05,
|
|
87
|
+
delta: (i) => {
|
|
88
|
+
const ratio = (i.godNodeCount ?? 0) / Math.max(i.sourceFiles, 1);
|
|
89
|
+
return ratio > 0.1 ? -10 : -5;
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: 'low-architectural-cohesion',
|
|
94
|
+
describe: (i) => `average inter-module cohesion ${i.avgCohesion?.toFixed(2)} (below 0.15 threshold)`,
|
|
95
|
+
applies: (i) => i.avgCohesion !== null && i.avgCohesion < 0.15,
|
|
96
|
+
delta: () => -5,
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
caps: [],
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=maintainability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maintainability.js","sourceRoot":"","sources":["../../../src/scoring/dimensions/maintainability.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;;;AAwBH,sEAAsE;AACtE,SAAS,eAAe,CAAC,MAAqB;IAC5C,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACpC,OAAO,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC/C,CAAC;AAEY,QAAA,4BAA4B,GAAoD;IAC3F,SAAS,EAAE,iBAAiB;IAC5B,WAAW,EAAE,2DAA2D;IACxE,QAAQ,EAAE,GAAG;IACb,SA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A4B;YAChC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CACd,iCAAiC,CAAC,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,yBAAyB;YACrF,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,KAAK,IAAI,IAAI,CAAC,CAAC,WAAW,GAAG,IAAI;YAC9D,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;SAChB;KACF;IACD,IAAI,EAAE,EAAE;CACT,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Quality dimension — declarative scoring spec.
|
|
3
|
+
*
|
|
4
|
+
* Methodology: ISO/IEC 25010 maintainability sub-characteristics
|
|
5
|
+
* (modularity, reusability, analysability, modifiability, testability)
|
|
6
|
+
* combined with industry-conventional thresholds for density-based
|
|
7
|
+
* code-smell signals (lint, console statements, `any` types, type
|
|
8
|
+
* errors, duplication, comment ratio, hygiene markers).
|
|
9
|
+
*
|
|
10
|
+
* Penalty rules cover signal classes that scale with repo size
|
|
11
|
+
* (density-based) and absolute thresholds (file-size, structural
|
|
12
|
+
* complexity, duplication, hygiene). Each rule surfaces a discrete
|
|
13
|
+
* Deduction with a human-readable reason on the resulting
|
|
14
|
+
* ScoreResult.
|
|
15
|
+
*
|
|
16
|
+
* Cap rules encode the Label Contract: an unmeasured dimension
|
|
17
|
+
* can't honestly claim a top-tier rating regardless of how clean
|
|
18
|
+
* the grep-derived signals look.
|
|
19
|
+
*
|
|
20
|
+
* unmeasured (35) all 3 signal-source tools unmeasured
|
|
21
|
+
* (lint + duplication + structural)
|
|
22
|
+
* partial-uncertainty (75) at least one signal-source tool
|
|
23
|
+
* unmeasured but not all three
|
|
24
|
+
*
|
|
25
|
+
* Both caps key off `lintAvailable`, `duplicationAvailable`, and
|
|
26
|
+
* `structuralAvailable` flags carried on the input — adapters set
|
|
27
|
+
* these from each capability's presence.
|
|
28
|
+
*
|
|
29
|
+
* Adapters that build `QualityScoreInput` from their domain data:
|
|
30
|
+
*
|
|
31
|
+
* - Health side: `src/analyzers/quality/shallow.ts:toQualityScoreInput`
|
|
32
|
+
* reads from `ScoreInput { metrics, capabilities }`.
|
|
33
|
+
* - Standalone side: `src/analyzers/quality/index.ts:qualityMetricsToScoreInput`
|
|
34
|
+
* reads from the assembled `QualityMetrics`.
|
|
35
|
+
*
|
|
36
|
+
* Both adapters land on this same input shape; both dispatch through
|
|
37
|
+
* the same spec; both observe identical scores. The cache builder
|
|
38
|
+
* shares the underlying counts across the two paths so the density
|
|
39
|
+
* denominators are byte-identical.
|
|
40
|
+
*/
|
|
41
|
+
import type { DimensionScoringSpec } from '../spec';
|
|
42
|
+
/**
|
|
43
|
+
* Clean partition of every signal the unified Quality formula
|
|
44
|
+
* penalizes. Adapters at each consumer side build this shape from
|
|
45
|
+
* their respective data sources; the formula is consumer-agnostic.
|
|
46
|
+
*/
|
|
47
|
+
export interface QualityScoreInput {
|
|
48
|
+
/** Total source-file count, used as the denominator for every
|
|
49
|
+
* density-based penalty. The adapters MUST pass the same
|
|
50
|
+
* source-file count the rest of the report cites — drift here
|
|
51
|
+
* would let two consumers compute different densities from the
|
|
52
|
+
* same raw counts. */
|
|
53
|
+
sourceFiles: number;
|
|
54
|
+
/** Critical + high lint errors. Density-penalized. */
|
|
55
|
+
lintErrors: number;
|
|
56
|
+
/** True when at least one lint tool ran cleanly on this repo.
|
|
57
|
+
* Drives the honesty cap — a repo where eslint/ruff didn't run
|
|
58
|
+
* can't honestly claim a top-tier Quality score. */
|
|
59
|
+
lintAvailable: boolean;
|
|
60
|
+
/** Console / debugger statement count. Density-penalized — a
|
|
61
|
+
* repo of 10K files with 200 such statements is much cleaner
|
|
62
|
+
* than a repo of 100 files with the same 200. */
|
|
63
|
+
consoleLogCount: number;
|
|
64
|
+
/** TODO / FIXME / HACK comments (sum penalized as one signal). */
|
|
65
|
+
todoCount: number;
|
|
66
|
+
fixmeCount: number;
|
|
67
|
+
hackCount: number;
|
|
68
|
+
/** Stale files committed to git (.swp, .bak, .orig, temp files). */
|
|
69
|
+
staleFiles: number;
|
|
70
|
+
/** Whether `.js` files appear alongside `.ts` files in the same
|
|
71
|
+
* source directory (suggests in-progress migration that's stalled). */
|
|
72
|
+
mixedLanguages: boolean;
|
|
73
|
+
/** Files exceeding 500 lines. Step-penalized at 5 and 20. */
|
|
74
|
+
filesOver500Lines: number;
|
|
75
|
+
/** Largest single source file by line count. Step-penalized at
|
|
76
|
+
* 5K and 10K — the 5K threshold is the "should have been split"
|
|
77
|
+
* bar; the 10K threshold is "this is a god-file." */
|
|
78
|
+
largestFileLines: number;
|
|
79
|
+
/** `any` type annotations across source. Density-penalized. */
|
|
80
|
+
anyTypeCount: number;
|
|
81
|
+
/** TypeScript compile errors when typecheck ran; null when no
|
|
82
|
+
* typecheck signal was available (no `tsc` config, non-TS repo,
|
|
83
|
+
* or typecheck not invoked). Density-penalized when present. */
|
|
84
|
+
typeErrors: number | null;
|
|
85
|
+
/** Percentage of source covered by duplicated blocks; null when
|
|
86
|
+
* jscpd didn't run. Step-penalized at 5% and 15%. */
|
|
87
|
+
duplicationPercentage: number | null;
|
|
88
|
+
/** True when jscpd produced data. Drives the honesty cap. */
|
|
89
|
+
duplicationAvailable: boolean;
|
|
90
|
+
/** Maximum functions in a single source file; null when graphify
|
|
91
|
+
* didn't run. Penalized at > 50. */
|
|
92
|
+
maxFunctionsInFile: number | null;
|
|
93
|
+
/** Imports that are declared but never resolved to a project
|
|
94
|
+
* source file. Penalized at > 20. Null when graphify didn't run. */
|
|
95
|
+
deadImportCount: number | null;
|
|
96
|
+
/** Source files with no inbound imports. Penalized at > 30. Null
|
|
97
|
+
* when graphify didn't run. */
|
|
98
|
+
orphanModuleCount: number | null;
|
|
99
|
+
/** True when graphify produced data. Drives the honesty cap. */
|
|
100
|
+
structuralAvailable: boolean;
|
|
101
|
+
/** Comment-line ratio across source (0.0–1.0). Step-penalized at
|
|
102
|
+
* 0.4 and 0.5 — beyond ~40% of source being comment, the file is
|
|
103
|
+
* doing more documenting than coding, which usually signals dead
|
|
104
|
+
* code that hasn't been deleted. Null when cloc didn't run. */
|
|
105
|
+
commentRatio: number | null;
|
|
106
|
+
}
|
|
107
|
+
export declare const QUALITY_SCORING_SPEC: DimensionScoringSpec<QualityScoreInput>;
|
|
108
|
+
//# sourceMappingURL=quality.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quality.d.ts","sourceRoot":"","sources":["../../../src/scoring/dimensions/quality.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;2BAIuB;IACvB,WAAW,EAAE,MAAM,CAAC;IAEpB,sDAAsD;IACtD,UAAU,EAAE,MAAM,CAAC;IACnB;;yDAEqD;IACrD,aAAa,EAAE,OAAO,CAAC;IAEvB;;sDAEkD;IAClD,eAAe,EAAE,MAAM,CAAC;IACxB,kEAAkE;IAClE,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,UAAU,EAAE,MAAM,CAAC;IACnB;4EACwE;IACxE,cAAc,EAAE,OAAO,CAAC;IAExB,6DAA6D;IAC7D,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;0DAEsD;IACtD,gBAAgB,EAAE,MAAM,CAAC;IAEzB,+DAA+D;IAC/D,YAAY,EAAE,MAAM,CAAC;IACrB;;qEAEiE;IACjE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B;0DACsD;IACtD,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,6DAA6D;IAC7D,oBAAoB,EAAE,OAAO,CAAC;IAE9B;yCACqC;IACrC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC;yEACqE;IACrE,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B;oCACgC;IAChC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,gEAAgE;IAChE,mBAAmB,EAAE,OAAO,CAAC;IAE7B;;;oEAGgE;IAChE,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAOD,eAAO,MAAM,oBAAoB,EAAE,oBAAoB,CAAC,iBAAiB,CA2HxE,CAAC"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Code Quality dimension — declarative scoring spec.
|
|
4
|
+
*
|
|
5
|
+
* Methodology: ISO/IEC 25010 maintainability sub-characteristics
|
|
6
|
+
* (modularity, reusability, analysability, modifiability, testability)
|
|
7
|
+
* combined with industry-conventional thresholds for density-based
|
|
8
|
+
* code-smell signals (lint, console statements, `any` types, type
|
|
9
|
+
* errors, duplication, comment ratio, hygiene markers).
|
|
10
|
+
*
|
|
11
|
+
* Penalty rules cover signal classes that scale with repo size
|
|
12
|
+
* (density-based) and absolute thresholds (file-size, structural
|
|
13
|
+
* complexity, duplication, hygiene). Each rule surfaces a discrete
|
|
14
|
+
* Deduction with a human-readable reason on the resulting
|
|
15
|
+
* ScoreResult.
|
|
16
|
+
*
|
|
17
|
+
* Cap rules encode the Label Contract: an unmeasured dimension
|
|
18
|
+
* can't honestly claim a top-tier rating regardless of how clean
|
|
19
|
+
* the grep-derived signals look.
|
|
20
|
+
*
|
|
21
|
+
* unmeasured (35) all 3 signal-source tools unmeasured
|
|
22
|
+
* (lint + duplication + structural)
|
|
23
|
+
* partial-uncertainty (75) at least one signal-source tool
|
|
24
|
+
* unmeasured but not all three
|
|
25
|
+
*
|
|
26
|
+
* Both caps key off `lintAvailable`, `duplicationAvailable`, and
|
|
27
|
+
* `structuralAvailable` flags carried on the input — adapters set
|
|
28
|
+
* these from each capability's presence.
|
|
29
|
+
*
|
|
30
|
+
* Adapters that build `QualityScoreInput` from their domain data:
|
|
31
|
+
*
|
|
32
|
+
* - Health side: `src/analyzers/quality/shallow.ts:toQualityScoreInput`
|
|
33
|
+
* reads from `ScoreInput { metrics, capabilities }`.
|
|
34
|
+
* - Standalone side: `src/analyzers/quality/index.ts:qualityMetricsToScoreInput`
|
|
35
|
+
* reads from the assembled `QualityMetrics`.
|
|
36
|
+
*
|
|
37
|
+
* Both adapters land on this same input shape; both dispatch through
|
|
38
|
+
* the same spec; both observe identical scores. The cache builder
|
|
39
|
+
* shares the underlying counts across the two paths so the density
|
|
40
|
+
* denominators are byte-identical.
|
|
41
|
+
*/
|
|
42
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
+
exports.QUALITY_SCORING_SPEC = void 0;
|
|
44
|
+
/** Count unmeasured signal-source tools. 0 = all three ran. */
|
|
45
|
+
function unmeasuredCount(i) {
|
|
46
|
+
return [!i.lintAvailable, !i.duplicationAvailable, !i.structuralAvailable].filter(Boolean).length;
|
|
47
|
+
}
|
|
48
|
+
exports.QUALITY_SCORING_SPEC = {
|
|
49
|
+
dimension: 'quality',
|
|
50
|
+
methodology: 'iso-iec-25010-maintainability',
|
|
51
|
+
baseline: 100,
|
|
52
|
+
penalties: [
|
|
53
|
+
{
|
|
54
|
+
id: 'lint-errors',
|
|
55
|
+
describe: (i) => `${i.lintErrors} lint error(s) (density across ${i.sourceFiles} files)`,
|
|
56
|
+
applies: (i) => i.lintErrors > 0,
|
|
57
|
+
delta: (i) => {
|
|
58
|
+
const ratio = i.lintErrors / Math.max(i.sourceFiles, 1);
|
|
59
|
+
return -Math.min(ratio * 100, 40);
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: 'files-over-500-lines',
|
|
64
|
+
describe: (i) => `${i.filesOver500Lines} file(s) over 500 lines`,
|
|
65
|
+
applies: (i) => i.filesOver500Lines > 5,
|
|
66
|
+
delta: (i) => (i.filesOver500Lines > 20 ? -20 : -10),
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: 'largest-file-size',
|
|
70
|
+
describe: (i) => `largest file is ${i.largestFileLines} lines`,
|
|
71
|
+
applies: (i) => i.largestFileLines > 5000,
|
|
72
|
+
delta: (i) => (i.largestFileLines > 10000 ? -20 : -10),
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: 'console-statements',
|
|
76
|
+
describe: (i) => `${i.consoleLogCount} console/debug statement(s)`,
|
|
77
|
+
applies: (i) => i.consoleLogCount / Math.max(i.sourceFiles, 1) > 0.3,
|
|
78
|
+
delta: (i) => {
|
|
79
|
+
const d = i.consoleLogCount / Math.max(i.sourceFiles, 1);
|
|
80
|
+
return d > 3 ? -15 : d > 1 ? -10 : -5;
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: 'any-type-annotations',
|
|
85
|
+
describe: (i) => `${i.anyTypeCount} \`any\` type annotation(s)`,
|
|
86
|
+
applies: (i) => i.anyTypeCount / Math.max(i.sourceFiles, 1) > 1,
|
|
87
|
+
delta: (i) => {
|
|
88
|
+
const d = i.anyTypeCount / Math.max(i.sourceFiles, 1);
|
|
89
|
+
return d > 10 ? -15 : d > 5 ? -10 : -5;
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: 'type-errors',
|
|
94
|
+
describe: (i) => `${i.typeErrors} TypeScript compile error(s)`,
|
|
95
|
+
applies: (i) => i.typeErrors !== null && i.typeErrors > 0,
|
|
96
|
+
delta: (i) => {
|
|
97
|
+
const d = (i.typeErrors ?? 0) / Math.max(i.sourceFiles, 1);
|
|
98
|
+
return -Math.min(d * 50, 15);
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
id: 'max-functions-per-file',
|
|
103
|
+
describe: (i) => `densest file has ${i.maxFunctionsInFile} functions`,
|
|
104
|
+
applies: (i) => i.maxFunctionsInFile !== null && i.maxFunctionsInFile > 50,
|
|
105
|
+
delta: () => -10,
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
id: 'dead-imports',
|
|
109
|
+
describe: (i) => `${i.deadImportCount} dead import(s)`,
|
|
110
|
+
applies: (i) => i.deadImportCount !== null && i.deadImportCount > 20,
|
|
111
|
+
delta: () => -10,
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
id: 'orphan-modules',
|
|
115
|
+
describe: (i) => `${i.orphanModuleCount} orphan module(s)`,
|
|
116
|
+
applies: (i) => i.orphanModuleCount !== null && i.orphanModuleCount > 30,
|
|
117
|
+
delta: () => -5,
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
id: 'duplication',
|
|
121
|
+
describe: (i) => `${i.duplicationPercentage?.toFixed(1)}% duplicated code`,
|
|
122
|
+
applies: (i) => i.duplicationPercentage !== null && i.duplicationPercentage > 5,
|
|
123
|
+
delta: (i) => ((i.duplicationPercentage ?? 0) > 15 ? -20 : -10),
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
id: 'comment-ratio',
|
|
127
|
+
describe: (i) => `${((i.commentRatio ?? 0) * 100).toFixed(0)}% of source is comments`,
|
|
128
|
+
applies: (i) => i.commentRatio !== null && i.commentRatio > 0.4,
|
|
129
|
+
delta: (i) => ((i.commentRatio ?? 0) > 0.5 ? -15 : -10),
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
id: 'hygiene-markers',
|
|
133
|
+
describe: (i) => `${i.todoCount + i.fixmeCount + i.hackCount} TODO/FIXME/HACK marker(s)`,
|
|
134
|
+
applies: (i) => i.todoCount + i.fixmeCount + i.hackCount > 20,
|
|
135
|
+
delta: (i) => (i.todoCount + i.fixmeCount + i.hackCount > 50 ? -10 : -5),
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
id: 'stale-files-in-git',
|
|
139
|
+
describe: (i) => `${i.staleFiles} stale file(s) committed to git`,
|
|
140
|
+
applies: (i) => i.staleFiles > 0,
|
|
141
|
+
delta: (i) => (i.staleFiles > 3 ? -5 : -2),
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
id: 'mixed-languages',
|
|
145
|
+
describe: () => `.js files alongside .ts in source directories`,
|
|
146
|
+
applies: (i) => i.mixedLanguages,
|
|
147
|
+
delta: () => -5,
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
caps: [
|
|
151
|
+
{
|
|
152
|
+
id: 'all-quality-tools-unmeasured',
|
|
153
|
+
tier: 'unmeasured',
|
|
154
|
+
describe: () => `no Quality signal-source tool ran (lint + duplication + structural all missing)`,
|
|
155
|
+
applies: (i) => unmeasuredCount(i) === 3,
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
id: 'partial-quality-tools-unmeasured',
|
|
159
|
+
tier: 'partial-uncertainty',
|
|
160
|
+
describe: (i) => {
|
|
161
|
+
const missing = [];
|
|
162
|
+
if (!i.lintAvailable)
|
|
163
|
+
missing.push('lint');
|
|
164
|
+
if (!i.duplicationAvailable)
|
|
165
|
+
missing.push('duplication');
|
|
166
|
+
if (!i.structuralAvailable)
|
|
167
|
+
missing.push('structural');
|
|
168
|
+
return `${missing.length} signal-source tool(s) did not run: ${missing.join(', ')}`;
|
|
169
|
+
},
|
|
170
|
+
applies: (i) => unmeasuredCount(i) >= 1,
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
};
|
|
174
|
+
//# sourceMappingURL=quality.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quality.js","sourceRoot":"","sources":["../../../src/scoring/dimensions/quality.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;;;AA6EH,+DAA+D;AAC/D,SAAS,eAAe,CAAC,CAAoB;IAC3C,OAAO,CAAC,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,oBAAoB,EAAE,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC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