coverme-scanner 1.0.1 → 1.0.3
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/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +26 -52
- package/dist/cli/init.js.map +1 -1
- package/dist/templates/scan-result.json +37 -0
- package/package.json +1 -1
- package/src/cli/init.ts +27 -52
- package/src/templates/scan-result.json +37 -0
package/dist/cli/init.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":"AAIA,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":"AAIA,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAyfD,wBAAsB,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA0E9D"}
|
package/dist/cli/init.js
CHANGED
|
@@ -510,66 +510,26 @@ Combine all results:
|
|
|
510
510
|
|
|
511
511
|
## Phase 4: Generate Report
|
|
512
512
|
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
"id": "SEC-001",
|
|
522
|
-
"title": "Issue title",
|
|
523
|
-
"severity": "critical|high|medium|low|info",
|
|
524
|
-
"category": "security|auth|api|infrastructure|privacy|ai-security|performance|business-logic|quality|testing",
|
|
525
|
-
"file": "path/to/file.ts",
|
|
526
|
-
"line": 123,
|
|
527
|
-
"description": "Clear description of the issue",
|
|
528
|
-
"code": "the problematic code snippet (include 5+ lines of context)",
|
|
529
|
-
"recommendation": "Specific fix with code example if possible",
|
|
530
|
-
"confidence": 95,
|
|
531
|
-
"cwe": "CWE-XXX if applicable"
|
|
532
|
-
}
|
|
533
|
-
],
|
|
534
|
-
"falsePositives": [
|
|
535
|
-
{
|
|
536
|
-
"id": "SEC-002",
|
|
537
|
-
"title": "What was originally flagged",
|
|
538
|
-
"file": "path/to/file.ts",
|
|
539
|
-
"reason": "Why it was rejected"
|
|
540
|
-
}
|
|
541
|
-
],
|
|
542
|
-
"positiveObservations": [
|
|
543
|
-
"Uses parameterized queries for all database access",
|
|
544
|
-
"Implements proper rate limiting on authentication endpoints",
|
|
545
|
-
"PKCE implemented for OAuth flow",
|
|
546
|
-
"Proper secret management with environment variables",
|
|
547
|
-
"Comprehensive error handling with proper logging",
|
|
548
|
-
"Input validation using Zod/Joi schemas"
|
|
549
|
-
],
|
|
550
|
-
"scanDuration": 300000,
|
|
551
|
-
"agentCount": 13
|
|
552
|
-
}
|
|
553
|
-
\`\`\`
|
|
513
|
+
Update the existing \`.coverme/scan.json\` file with the scan results. The file already exists with the correct structure - just fill in the values:
|
|
514
|
+
|
|
515
|
+
- **projectName**: from package.json or folder name
|
|
516
|
+
- **scanDate**: today's date
|
|
517
|
+
- **findings**: array of issues found (each with id, title, severity, category, file, line, description, code, recommendation, confidence)
|
|
518
|
+
- **positiveObservations**: array of good patterns found
|
|
519
|
+
- **scanDuration**: time taken in ms
|
|
520
|
+
- **agentCount**: 7
|
|
554
521
|
|
|
555
|
-
Use the
|
|
522
|
+
Use the Edit tool to update \`.coverme/scan.json\` with the results.
|
|
556
523
|
|
|
557
524
|
---
|
|
558
525
|
|
|
559
526
|
## Phase 5: Generate HTML Report
|
|
560
527
|
|
|
561
|
-
|
|
562
|
-
\`\`\`bash
|
|
563
|
-
mkdir -p .coverme
|
|
564
|
-
\`\`\`
|
|
565
|
-
|
|
566
|
-
2. Use the Write tool to save the JSON to \`coverme-scan.json\`
|
|
567
|
-
|
|
568
|
-
3. Generate the HTML report and open it:
|
|
528
|
+
Generate the HTML report and open it:
|
|
569
529
|
\`\`\`bash
|
|
570
530
|
TIMESTAMP=$(date +%Y-%m-%d_%H-%M-%S)
|
|
571
|
-
npx coverme report coverme
|
|
572
|
-
|
|
531
|
+
npx coverme-scanner report .coverme/scan.json -f html -o ".coverme/report_$TIMESTAMP.html"
|
|
532
|
+
cp .coverme/scan.json ".coverme/scan_$TIMESTAMP.json"
|
|
573
533
|
open ".coverme/report_$TIMESTAMP.html"
|
|
574
534
|
\`\`\`
|
|
575
535
|
|
|
@@ -599,6 +559,20 @@ async function init(options) {
|
|
|
599
559
|
fs.mkdirSync(covermeDir, { recursive: true });
|
|
600
560
|
console.log(`Created: ${covermeDir}/`);
|
|
601
561
|
}
|
|
562
|
+
// Create scan.json template
|
|
563
|
+
const scanJsonPath = path.join(covermeDir, 'scan.json');
|
|
564
|
+
if (!fs.existsSync(scanJsonPath)) {
|
|
565
|
+
const scanTemplate = {
|
|
566
|
+
projectName: "",
|
|
567
|
+
scanDate: "",
|
|
568
|
+
findings: [],
|
|
569
|
+
positiveObservations: [],
|
|
570
|
+
scanDuration: 0,
|
|
571
|
+
agentCount: 7
|
|
572
|
+
};
|
|
573
|
+
fs.writeFileSync(scanJsonPath, JSON.stringify(scanTemplate, null, 2));
|
|
574
|
+
console.log(`Created: ${scanJsonPath}`);
|
|
575
|
+
}
|
|
602
576
|
// Add .coverme to .gitignore if not already there
|
|
603
577
|
const gitignorePath = path.join(process.cwd(), '.gitignore');
|
|
604
578
|
const covermeIgnore = '\n# CoverMe scan reports\n.coverme/\n';
|
package/dist/cli/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+fA,oBA0EC;AAzkBD,uCAAyB;AACzB,2CAA6B;AAC7B,uCAA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9D,IAAI,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;QACjC,MAAM,gBAAgB,GAAG,EAAE,CAAC,YAAY,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QACjE,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;YAC3C,EAAE,CAAC,cAAc,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;YAChD,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;SAAM,CAAC;QACN,EAAE,CAAC,aAAa,CAAC,aAAa,EAAE,aAAa,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;QAC7D,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;CAkBb,CAAC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"projectName": "",
|
|
3
|
+
"scanDate": "",
|
|
4
|
+
"duration": "",
|
|
5
|
+
"score": "",
|
|
6
|
+
"findings": [
|
|
7
|
+
{
|
|
8
|
+
"id": "",
|
|
9
|
+
"title": "",
|
|
10
|
+
"severity": "critical|high|medium|low",
|
|
11
|
+
"category": "security|quality|architecture|dependencies|performance",
|
|
12
|
+
"file": "",
|
|
13
|
+
"line": 0,
|
|
14
|
+
"description": "",
|
|
15
|
+
"whyItMatters": "",
|
|
16
|
+
"codeSnippet": "",
|
|
17
|
+
"checkBeforeFixing": "",
|
|
18
|
+
"suggestedFix": "",
|
|
19
|
+
"claudeCodePrompt": "",
|
|
20
|
+
"confidence": 0
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"positiveObservations": [
|
|
24
|
+
{
|
|
25
|
+
"title": "",
|
|
26
|
+
"description": ""
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"summary": {
|
|
30
|
+
"critical": 0,
|
|
31
|
+
"high": 0,
|
|
32
|
+
"medium": 0,
|
|
33
|
+
"low": 0,
|
|
34
|
+
"total": 0
|
|
35
|
+
},
|
|
36
|
+
"agentCount": 7
|
|
37
|
+
}
|
package/package.json
CHANGED
package/src/cli/init.ts
CHANGED
|
@@ -479,66 +479,26 @@ Combine all results:
|
|
|
479
479
|
|
|
480
480
|
## Phase 4: Generate Report
|
|
481
481
|
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
"id": "SEC-001",
|
|
491
|
-
"title": "Issue title",
|
|
492
|
-
"severity": "critical|high|medium|low|info",
|
|
493
|
-
"category": "security|auth|api|infrastructure|privacy|ai-security|performance|business-logic|quality|testing",
|
|
494
|
-
"file": "path/to/file.ts",
|
|
495
|
-
"line": 123,
|
|
496
|
-
"description": "Clear description of the issue",
|
|
497
|
-
"code": "the problematic code snippet (include 5+ lines of context)",
|
|
498
|
-
"recommendation": "Specific fix with code example if possible",
|
|
499
|
-
"confidence": 95,
|
|
500
|
-
"cwe": "CWE-XXX if applicable"
|
|
501
|
-
}
|
|
502
|
-
],
|
|
503
|
-
"falsePositives": [
|
|
504
|
-
{
|
|
505
|
-
"id": "SEC-002",
|
|
506
|
-
"title": "What was originally flagged",
|
|
507
|
-
"file": "path/to/file.ts",
|
|
508
|
-
"reason": "Why it was rejected"
|
|
509
|
-
}
|
|
510
|
-
],
|
|
511
|
-
"positiveObservations": [
|
|
512
|
-
"Uses parameterized queries for all database access",
|
|
513
|
-
"Implements proper rate limiting on authentication endpoints",
|
|
514
|
-
"PKCE implemented for OAuth flow",
|
|
515
|
-
"Proper secret management with environment variables",
|
|
516
|
-
"Comprehensive error handling with proper logging",
|
|
517
|
-
"Input validation using Zod/Joi schemas"
|
|
518
|
-
],
|
|
519
|
-
"scanDuration": 300000,
|
|
520
|
-
"agentCount": 13
|
|
521
|
-
}
|
|
522
|
-
\`\`\`
|
|
482
|
+
Update the existing \`.coverme/scan.json\` file with the scan results. The file already exists with the correct structure - just fill in the values:
|
|
483
|
+
|
|
484
|
+
- **projectName**: from package.json or folder name
|
|
485
|
+
- **scanDate**: today's date
|
|
486
|
+
- **findings**: array of issues found (each with id, title, severity, category, file, line, description, code, recommendation, confidence)
|
|
487
|
+
- **positiveObservations**: array of good patterns found
|
|
488
|
+
- **scanDuration**: time taken in ms
|
|
489
|
+
- **agentCount**: 7
|
|
523
490
|
|
|
524
|
-
Use the
|
|
491
|
+
Use the Edit tool to update \`.coverme/scan.json\` with the results.
|
|
525
492
|
|
|
526
493
|
---
|
|
527
494
|
|
|
528
495
|
## Phase 5: Generate HTML Report
|
|
529
496
|
|
|
530
|
-
|
|
531
|
-
\`\`\`bash
|
|
532
|
-
mkdir -p .coverme
|
|
533
|
-
\`\`\`
|
|
534
|
-
|
|
535
|
-
2. Use the Write tool to save the JSON to \`coverme-scan.json\`
|
|
536
|
-
|
|
537
|
-
3. Generate the HTML report and open it:
|
|
497
|
+
Generate the HTML report and open it:
|
|
538
498
|
\`\`\`bash
|
|
539
499
|
TIMESTAMP=$(date +%Y-%m-%d_%H-%M-%S)
|
|
540
|
-
npx coverme report coverme
|
|
541
|
-
|
|
500
|
+
npx coverme-scanner report .coverme/scan.json -f html -o ".coverme/report_$TIMESTAMP.html"
|
|
501
|
+
cp .coverme/scan.json ".coverme/scan_$TIMESTAMP.json"
|
|
542
502
|
open ".coverme/report_$TIMESTAMP.html"
|
|
543
503
|
\`\`\`
|
|
544
504
|
|
|
@@ -574,6 +534,21 @@ export async function init(options: InitOptions): Promise<void> {
|
|
|
574
534
|
console.log(`Created: ${covermeDir}/`);
|
|
575
535
|
}
|
|
576
536
|
|
|
537
|
+
// Create scan.json template
|
|
538
|
+
const scanJsonPath = path.join(covermeDir, 'scan.json');
|
|
539
|
+
if (!fs.existsSync(scanJsonPath)) {
|
|
540
|
+
const scanTemplate = {
|
|
541
|
+
projectName: "",
|
|
542
|
+
scanDate: "",
|
|
543
|
+
findings: [],
|
|
544
|
+
positiveObservations: [],
|
|
545
|
+
scanDuration: 0,
|
|
546
|
+
agentCount: 7
|
|
547
|
+
};
|
|
548
|
+
fs.writeFileSync(scanJsonPath, JSON.stringify(scanTemplate, null, 2));
|
|
549
|
+
console.log(`Created: ${scanJsonPath}`);
|
|
550
|
+
}
|
|
551
|
+
|
|
577
552
|
// Add .coverme to .gitignore if not already there
|
|
578
553
|
const gitignorePath = path.join(process.cwd(), '.gitignore');
|
|
579
554
|
const covermeIgnore = '\n# CoverMe scan reports\n.coverme/\n';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"projectName": "",
|
|
3
|
+
"scanDate": "",
|
|
4
|
+
"duration": "",
|
|
5
|
+
"score": "",
|
|
6
|
+
"findings": [
|
|
7
|
+
{
|
|
8
|
+
"id": "",
|
|
9
|
+
"title": "",
|
|
10
|
+
"severity": "critical|high|medium|low",
|
|
11
|
+
"category": "security|quality|architecture|dependencies|performance",
|
|
12
|
+
"file": "",
|
|
13
|
+
"line": 0,
|
|
14
|
+
"description": "",
|
|
15
|
+
"whyItMatters": "",
|
|
16
|
+
"codeSnippet": "",
|
|
17
|
+
"checkBeforeFixing": "",
|
|
18
|
+
"suggestedFix": "",
|
|
19
|
+
"claudeCodePrompt": "",
|
|
20
|
+
"confidence": 0
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"positiveObservations": [
|
|
24
|
+
{
|
|
25
|
+
"title": "",
|
|
26
|
+
"description": ""
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"summary": {
|
|
30
|
+
"critical": 0,
|
|
31
|
+
"high": 0,
|
|
32
|
+
"medium": 0,
|
|
33
|
+
"low": 0,
|
|
34
|
+
"total": 0
|
|
35
|
+
},
|
|
36
|
+
"agentCount": 7
|
|
37
|
+
}
|