apex-code-coverage-transformer 2.15.2 → 2.16.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/CHANGELOG.md +7 -0
- package/README.md +5 -0
- package/lib/handlers/BaseHandler.d.ts +2 -2
- package/lib/handlers/BaseHandler.js.map +1 -1
- package/lib/handlers/getHandler.d.ts +1 -0
- package/lib/handlers/getHandler.js +1 -0
- package/lib/handlers/getHandler.js.map +1 -1
- package/lib/handlers/html.d.ts +28 -0
- package/lib/handlers/html.js +84 -0
- package/lib/handlers/html.js.map +1 -0
- package/lib/transformers/reportGenerator.d.ts +2 -2
- package/lib/transformers/reportGenerator.js +262 -0
- package/lib/transformers/reportGenerator.js.map +1 -1
- package/lib/utils/types.d.ts +23 -1
- package/oclif.manifest.json +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
7
7
|
|
|
8
|
+
## [2.16.0](https://github.com/mcarvin8/apex-code-coverage-transformer/compare/v2.15.2...v2.16.0) (2026-01-26)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* add html as an output format ([#253](https://github.com/mcarvin8/apex-code-coverage-transformer/issues/253)) ([d7d4f54](https://github.com/mcarvin8/apex-code-coverage-transformer/commit/d7d4f54664ef3ab603e0b55b70b9c6883ec93b0f))
|
|
14
|
+
|
|
8
15
|
## [2.15.2](https://github.com/mcarvin8/apex-code-coverage-transformer/compare/v2.15.1...v2.15.2) (2026-01-03)
|
|
9
16
|
|
|
10
17
|
|
package/README.md
CHANGED
|
@@ -189,6 +189,10 @@ EXAMPLES
|
|
|
189
189
|
|
|
190
190
|
$ sf acc-transformer transform -j "coverage.json" -r "coverage.xml" -f "opencover"
|
|
191
191
|
|
|
192
|
+
Transform the JSON into HTML format:
|
|
193
|
+
|
|
194
|
+
$ sf acc-transformer transform -j "coverage.json" -r "coverage.html" -f "html"
|
|
195
|
+
|
|
192
196
|
Transform the JSON into Sonar format, ignoring Apex in the "force-app" directory:
|
|
193
197
|
|
|
194
198
|
$ sf acc-transformer transform -j "coverage.json" -i "force-app"
|
|
@@ -211,6 +215,7 @@ You can provide multiple `--format` flags in a single command to create multiple
|
|
|
211
215
|
| [json-summary](https://raw.githubusercontent.com/mcarvin8/apex-code-coverage-transformer/main/baselines/json-summary_baseline.json) | Generates a concise JSON summary ideal for badges, PR comments, and quick analysis. | GitHub Actions, GitLab CI, Custom Dashboards |
|
|
212
216
|
| [simplecov](https://raw.githubusercontent.com/mcarvin8/apex-code-coverage-transformer/main/baselines/simplecov_baseline.json) | Generates SimpleCov JSON format compatible with Ruby coverage tools. | Codecov, SimpleCov, Ruby Tools |
|
|
213
217
|
| [opencover](https://raw.githubusercontent.com/mcarvin8/apex-code-coverage-transformer/main/baselines/opencover_baseline.xml) | Generates OpenCover XML format for .NET and Azure DevOps integration. | Azure DevOps, Visual Studio, Codecov, JetBrains Tools |
|
|
218
|
+
| html | Generates a human-readable HTML report with interactive file-by-file coverage details. | Web Browsers, CI/CD Artifacts, Local Development |
|
|
214
219
|
|
|
215
220
|
## CI/CD Integration Examples
|
|
216
221
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CoverageHandler, SonarCoverageObject, CoberturaCoverageObject, CloverCoverageObject, LcovCoverageObject, JaCoCoCoverageObject, IstanbulCoverageObject, JsonSummaryCoverageObject, SimpleCovCoverageObject, OpenCoverCoverageObject } from '../utils/types.js';
|
|
1
|
+
import { CoverageHandler, SonarCoverageObject, CoberturaCoverageObject, CloverCoverageObject, LcovCoverageObject, JaCoCoCoverageObject, IstanbulCoverageObject, JsonSummaryCoverageObject, SimpleCovCoverageObject, OpenCoverCoverageObject, HtmlCoverageObject } from '../utils/types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Abstract base class for coverage handlers providing common utilities.
|
|
4
4
|
* Reduces code duplication across different format handlers.
|
|
@@ -47,5 +47,5 @@ export declare abstract class BaseHandler implements CoverageHandler {
|
|
|
47
47
|
'@name'?: string;
|
|
48
48
|
}>(items: T[]): T[];
|
|
49
49
|
abstract processFile(filePath: string, fileName: string, lines: Record<string, number>): void;
|
|
50
|
-
abstract finalize(): SonarCoverageObject | CoberturaCoverageObject | CloverCoverageObject | LcovCoverageObject | JaCoCoCoverageObject | IstanbulCoverageObject | JsonSummaryCoverageObject | SimpleCovCoverageObject | OpenCoverCoverageObject;
|
|
50
|
+
abstract finalize(): SonarCoverageObject | CoberturaCoverageObject | CloverCoverageObject | LcovCoverageObject | JaCoCoCoverageObject | IstanbulCoverageObject | JsonSummaryCoverageObject | SimpleCovCoverageObject | OpenCoverCoverageObject | HtmlCoverageObject;
|
|
51
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseHandler.js","sourceRoot":"","sources":["../../src/handlers/BaseHandler.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"BaseHandler.js","sourceRoot":"","sources":["../../src/handlers/BaseHandler.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAgBb;;;GAGG;AACH,MAAM,OAAgB,WAAW;IAC/B;;;;;OAKG;IACH,kDAAkD;IACxC,iBAAiB,CAAC,KAA6B;QAMvD,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;QAChF,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC;QAC5E,MAAM,UAAU,GAAG,cAAc,GAAG,YAAY,CAAC;QACjD,MAAM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AAO,CAAC,IAAI,EAAE,CAAC;YAC/D,OAAO,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;IACL,CAAC;CAeF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getHandler.js","sourceRoot":"","sources":["../../src/handlers/getHandler.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAGb,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,mDAAmD;AACnD,OAAO,YAAY,CAAC;AACpB,OAAO,gBAAgB,CAAC;AACxB,OAAO,aAAa,CAAC;AACrB,OAAO,WAAW,CAAC;AACnB,OAAO,aAAa,CAAC;AACrB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,gBAAgB,CAAC;AACxB,OAAO,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"getHandler.js","sourceRoot":"","sources":["../../src/handlers/getHandler.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAGb,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,mDAAmD;AACnD,OAAO,YAAY,CAAC;AACpB,OAAO,gBAAgB,CAAC;AACxB,OAAO,aAAa,CAAC;AACrB,OAAO,WAAW,CAAC;AACnB,OAAO,aAAa,CAAC;AACrB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,gBAAgB,CAAC;AACxB,OAAO,gBAAgB,CAAC;AACxB,OAAO,WAAW,CAAC;AAEnB;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAC/C,OAAO,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { HtmlCoverageObject } from '../utils/types.js';
|
|
2
|
+
import { BaseHandler } from './BaseHandler.js';
|
|
3
|
+
/**
|
|
4
|
+
* Handler for generating HTML coverage reports.
|
|
5
|
+
*
|
|
6
|
+
* This format provides a human-readable, interactive HTML report
|
|
7
|
+
* with summary statistics and file-by-file coverage details.
|
|
8
|
+
*
|
|
9
|
+
* Compatible with:
|
|
10
|
+
* - Web browsers
|
|
11
|
+
* - CI/CD artifact viewing
|
|
12
|
+
* - Local development review
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* The HTML report includes:
|
|
16
|
+
* - Overall coverage summary
|
|
17
|
+
* - File-by-file breakdown
|
|
18
|
+
* - Line-by-line coverage visualization
|
|
19
|
+
* - Color-coded coverage indicators
|
|
20
|
+
*/
|
|
21
|
+
export declare class HtmlCoverageHandler extends BaseHandler {
|
|
22
|
+
private readonly coverageObj;
|
|
23
|
+
private totalLinesAccumulator;
|
|
24
|
+
private coveredLinesAccumulator;
|
|
25
|
+
constructor();
|
|
26
|
+
processFile(filePath: string, fileName: string, lines: Record<string, number>): void;
|
|
27
|
+
finalize(): HtmlCoverageObject;
|
|
28
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
import { BaseHandler } from './BaseHandler.js';
|
|
3
|
+
import { HandlerRegistry } from './HandlerRegistry.js';
|
|
4
|
+
/**
|
|
5
|
+
* Handler for generating HTML coverage reports.
|
|
6
|
+
*
|
|
7
|
+
* This format provides a human-readable, interactive HTML report
|
|
8
|
+
* with summary statistics and file-by-file coverage details.
|
|
9
|
+
*
|
|
10
|
+
* Compatible with:
|
|
11
|
+
* - Web browsers
|
|
12
|
+
* - CI/CD artifact viewing
|
|
13
|
+
* - Local development review
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* The HTML report includes:
|
|
17
|
+
* - Overall coverage summary
|
|
18
|
+
* - File-by-file breakdown
|
|
19
|
+
* - Line-by-line coverage visualization
|
|
20
|
+
* - Color-coded coverage indicators
|
|
21
|
+
*/
|
|
22
|
+
export class HtmlCoverageHandler extends BaseHandler {
|
|
23
|
+
coverageObj;
|
|
24
|
+
totalLinesAccumulator = 0;
|
|
25
|
+
coveredLinesAccumulator = 0;
|
|
26
|
+
constructor() {
|
|
27
|
+
super();
|
|
28
|
+
this.coverageObj = {
|
|
29
|
+
summary: {
|
|
30
|
+
totalLines: 0,
|
|
31
|
+
coveredLines: 0,
|
|
32
|
+
uncoveredLines: 0,
|
|
33
|
+
lineRate: 0,
|
|
34
|
+
},
|
|
35
|
+
files: [],
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
processFile(filePath, fileName, lines) {
|
|
39
|
+
const { totalLines, coveredLines, uncoveredLines, lineRate } = this.calculateCoverage(lines);
|
|
40
|
+
const fileLines = Object.entries(lines)
|
|
41
|
+
.map(([lineNumber, hitCount]) => ({
|
|
42
|
+
lineNumber: Number(lineNumber),
|
|
43
|
+
hitCount,
|
|
44
|
+
covered: hitCount > 0,
|
|
45
|
+
}))
|
|
46
|
+
.sort((a, b) => a.lineNumber - b.lineNumber);
|
|
47
|
+
const fileCoverage = {
|
|
48
|
+
filePath,
|
|
49
|
+
fileName,
|
|
50
|
+
totalLines,
|
|
51
|
+
coveredLines,
|
|
52
|
+
uncoveredLines,
|
|
53
|
+
lineRate,
|
|
54
|
+
lines: fileLines,
|
|
55
|
+
};
|
|
56
|
+
this.coverageObj.files.push(fileCoverage);
|
|
57
|
+
// Accumulate totals
|
|
58
|
+
this.totalLinesAccumulator += totalLines;
|
|
59
|
+
this.coveredLinesAccumulator += coveredLines;
|
|
60
|
+
}
|
|
61
|
+
finalize() {
|
|
62
|
+
// Calculate summary
|
|
63
|
+
const uncoveredLines = this.totalLinesAccumulator - this.coveredLinesAccumulator;
|
|
64
|
+
const lineRate = this.totalLinesAccumulator > 0 ? this.coveredLinesAccumulator / this.totalLinesAccumulator : 0;
|
|
65
|
+
this.coverageObj.summary = {
|
|
66
|
+
totalLines: this.totalLinesAccumulator,
|
|
67
|
+
coveredLines: this.coveredLinesAccumulator,
|
|
68
|
+
uncoveredLines,
|
|
69
|
+
lineRate,
|
|
70
|
+
};
|
|
71
|
+
// Sort files by path for deterministic output
|
|
72
|
+
this.coverageObj.files.sort((a, b) => a.filePath.localeCompare(b.filePath));
|
|
73
|
+
return this.coverageObj;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// Self-register this handler
|
|
77
|
+
HandlerRegistry.register({
|
|
78
|
+
name: 'html',
|
|
79
|
+
description: 'HTML format for human-readable coverage reports',
|
|
80
|
+
fileExtension: '.html',
|
|
81
|
+
handler: () => new HtmlCoverageHandler(),
|
|
82
|
+
compatibleWith: ['Web Browsers', 'CI/CD Artifacts', 'Local Development'],
|
|
83
|
+
});
|
|
84
|
+
//# sourceMappingURL=html.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html.js","sourceRoot":"","sources":["../../src/handlers/html.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAGb,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,mBAAoB,SAAQ,WAAW;IACjC,WAAW,CAAqB;IACzC,qBAAqB,GAAG,CAAC,CAAC;IAC1B,uBAAuB,GAAG,CAAC,CAAC;IAEpC;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG;YACjB,OAAO,EAAE;gBACP,UAAU,EAAE,CAAC;gBACb,YAAY,EAAE,CAAC;gBACf,cAAc,EAAE,CAAC;gBACjB,QAAQ,EAAE,CAAC;aACZ;YACD,KAAK,EAAE,EAAE;SACV,CAAC;IACJ,CAAC;IAEM,WAAW,CAAC,QAAgB,EAAE,QAAgB,EAAE,KAA6B;QAClF,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAE7F,MAAM,SAAS,G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AAC,CAAC,QAAQ,CAAC,CAAC,CAAC;QAE5E,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;CACF;AAED,6BAA6B;AAC7B,eAAe,CAAC,QAAQ,CAAC;IACvB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,iDAAiD;IAC9D,aAAa,EAAE,OAAO;IACtB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,mBAAmB,EAAE;IACxC,cAAc,EAAE,CAAC,cAAc,EAAE,iBAAiB,EAAE,mBAAmB,CAAC;CACzE,CAAC,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { SonarCoverageObject, CoberturaCoverageObject, CloverCoverageObject, LcovCoverageObject, JaCoCoCoverageObject, IstanbulCoverageObject, JsonSummaryCoverageObject, SimpleCovCoverageObject, OpenCoverCoverageObject } from '../utils/types.js';
|
|
2
|
-
export declare function generateAndWriteReport(outputPath: string, coverageObj: SonarCoverageObject | CoberturaCoverageObject | CloverCoverageObject | LcovCoverageObject | JaCoCoCoverageObject | IstanbulCoverageObject | JsonSummaryCoverageObject | SimpleCovCoverageObject | OpenCoverCoverageObject, format: string, formatAmount: number): Promise<string>;
|
|
1
|
+
import { SonarCoverageObject, CoberturaCoverageObject, CloverCoverageObject, LcovCoverageObject, JaCoCoCoverageObject, IstanbulCoverageObject, JsonSummaryCoverageObject, SimpleCovCoverageObject, OpenCoverCoverageObject, HtmlCoverageObject } from '../utils/types.js';
|
|
2
|
+
export declare function generateAndWriteReport(outputPath: string, coverageObj: SonarCoverageObject | CoberturaCoverageObject | CloverCoverageObject | LcovCoverageObject | JaCoCoCoverageObject | IstanbulCoverageObject | JsonSummaryCoverageObject | SimpleCovCoverageObject | OpenCoverCoverageObject | HtmlCoverageObject, format: string, formatAmount: number): Promise<string>;
|
|
3
3
|
export declare function getExtensionForFormat(format: string): string;
|
|
@@ -16,6 +16,9 @@ function generateReportContent(coverageObj, format) {
|
|
|
16
16
|
if (format === 'lcovonly' && isLcovCoverageObject(coverageObj)) {
|
|
17
17
|
return generateLcov(coverageObj);
|
|
18
18
|
}
|
|
19
|
+
if (format === 'html' && isHtmlCoverageObject(coverageObj)) {
|
|
20
|
+
return generateHtml(coverageObj);
|
|
21
|
+
}
|
|
19
22
|
if (format === 'json' || format === 'json-summary' || format === 'simplecov') {
|
|
20
23
|
return JSON.stringify(coverageObj, null, 2);
|
|
21
24
|
}
|
|
@@ -62,4 +65,263 @@ export function getExtensionForFormat(format) {
|
|
|
62
65
|
function isLcovCoverageObject(obj) {
|
|
63
66
|
return typeof obj === 'object' && obj !== null && 'files' in obj;
|
|
64
67
|
}
|
|
68
|
+
function isHtmlCoverageObject(obj) {
|
|
69
|
+
return typeof obj === 'object' && obj !== null && 'summary' in obj && 'files' in obj;
|
|
70
|
+
}
|
|
71
|
+
function generateHtml(coverageObj) {
|
|
72
|
+
const { summary, files } = coverageObj;
|
|
73
|
+
const coveragePercent = (summary.lineRate * 100).toFixed(2);
|
|
74
|
+
const coverageColor = summary.lineRate >= 0.8 ? '#4caf50' : summary.lineRate >= 0.6 ? '#ff9800' : '#f44336';
|
|
75
|
+
const fileRows = files
|
|
76
|
+
.map((file) => {
|
|
77
|
+
const filePercent = (file.lineRate * 100).toFixed(2);
|
|
78
|
+
const fileColor = file.lineRate >= 0.8 ? '#4caf50' : file.lineRate >= 0.6 ? '#ff9800' : '#f44336';
|
|
79
|
+
const lineDetails = file.lines
|
|
80
|
+
.map((line) => {
|
|
81
|
+
const lineClass = line.covered ? 'covered' : 'uncovered';
|
|
82
|
+
const lineColor = line.covered ? '#c8e6c9' : '#ffcdd2';
|
|
83
|
+
return `<tr class="${lineClass}" style="background-color: ${lineColor}">
|
|
84
|
+
<td class="line-number">${line.lineNumber}</td>
|
|
85
|
+
<td class="hit-count">${line.hitCount}</td>
|
|
86
|
+
<td class="line-content"></td>
|
|
87
|
+
</tr>`;
|
|
88
|
+
})
|
|
89
|
+
.join('\n');
|
|
90
|
+
return `
|
|
91
|
+
<div class="file-section">
|
|
92
|
+
<h3 class="file-header" onclick="toggleFile('${file.filePath.replace(/'/g, "\\'")}')">
|
|
93
|
+
<span class="file-name">${escapeHtml(file.filePath)}</span>
|
|
94
|
+
<span class="file-stats">
|
|
95
|
+
${file.coveredLines}/${file.totalLines} lines (${filePercent}%)
|
|
96
|
+
<span class="coverage-bar" style="background-color: ${fileColor}; width: ${filePercent}%"></span>
|
|
97
|
+
</span>
|
|
98
|
+
</h3>
|
|
99
|
+
<div id="file-${file.filePath.replace(/[^a-zA-Z0-9]/g, '-')}" class="file-details" style="display: none;">
|
|
100
|
+
<table class="line-coverage">
|
|
101
|
+
<thead>
|
|
102
|
+
<tr>
|
|
103
|
+
<th>Line</th>
|
|
104
|
+
<th>Hits</th>
|
|
105
|
+
<th>Code</th>
|
|
106
|
+
</tr>
|
|
107
|
+
</thead>
|
|
108
|
+
<tbody>
|
|
109
|
+
${lineDetails}
|
|
110
|
+
</tbody>
|
|
111
|
+
</table>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
`;
|
|
115
|
+
})
|
|
116
|
+
.join('\n');
|
|
117
|
+
return `<!DOCTYPE html>
|
|
118
|
+
<html lang="en">
|
|
119
|
+
<head>
|
|
120
|
+
<meta charset="UTF-8">
|
|
121
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
122
|
+
<title>Code Coverage Report</title>
|
|
123
|
+
<style>
|
|
124
|
+
* {
|
|
125
|
+
margin: 0;
|
|
126
|
+
padding: 0;
|
|
127
|
+
box-sizing: border-box;
|
|
128
|
+
}
|
|
129
|
+
body {
|
|
130
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
|
131
|
+
line-height: 1.6;
|
|
132
|
+
color: #333;
|
|
133
|
+
background-color: #f5f5f5;
|
|
134
|
+
padding: 20px;
|
|
135
|
+
}
|
|
136
|
+
.container {
|
|
137
|
+
max-width: 1200px;
|
|
138
|
+
margin: 0 auto;
|
|
139
|
+
background: white;
|
|
140
|
+
border-radius: 8px;
|
|
141
|
+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
|
142
|
+
padding: 30px;
|
|
143
|
+
}
|
|
144
|
+
h1 {
|
|
145
|
+
color: #2c3e50;
|
|
146
|
+
margin-bottom: 30px;
|
|
147
|
+
border-bottom: 3px solid #3498db;
|
|
148
|
+
padding-bottom: 10px;
|
|
149
|
+
}
|
|
150
|
+
.summary {
|
|
151
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
152
|
+
color: white;
|
|
153
|
+
padding: 25px;
|
|
154
|
+
border-radius: 8px;
|
|
155
|
+
margin-bottom: 30px;
|
|
156
|
+
}
|
|
157
|
+
.summary h2 {
|
|
158
|
+
margin-bottom: 15px;
|
|
159
|
+
font-size: 1.5em;
|
|
160
|
+
}
|
|
161
|
+
.summary-stats {
|
|
162
|
+
display: grid;
|
|
163
|
+
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
|
164
|
+
gap: 20px;
|
|
165
|
+
margin-top: 15px;
|
|
166
|
+
}
|
|
167
|
+
.stat-item {
|
|
168
|
+
background: rgba(255, 255, 255, 0.2);
|
|
169
|
+
padding: 15px;
|
|
170
|
+
border-radius: 6px;
|
|
171
|
+
}
|
|
172
|
+
.stat-label {
|
|
173
|
+
font-size: 0.9em;
|
|
174
|
+
opacity: 0.9;
|
|
175
|
+
margin-bottom: 5px;
|
|
176
|
+
}
|
|
177
|
+
.stat-value {
|
|
178
|
+
font-size: 1.8em;
|
|
179
|
+
font-weight: bold;
|
|
180
|
+
}
|
|
181
|
+
.coverage-percent {
|
|
182
|
+
font-size: 3em;
|
|
183
|
+
font-weight: bold;
|
|
184
|
+
margin: 10px 0;
|
|
185
|
+
}
|
|
186
|
+
.file-section {
|
|
187
|
+
margin-bottom: 20px;
|
|
188
|
+
border: 1px solid #ddd;
|
|
189
|
+
border-radius: 6px;
|
|
190
|
+
overflow: hidden;
|
|
191
|
+
}
|
|
192
|
+
.file-header {
|
|
193
|
+
background: #f8f9fa;
|
|
194
|
+
padding: 15px;
|
|
195
|
+
cursor: pointer;
|
|
196
|
+
display: flex;
|
|
197
|
+
justify-content: space-between;
|
|
198
|
+
align-items: center;
|
|
199
|
+
transition: background-color 0.2s;
|
|
200
|
+
}
|
|
201
|
+
.file-header:hover {
|
|
202
|
+
background: #e9ecef;
|
|
203
|
+
}
|
|
204
|
+
.file-name {
|
|
205
|
+
font-weight: 600;
|
|
206
|
+
color: #2c3e50;
|
|
207
|
+
}
|
|
208
|
+
.file-stats {
|
|
209
|
+
display: flex;
|
|
210
|
+
align-items: center;
|
|
211
|
+
gap: 10px;
|
|
212
|
+
}
|
|
213
|
+
.coverage-bar {
|
|
214
|
+
height: 20px;
|
|
215
|
+
min-width: 100px;
|
|
216
|
+
border-radius: 4px;
|
|
217
|
+
display: inline-block;
|
|
218
|
+
}
|
|
219
|
+
.file-details {
|
|
220
|
+
padding: 0;
|
|
221
|
+
}
|
|
222
|
+
.line-coverage {
|
|
223
|
+
width: 100%;
|
|
224
|
+
border-collapse: collapse;
|
|
225
|
+
font-family: 'Courier New', monospace;
|
|
226
|
+
font-size: 0.9em;
|
|
227
|
+
}
|
|
228
|
+
.line-coverage thead {
|
|
229
|
+
background: #34495e;
|
|
230
|
+
color: white;
|
|
231
|
+
}
|
|
232
|
+
.line-coverage th {
|
|
233
|
+
padding: 10px;
|
|
234
|
+
text-align: left;
|
|
235
|
+
font-weight: 600;
|
|
236
|
+
}
|
|
237
|
+
.line-coverage td {
|
|
238
|
+
padding: 5px 10px;
|
|
239
|
+
border-bottom: 1px solid #eee;
|
|
240
|
+
}
|
|
241
|
+
.line-number {
|
|
242
|
+
text-align: right;
|
|
243
|
+
width: 80px;
|
|
244
|
+
color: #666;
|
|
245
|
+
font-weight: 600;
|
|
246
|
+
}
|
|
247
|
+
.hit-count {
|
|
248
|
+
text-align: right;
|
|
249
|
+
width: 80px;
|
|
250
|
+
color: #666;
|
|
251
|
+
}
|
|
252
|
+
.line-content {
|
|
253
|
+
width: auto;
|
|
254
|
+
}
|
|
255
|
+
.covered {
|
|
256
|
+
background-color: #c8e6c9 !important;
|
|
257
|
+
}
|
|
258
|
+
.uncovered {
|
|
259
|
+
background-color: #ffcdd2 !important;
|
|
260
|
+
}
|
|
261
|
+
@media (max-width: 768px) {
|
|
262
|
+
.file-header {
|
|
263
|
+
flex-direction: column;
|
|
264
|
+
align-items: flex-start;
|
|
265
|
+
gap: 10px;
|
|
266
|
+
}
|
|
267
|
+
.summary-stats {
|
|
268
|
+
grid-template-columns: 1fr;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
</style>
|
|
272
|
+
</head>
|
|
273
|
+
<body>
|
|
274
|
+
<div class="container">
|
|
275
|
+
<h1>Code Coverage Report</h1>
|
|
276
|
+
|
|
277
|
+
<div class="summary">
|
|
278
|
+
<h2>Summary</h2>
|
|
279
|
+
<div class="coverage-percent" style="color: ${coverageColor}">${coveragePercent}%</div>
|
|
280
|
+
<div class="summary-stats">
|
|
281
|
+
<div class="stat-item">
|
|
282
|
+
<div class="stat-label">Total Lines</div>
|
|
283
|
+
<div class="stat-value">${summary.totalLines}</div>
|
|
284
|
+
</div>
|
|
285
|
+
<div class="stat-item">
|
|
286
|
+
<div class="stat-label">Covered Lines</div>
|
|
287
|
+
<div class="stat-value">${summary.coveredLines}</div>
|
|
288
|
+
</div>
|
|
289
|
+
<div class="stat-item">
|
|
290
|
+
<div class="stat-label">Uncovered Lines</div>
|
|
291
|
+
<div class="stat-value">${summary.uncoveredLines}</div>
|
|
292
|
+
</div>
|
|
293
|
+
<div class="stat-item">
|
|
294
|
+
<div class="stat-label">Files</div>
|
|
295
|
+
<div class="stat-value">${files.length}</div>
|
|
296
|
+
</div>
|
|
297
|
+
</div>
|
|
298
|
+
</div>
|
|
299
|
+
|
|
300
|
+
<h2 style="margin: 30px 0 20px 0; color: #2c3e50;">File Coverage Details</h2>
|
|
301
|
+
|
|
302
|
+
${fileRows}
|
|
303
|
+
</div>
|
|
304
|
+
|
|
305
|
+
<script>
|
|
306
|
+
function toggleFile(filePath) {
|
|
307
|
+
const id = 'file-' + filePath.replace(/[^a-zA-Z0-9]/g, '-');
|
|
308
|
+
const element = document.getElementById(id);
|
|
309
|
+
if (element) {
|
|
310
|
+
element.style.display = element.style.display === 'none' ? 'block' : 'none';
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
</script>
|
|
314
|
+
</body>
|
|
315
|
+
</html>`;
|
|
316
|
+
}
|
|
317
|
+
function escapeHtml(text) {
|
|
318
|
+
const map = {
|
|
319
|
+
'&': '&',
|
|
320
|
+
'<': '<',
|
|
321
|
+
'>': '>',
|
|
322
|
+
'"': '"',
|
|
323
|
+
"'": ''',
|
|
324
|
+
};
|
|
325
|
+
return text.replace(/[&<>"']/g, (m) => map[m]);
|
|
326
|
+
}
|
|
65
327
|
//# sourceMappingURL=reportGenerator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reportGenerator.js","sourceRoot":"","sources":["../../src/transformers/reportGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"reportGenerator.js","sourceRoot":"","sources":["../../src/transformers/reportGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAcrC,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,MAAM,CAA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AE,MAAM;QACX,GAAG,EAAE,MAAM;QACX,GAAG,EAAE,QAAQ;QACb,GAAG,EAAE,QAAQ;KACd,CAAC;IACF,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACjD,CAAC"}
|
package/lib/utils/types.d.ts
CHANGED
|
@@ -155,7 +155,7 @@ export type CloverCoverageObject = {
|
|
|
155
155
|
};
|
|
156
156
|
export type CoverageHandler = {
|
|
157
157
|
processFile(filePath: string, fileName: string, lines: Record<string, number>): void;
|
|
158
|
-
finalize(): SonarCoverageObject | CoberturaCoverageObject | CloverCoverageObject | LcovCoverageObject | JaCoCoCoverageObject | IstanbulCoverageObject | JsonSummaryCoverageObject | SimpleCovCoverageObject | OpenCoverCoverageObject;
|
|
158
|
+
finalize(): SonarCoverageObject | CoberturaCoverageObject | CloverCoverageObject | LcovCoverageObject | JaCoCoCoverageObject | IstanbulCoverageObject | JsonSummaryCoverageObject | SimpleCovCoverageObject | OpenCoverCoverageObject | HtmlCoverageObject;
|
|
159
159
|
};
|
|
160
160
|
type LcovLine = {
|
|
161
161
|
lineNumber: number;
|
|
@@ -310,4 +310,26 @@ export type OpenCoverCoverageObject = {
|
|
|
310
310
|
};
|
|
311
311
|
};
|
|
312
312
|
};
|
|
313
|
+
export type HtmlFileCoverage = {
|
|
314
|
+
filePath: string;
|
|
315
|
+
fileName: string;
|
|
316
|
+
totalLines: number;
|
|
317
|
+
coveredLines: number;
|
|
318
|
+
uncoveredLines: number;
|
|
319
|
+
lineRate: number;
|
|
320
|
+
lines: Array<{
|
|
321
|
+
lineNumber: number;
|
|
322
|
+
hitCount: number;
|
|
323
|
+
covered: boolean;
|
|
324
|
+
}>;
|
|
325
|
+
};
|
|
326
|
+
export type HtmlCoverageObject = {
|
|
327
|
+
summary: {
|
|
328
|
+
totalLines: number;
|
|
329
|
+
coveredLines: number;
|
|
330
|
+
uncoveredLines: number;
|
|
331
|
+
lineRate: number;
|
|
332
|
+
};
|
|
333
|
+
files: HtmlFileCoverage[];
|
|
334
|
+
};
|
|
313
335
|
export {};
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apex-code-coverage-transformer",
|
|
3
3
|
"description": "Transform Salesforce Apex code coverage JSONs into other formats accepted by SonarQube, GitHub, GitLab, Azure, Bitbucket, etc.",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.16.0",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@oclif/core": "^4.8.0",
|
|
7
7
|
"@salesforce/core": "^8.24.0",
|