@produtype/core 0.17.0 → 0.18.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/dist/report/buildReport.js +29 -9
- package/dist/report/score.d.ts +10 -0
- package/dist/report/score.js +11 -1
- package/package.json +1 -1
|
@@ -127,15 +127,6 @@ function buildReport(analysis, options) {
|
|
|
127
127
|
|| analysis.stack.databases.length > 0
|
|
128
128
|
|| mobileDetected
|
|
129
129
|
|| gameEngineDetected;
|
|
130
|
-
const inconclusive = !stackDetected && analysis.workspaceStacks.length === 0;
|
|
131
|
-
const inconclusiveReasons = [];
|
|
132
|
-
if (inconclusive) {
|
|
133
|
-
inconclusiveReasons.push('No frontend, backend, or database stack signals were detected.');
|
|
134
|
-
inconclusiveReasons.push('No package manifest was found in any format this analyzer reads.');
|
|
135
|
-
if (analysis.files.source.length === 0) {
|
|
136
|
-
inconclusiveReasons.push('No recognizable source files were found.');
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
130
|
/**
|
|
140
131
|
* Coverage counts the expectations too, not only the observed rules.
|
|
141
132
|
*
|
|
@@ -150,6 +141,35 @@ function buildReport(analysis, options) {
|
|
|
150
141
|
const assessedChecks = findings.filter((f) => f.status !== 'unknown').length
|
|
151
142
|
+ Math.max(applicableExpectations - expectationFindings.length, 0);
|
|
152
143
|
const coverage = { passed: passedChecksForMaturity, assessed: assessedChecks };
|
|
144
|
+
const nothingIdentified = !stackDetected && analysis.workspaceStacks.length === 0;
|
|
145
|
+
/**
|
|
146
|
+
* Too little reached a verdict to say anything about this project.
|
|
147
|
+
*
|
|
148
|
+
* The flag used to ask whether a manifest existed, and the claim it makes is about
|
|
149
|
+
* what was learned. Two repositories with the same three verdicts came out at 39 and
|
|
150
|
+
* at 84, and the only difference between them was a `requirements.txt`: a Python
|
|
151
|
+
* script with one was judged, an equally small one without it was called unreadable.
|
|
152
|
+
*
|
|
153
|
+
* Five is where the corpus splits. Of seventy-eight repositories, eleven reach four
|
|
154
|
+
* verdicts or fewer and thirty reach ten or more; not one lands in between. Four
|
|
155
|
+
* verdicts cannot characterise a product, however many files it has.
|
|
156
|
+
*/
|
|
157
|
+
const tooLittleAssessed = assessedChecks < score_1.MIN_ASSESSED_FOR_A_READING;
|
|
158
|
+
const inconclusive = nothingIdentified || tooLittleAssessed;
|
|
159
|
+
// Each reason says which of the two it was, because they call for different things:
|
|
160
|
+
// one is a repository this analyzer cannot read, the other is one there is barely
|
|
161
|
+
// anything to read.
|
|
162
|
+
const inconclusiveReasons = [];
|
|
163
|
+
if (nothingIdentified) {
|
|
164
|
+
inconclusiveReasons.push('No frontend, backend, or database stack signals were detected.');
|
|
165
|
+
inconclusiveReasons.push('No package manifest was found in any format this analyzer reads.');
|
|
166
|
+
if (analysis.files.source.length === 0) {
|
|
167
|
+
inconclusiveReasons.push('No recognizable source files were found.');
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
if (tooLittleAssessed) {
|
|
171
|
+
inconclusiveReasons.push(`Only ${assessedChecks} check${assessedChecks === 1 ? '' : 's'} reached a verdict, which is too few to characterise this project.`);
|
|
172
|
+
}
|
|
153
173
|
// An unrecognized project has almost no applicable detectors, so the absence
|
|
154
174
|
// of findings must not be rewarded with a high score: cap it at prototype.
|
|
155
175
|
const scoreAfterInconclusive = inconclusive ? Math.min(combinedScore, 39) : combinedScore;
|
package/dist/report/score.d.ts
CHANGED
|
@@ -10,6 +10,16 @@ export interface ScoreCoverage {
|
|
|
10
10
|
passed: number;
|
|
11
11
|
assessed: number;
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* The fewest verdicts that can carry a reading at all.
|
|
15
|
+
*
|
|
16
|
+
* Below this the report has nothing to characterise: not a weak product, but a project
|
|
17
|
+
* this analyzer barely had anything to say about. In a corpus of seventy-eight
|
|
18
|
+
* repositories, eleven reach four verdicts or fewer and thirty reach ten or more —
|
|
19
|
+
* nothing lands in between, so the line sits in the gap rather than in the middle of a
|
|
20
|
+
* distribution.
|
|
21
|
+
*/
|
|
22
|
+
export declare const MIN_ASSESSED_FOR_A_READING = 5;
|
|
13
23
|
/**
|
|
14
24
|
* The highest score a report can reach when it may not claim the top band.
|
|
15
25
|
*
|
package/dist/report/score.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TOP_BAND_CEILING = void 0;
|
|
3
|
+
exports.TOP_BAND_CEILING = exports.MIN_ASSESSED_FOR_A_READING = void 0;
|
|
4
4
|
exports.computeScore = computeScore;
|
|
5
5
|
exports.coverageSupportsTopBand = coverageSupportsTopBand;
|
|
6
6
|
exports.mayClaimTopBand = mayClaimTopBand;
|
|
@@ -28,6 +28,16 @@ function computeScore(findings) {
|
|
|
28
28
|
* nothing.
|
|
29
29
|
*/
|
|
30
30
|
const MIN_VERIFIED_FOR_PRODUCTION = 6;
|
|
31
|
+
/**
|
|
32
|
+
* The fewest verdicts that can carry a reading at all.
|
|
33
|
+
*
|
|
34
|
+
* Below this the report has nothing to characterise: not a weak product, but a project
|
|
35
|
+
* this analyzer barely had anything to say about. In a corpus of seventy-eight
|
|
36
|
+
* repositories, eleven reach four verdicts or fewer and thirty reach ten or more —
|
|
37
|
+
* nothing lands in between, so the line sits in the gap rather than in the middle of a
|
|
38
|
+
* distribution.
|
|
39
|
+
*/
|
|
40
|
+
exports.MIN_ASSESSED_FOR_A_READING = 5;
|
|
31
41
|
/**
|
|
32
42
|
* The highest score a report can reach when it may not claim the top band.
|
|
33
43
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@produtype/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "Deterministic CLI and library that analyzes a web application repository and reports how far it is from production-ready for the kind of product it is meant to be.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|