accessibility-checker 4.0.1 → 4.0.2
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/bin/achecker.js +213 -262
- package/bin/achecker.js.map +1 -1
- package/cjs/bin/achecker.d.ts +2 -0
- package/cjs/bin/achecker.js +306 -0
- package/cjs/bin/achecker.js.map +1 -0
- package/cjs/index.d.ts +319 -0
- package/cjs/index.js +402 -0
- package/cjs/index.js.map +1 -0
- package/cjs/lib/ACBrowserManager.d.ts +22 -0
- package/cjs/lib/ACBrowserManager.js +172 -0
- package/cjs/lib/ACBrowserManager.js.map +1 -0
- package/cjs/lib/ACEngineManager.d.ts +19 -0
- package/cjs/lib/ACEngineManager.js +457 -0
- package/cjs/lib/ACEngineManager.js.map +1 -0
- package/cjs/lib/ACHelper.d.ts +2 -0
- package/cjs/lib/ACHelper.js +678 -0
- package/cjs/lib/ACHelper.js.map +1 -0
- package/cjs/lib/api/IChecker.d.ts +28 -0
- package/cjs/lib/api/IChecker.js +11 -0
- package/cjs/lib/api/IChecker.js.map +1 -0
- package/cjs/lib/api/IMapper.d.ts +37 -0
- package/cjs/lib/api/IMapper.js +18 -0
- package/cjs/lib/api/IMapper.js.map +1 -0
- package/cjs/lib/common/api-ext/Fetch.d.ts +17 -0
- package/cjs/lib/common/api-ext/Fetch.js +95 -0
- package/cjs/lib/common/api-ext/Fetch.js.map +1 -0
- package/cjs/lib/common/api-ext/IAbstractAPI.d.ts +33 -0
- package/cjs/lib/common/api-ext/IAbstractAPI.js +18 -0
- package/cjs/lib/common/api-ext/IAbstractAPI.js.map +1 -0
- package/cjs/lib/common/config/ACConfigManager.d.ts +13 -0
- package/cjs/lib/common/config/ACConfigManager.js +483 -0
- package/cjs/lib/common/config/ACConfigManager.js.map +1 -0
- package/cjs/lib/common/config/ACConstants.d.ts +17 -0
- package/cjs/lib/common/config/ACConstants.js +111 -0
- package/cjs/lib/common/config/ACConstants.js.map +1 -0
- package/cjs/lib/common/config/IArchive.d.ts +37 -0
- package/cjs/lib/common/config/IArchive.js +18 -0
- package/cjs/lib/common/config/IArchive.js.map +1 -0
- package/cjs/lib/common/config/IConfig.d.ts +152 -0
- package/cjs/lib/common/config/IConfig.js +36 -0
- package/cjs/lib/common/config/IConfig.js.map +1 -0
- package/cjs/lib/common/engine/IBounds.d.ts +21 -0
- package/cjs/lib/common/engine/IBounds.js +18 -0
- package/cjs/lib/common/engine/IBounds.js.map +1 -0
- package/cjs/lib/common/engine/IChecker.d.ts +23 -0
- package/cjs/lib/common/engine/IChecker.js +18 -0
- package/cjs/lib/common/engine/IChecker.js.map +1 -0
- package/cjs/lib/common/engine/IEngine.d.ts +39 -0
- package/cjs/lib/common/engine/IEngine.js +18 -0
- package/cjs/lib/common/engine/IEngine.js.map +1 -0
- package/cjs/lib/common/engine/IGuideline.d.ts +53 -0
- package/cjs/lib/common/engine/IGuideline.js +37 -0
- package/cjs/lib/common/engine/IGuideline.js.map +1 -0
- package/cjs/lib/common/engine/IMapper.d.ts +32 -0
- package/cjs/lib/common/engine/IMapper.js +18 -0
- package/cjs/lib/common/engine/IMapper.js.map +1 -0
- package/cjs/lib/common/engine/IReport.d.ts +143 -0
- package/cjs/lib/common/engine/IReport.js +44 -0
- package/cjs/lib/common/engine/IReport.js.map +1 -0
- package/cjs/lib/common/engine/IRule.d.ts +100 -0
- package/cjs/lib/common/engine/IRule.js +87 -0
- package/cjs/lib/common/engine/IRule.js.map +1 -0
- package/cjs/lib/common/engine/IRuleset.d.ts +20 -0
- package/cjs/lib/common/engine/IRuleset.js +18 -0
- package/cjs/lib/common/engine/IRuleset.js.map +1 -0
- package/cjs/lib/common/report/ACReporterCSV.d.ts +28 -0
- package/cjs/lib/common/report/ACReporterCSV.js +75 -0
- package/cjs/lib/common/report/ACReporterCSV.js.map +1 -0
- package/cjs/lib/common/report/ACReporterHTML.d.ts +27 -0
- package/cjs/lib/common/report/ACReporterHTML.js +61 -0
- package/cjs/lib/common/report/ACReporterHTML.js.map +1 -0
- package/cjs/lib/common/report/ACReporterJSON.d.ts +36 -0
- package/cjs/lib/common/report/ACReporterJSON.js +109 -0
- package/cjs/lib/common/report/ACReporterJSON.js.map +1 -0
- package/cjs/lib/common/report/ACReporterMetrics.d.ts +78 -0
- package/cjs/lib/common/report/ACReporterMetrics.js +135 -0
- package/cjs/lib/common/report/ACReporterMetrics.js.map +1 -0
- package/cjs/lib/common/report/ACReporterXLSX.d.ts +38 -0
- package/cjs/lib/common/report/ACReporterXLSX.js +996 -0
- package/cjs/lib/common/report/ACReporterXLSX.js.map +1 -0
- package/cjs/lib/common/report/BaselineManager.d.ts +169 -0
- package/cjs/lib/common/report/BaselineManager.js +382 -0
- package/cjs/lib/common/report/BaselineManager.js.map +1 -0
- package/cjs/lib/common/report/ReporterManager.d.ts +79 -0
- package/cjs/lib/common/report/ReporterManager.js +469 -0
- package/cjs/lib/common/report/ReporterManager.js.map +1 -0
- package/cjs/lib/common/report/genReport.d.ts +1 -0
- package/cjs/lib/common/report/genReport.js +12 -0
- package/cjs/lib/common/report/genReport.js.map +1 -0
- package/cjs/package.json +3 -0
- package/index.js +21 -63
- package/index.js.map +1 -1
- package/lib/ACBrowserManager.js +138 -203
- package/lib/ACBrowserManager.js.map +1 -1
- package/lib/ACEngineManager.js +395 -402
- package/lib/ACEngineManager.js.map +1 -1
- package/lib/ACHelper.js +581 -642
- package/lib/ACHelper.js.map +1 -1
- package/lib/common/api-ext/Fetch.js +58 -78
- package/lib/common/api-ext/Fetch.js.map +1 -1
- package/lib/common/config/ACConfigManager.js +271 -281
- package/lib/common/config/ACConfigManager.js.map +1 -1
- package/lib/common/config/ACConstants.js +38 -4
- package/lib/common/config/ACConstants.js.map +1 -1
- package/lib/common/config/IConfig.d.ts +1 -1
- package/lib/common/report/ACReporterCSV.js +42 -77
- package/lib/common/report/ACReporterCSV.js.map +1 -1
- package/lib/common/report/ACReporterHTML.js +15 -48
- package/lib/common/report/ACReporterHTML.js.map +1 -1
- package/lib/common/report/ACReporterJSON.js +59 -94
- package/lib/common/report/ACReporterJSON.js.map +1 -1
- package/lib/common/report/ACReporterMetrics.js +45 -108
- package/lib/common/report/ACReporterMetrics.js.map +1 -1
- package/lib/common/report/ACReporterXLSX.js +282 -300
- package/lib/common/report/ACReporterXLSX.js.map +1 -1
- package/lib/common/report/BaselineManager.js +82 -56
- package/lib/common/report/BaselineManager.js.map +1 -1
- package/lib/common/report/ReporterManager.js +125 -190
- package/lib/common/report/ReporterManager.js.map +1 -1
- package/lib/common/report/genReport.js +2 -2
- package/mjs/bin/achecker.d.ts +2 -0
- package/mjs/bin/achecker.js +236 -0
- package/mjs/bin/achecker.js.map +1 -0
- package/mjs/index.d.ts +319 -0
- package/mjs/index.js +368 -0
- package/mjs/index.js.map +1 -0
- package/mjs/lib/ACBrowserManager.d.ts +22 -0
- package/mjs/lib/ACBrowserManager.js +121 -0
- package/mjs/lib/ACBrowserManager.js.map +1 -0
- package/mjs/lib/ACEngineManager.d.ts +19 -0
- package/mjs/lib/ACEngineManager.js +397 -0
- package/mjs/lib/ACEngineManager.js.map +1 -0
- package/mjs/lib/ACHelper.d.ts +2 -0
- package/mjs/lib/ACHelper.js +614 -0
- package/mjs/lib/ACHelper.js.map +1 -0
- package/mjs/lib/api/IChecker.d.ts +28 -0
- package/mjs/lib/api/IChecker.js +8 -0
- package/mjs/lib/api/IChecker.js.map +1 -0
- package/mjs/lib/api/IMapper.d.ts +37 -0
- package/mjs/lib/api/IMapper.js +17 -0
- package/mjs/lib/api/IMapper.js.map +1 -0
- package/mjs/lib/common/api-ext/Fetch.d.ts +17 -0
- package/mjs/lib/common/api-ext/Fetch.js +45 -0
- package/mjs/lib/common/api-ext/Fetch.js.map +1 -0
- package/mjs/lib/common/api-ext/IAbstractAPI.d.ts +33 -0
- package/mjs/lib/common/api-ext/IAbstractAPI.js +17 -0
- package/mjs/lib/common/api-ext/IAbstractAPI.js.map +1 -0
- package/mjs/lib/common/config/ACConfigManager.d.ts +13 -0
- package/mjs/lib/common/config/ACConfigManager.js +421 -0
- package/mjs/lib/common/config/ACConfigManager.js.map +1 -0
- package/mjs/lib/common/config/ACConstants.d.ts +17 -0
- package/mjs/lib/common/config/ACConstants.js +75 -0
- package/mjs/lib/common/config/ACConstants.js.map +1 -0
- package/mjs/lib/common/config/IArchive.d.ts +37 -0
- package/mjs/lib/common/config/IArchive.js +17 -0
- package/mjs/lib/common/config/IArchive.js.map +1 -0
- package/mjs/lib/common/config/IConfig.d.ts +152 -0
- package/mjs/lib/common/config/IConfig.js +33 -0
- package/mjs/lib/common/config/IConfig.js.map +1 -0
- package/mjs/lib/common/engine/IBounds.d.ts +21 -0
- package/mjs/lib/common/engine/IBounds.js +17 -0
- package/mjs/lib/common/engine/IBounds.js.map +1 -0
- package/mjs/lib/common/engine/IChecker.d.ts +23 -0
- package/mjs/lib/common/engine/IChecker.js +17 -0
- package/mjs/lib/common/engine/IChecker.js.map +1 -0
- package/mjs/lib/common/engine/IEngine.d.ts +39 -0
- package/mjs/lib/common/engine/IEngine.js +17 -0
- package/mjs/lib/common/engine/IEngine.js.map +1 -0
- package/mjs/lib/common/engine/IGuideline.d.ts +53 -0
- package/mjs/lib/common/engine/IGuideline.js +34 -0
- package/mjs/lib/common/engine/IGuideline.js.map +1 -0
- package/mjs/lib/common/engine/IMapper.d.ts +32 -0
- package/mjs/lib/common/engine/IMapper.js +17 -0
- package/mjs/lib/common/engine/IMapper.js.map +1 -0
- package/mjs/lib/common/engine/IReport.d.ts +143 -0
- package/mjs/lib/common/engine/IReport.js +36 -0
- package/mjs/lib/common/engine/IReport.js.map +1 -0
- package/mjs/lib/common/engine/IRule.d.ts +100 -0
- package/mjs/lib/common/engine/IRule.js +79 -0
- package/mjs/lib/common/engine/IRule.js.map +1 -0
- package/mjs/lib/common/engine/IRuleset.d.ts +20 -0
- package/mjs/lib/common/engine/IRuleset.js +17 -0
- package/mjs/lib/common/engine/IRuleset.js.map +1 -0
- package/mjs/lib/common/report/ACReporterCSV.d.ts +28 -0
- package/mjs/lib/common/report/ACReporterCSV.js +60 -0
- package/mjs/lib/common/report/ACReporterCSV.js.map +1 -0
- package/mjs/lib/common/report/ACReporterHTML.d.ts +27 -0
- package/mjs/lib/common/report/ACReporterHTML.js +46 -0
- package/mjs/lib/common/report/ACReporterHTML.js.map +1 -0
- package/mjs/lib/common/report/ACReporterJSON.d.ts +36 -0
- package/mjs/lib/common/report/ACReporterJSON.js +94 -0
- package/mjs/lib/common/report/ACReporterJSON.js.map +1 -0
- package/mjs/lib/common/report/ACReporterMetrics.d.ts +78 -0
- package/mjs/lib/common/report/ACReporterMetrics.js +122 -0
- package/mjs/lib/common/report/ACReporterMetrics.js.map +1 -0
- package/mjs/lib/common/report/ACReporterXLSX.d.ts +38 -0
- package/mjs/lib/common/report/ACReporterXLSX.js +948 -0
- package/mjs/lib/common/report/ACReporterXLSX.js.map +1 -0
- package/mjs/lib/common/report/BaselineManager.d.ts +169 -0
- package/mjs/lib/common/report/BaselineManager.js +348 -0
- package/mjs/lib/common/report/BaselineManager.js.map +1 -0
- package/mjs/lib/common/report/ReporterManager.d.ts +79 -0
- package/mjs/lib/common/report/ReporterManager.js +469 -0
- package/mjs/lib/common/report/ReporterManager.js.map +1 -0
- package/mjs/lib/common/report/genReport.d.ts +1 -0
- package/mjs/lib/common/report/genReport.js +9 -0
- package/mjs/lib/common/report/genReport.js.map +1 -0
- package/mjs/package.json +3 -0
- package/package.json +10 -4
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/******************************************************************************
|
|
3
|
+
Copyright:: 2020- IBM, Inc
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
|
16
|
+
*****************************************************************************/
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.ACReporterJSON = void 0;
|
|
28
|
+
const ReporterManager_js_1 = require("./ReporterManager.js");
|
|
29
|
+
class ACReporterJSON {
|
|
30
|
+
name() {
|
|
31
|
+
return "json";
|
|
32
|
+
}
|
|
33
|
+
generateReport(config, rulesets, storedReport) {
|
|
34
|
+
let outReport = JSON.parse(JSON.stringify(storedReport.engineReport));
|
|
35
|
+
outReport.summary = ACReporterJSON.generateReportSummary(config, rulesets, storedReport);
|
|
36
|
+
delete outReport.totalTime;
|
|
37
|
+
outReport.scanID = config.scanID;
|
|
38
|
+
outReport.toolID = config.toolID;
|
|
39
|
+
outReport.label = storedReport.label;
|
|
40
|
+
return {
|
|
41
|
+
reportPath: `${storedReport.label.replace(/[:?&=]/g, "_")}.json`,
|
|
42
|
+
report: JSON.stringify(outReport, null, 4)
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
generateSummary(config, _rulesets, endReport, compressedReports) {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
if (compressedReports && compressedReports.length > 0) {
|
|
48
|
+
let storedScan = ReporterManager_js_1.ReporterManager.uncompressReport(compressedReports[0]);
|
|
49
|
+
let retVal = {
|
|
50
|
+
counts: {
|
|
51
|
+
ignored: 0,
|
|
52
|
+
violation: 0,
|
|
53
|
+
recommendation: 0,
|
|
54
|
+
pass: 0,
|
|
55
|
+
potentialviolation: 0,
|
|
56
|
+
potentialrecommendation: 0,
|
|
57
|
+
manual: 0,
|
|
58
|
+
elements: 0,
|
|
59
|
+
elementsViolation: 0,
|
|
60
|
+
elementsViolationReview: 0
|
|
61
|
+
},
|
|
62
|
+
startReport: storedScan.engineReport.summary.startScan,
|
|
63
|
+
endReport: endReport,
|
|
64
|
+
toolID: config.toolID,
|
|
65
|
+
policies: config.policies,
|
|
66
|
+
reportLevels: config.reportLevels,
|
|
67
|
+
labels: config.label,
|
|
68
|
+
failLevels: config.failLevels,
|
|
69
|
+
scanID: config.scanID,
|
|
70
|
+
pageScanSummary: []
|
|
71
|
+
};
|
|
72
|
+
for (const compressedReport of compressedReports) {
|
|
73
|
+
let storedScan = ReporterManager_js_1.ReporterManager.uncompressReport(compressedReport);
|
|
74
|
+
let counts = storedScan.engineReport.summary.counts;
|
|
75
|
+
retVal.pageScanSummary.push({
|
|
76
|
+
label: storedScan.label,
|
|
77
|
+
counts
|
|
78
|
+
});
|
|
79
|
+
for (const key in counts) {
|
|
80
|
+
retVal.counts[key] += counts[key];
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
let startScan = new Date(storedScan.engineReport.summary.startScan);
|
|
84
|
+
let reportFilename = `summary_${startScan.toISOString().replace(/:/g, "-")}.json`;
|
|
85
|
+
if (config.outputFilenameTimestamp === false) {
|
|
86
|
+
reportFilename = `summary.json`;
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
summaryPath: reportFilename,
|
|
90
|
+
summary: JSON.stringify(retVal, null, 4)
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
static generateReportSummary(config, rulesets, storedReport) {
|
|
96
|
+
let { engineReport, startScan, url } = storedReport;
|
|
97
|
+
return {
|
|
98
|
+
counts: engineReport.summary.counts,
|
|
99
|
+
scanTime: engineReport.totalTime,
|
|
100
|
+
ruleArchive: config.ruleArchiveLabel,
|
|
101
|
+
policies: config.policies,
|
|
102
|
+
reportLevels: config.reportLevels,
|
|
103
|
+
startScan: startScan,
|
|
104
|
+
URL: url
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
exports.ACReporterJSON = ACReporterJSON;
|
|
109
|
+
//# sourceMappingURL=ACReporterJSON.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ACReporterJSON.js","sourceRoot":"","sources":["../../../../../src-ts/lib/common/report/ACReporterJSON.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;gFAcgF;;;;;;;;;;;;AAKhF,6DAAkG;AAElG,MAAa,cAAc;IAChB,IAAI;QACP,OAAO,MAAM,CAAC;IAClB,CAAC;IACM,cAAc,CAAC,MAAuB,EAAE,QAAqB,EAAE,YAA6B;QAC/F,IAAI,SAAS,GAAoB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC;QACvF,SAAS,CAAC,OAAO,GAAG,cAAc,CAAC,qBAAqB,CAAC,MAAM,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;QACzF,OAAQ,SAAiB,CAAC,SAAS,CAAC;QACpC,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QACjC,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QACjC,SAAS,CAAC,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC;QAErC,OAAO;YACH,UAAU,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,EAAC,GAAG,CAAC,OAAO;YAC/D,MAAM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
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*****************************************************************************/
|
|
16
|
+
import { IConfigInternal } from "../config/IConfig.js";
|
|
17
|
+
import { Guideline } from "../engine/IGuideline.js";
|
|
18
|
+
import { CompressedReport } from "../engine/IReport.js";
|
|
19
|
+
import { GenSummReturn, IReporter, IReporterStored } from "./ReporterManager.js";
|
|
20
|
+
/*******************************************************************************
|
|
21
|
+
* NAME: ACMetricsLogger.js
|
|
22
|
+
* DESCRIPTION: Common Metrics logger object which can be shared between tools
|
|
23
|
+
* to upload metrics of the tool to the metrics server.
|
|
24
|
+
*******************************************************************************/
|
|
25
|
+
/**
|
|
26
|
+
* This function is responsible for constructing the accessibility-checker Metrics object which contains all the function
|
|
27
|
+
* that are needed to upload scan metrics to the metric server.
|
|
28
|
+
*
|
|
29
|
+
* @param {String} toolName - The name of the tool sending the metrics.
|
|
30
|
+
* @param {String} logger - Logger object which can be used to log debug information.
|
|
31
|
+
* @param {String} policies - Array of policies which will be sent to the metrics server.
|
|
32
|
+
*
|
|
33
|
+
* @return - N/A
|
|
34
|
+
*
|
|
35
|
+
* @memberOf this
|
|
36
|
+
*/
|
|
37
|
+
export declare class ACReporterMetrics implements IReporter {
|
|
38
|
+
name(): string;
|
|
39
|
+
policies: string;
|
|
40
|
+
metricsURLV2: string;
|
|
41
|
+
toolName: string;
|
|
42
|
+
scanTimesV1: any[];
|
|
43
|
+
scanTimesV2: {
|
|
44
|
+
[profile: string]: number[];
|
|
45
|
+
};
|
|
46
|
+
constructor(toolName: string, policies: string[]);
|
|
47
|
+
/**
|
|
48
|
+
* This function is responsible for profiling the testcases and adding the scan time to the global
|
|
49
|
+
* array which will be sent to the metrics server to log the number of scans that were performed.
|
|
50
|
+
* This function profiles scanTimes for the V2 metric server:
|
|
51
|
+
* https://aat.w3ibm.mybluemix.net
|
|
52
|
+
*
|
|
53
|
+
* In the case that user provides any url that is https://aat* it will upload based on accountId
|
|
54
|
+
*
|
|
55
|
+
* @param {String} scanTime - Provide the time it took for the testcase to run
|
|
56
|
+
* @param {String} profile - The type of profile the scan time is for:
|
|
57
|
+
* i.e. browser information, features, etc...
|
|
58
|
+
*
|
|
59
|
+
* @return N/A - Global scanTimesV2 object is updated with the time
|
|
60
|
+
*
|
|
61
|
+
* @memberOf this
|
|
62
|
+
*/
|
|
63
|
+
generateReport(config: IConfigInternal, rulesets: Guideline[], storedReport: IReporterStored): {
|
|
64
|
+
reportPath: string;
|
|
65
|
+
report: string;
|
|
66
|
+
} | void;
|
|
67
|
+
/**
|
|
68
|
+
* This function is responsible for uploading scan results to the metrics server:
|
|
69
|
+
* https://aat.w3ibm.mybluemix.net
|
|
70
|
+
*
|
|
71
|
+
* @param {Function} done - The browser on which the testcases were run on
|
|
72
|
+
*
|
|
73
|
+
* @return N/A - performs the upload of the metrics to the server
|
|
74
|
+
*
|
|
75
|
+
* @memberOf this
|
|
76
|
+
*/
|
|
77
|
+
generateSummary(config: IConfigInternal, rulesets: Guideline[], endReport: number, summaryData: CompressedReport[]): Promise<GenSummReturn>;
|
|
78
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/******************************************************************************
|
|
3
|
+
Copyright:: 2020- IBM, Inc
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
|
16
|
+
*****************************************************************************/
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.ACReporterMetrics = void 0;
|
|
28
|
+
const Fetch_js_1 = require("../api-ext/Fetch.js");
|
|
29
|
+
/*******************************************************************************
|
|
30
|
+
* NAME: ACMetricsLogger.js
|
|
31
|
+
* DESCRIPTION: Common Metrics logger object which can be shared between tools
|
|
32
|
+
* to upload metrics of the tool to the metrics server.
|
|
33
|
+
*******************************************************************************/
|
|
34
|
+
/**
|
|
35
|
+
* This function is responsible for constructing the accessibility-checker Metrics object which contains all the function
|
|
36
|
+
* that are needed to upload scan metrics to the metric server.
|
|
37
|
+
*
|
|
38
|
+
* @param {String} toolName - The name of the tool sending the metrics.
|
|
39
|
+
* @param {String} logger - Logger object which can be used to log debug information.
|
|
40
|
+
* @param {String} policies - Array of policies which will be sent to the metrics server.
|
|
41
|
+
*
|
|
42
|
+
* @return - N/A
|
|
43
|
+
*
|
|
44
|
+
* @memberOf this
|
|
45
|
+
*/
|
|
46
|
+
class ACReporterMetrics {
|
|
47
|
+
name() {
|
|
48
|
+
return "metrics";
|
|
49
|
+
}
|
|
50
|
+
constructor(toolName, policies) {
|
|
51
|
+
this.metricsURLV2 = "https://able.ibm.com/tools";
|
|
52
|
+
this.scanTimesV1 = [];
|
|
53
|
+
this.scanTimesV2 = {};
|
|
54
|
+
this.policies = policies.join(",");
|
|
55
|
+
// Init all the local object variables
|
|
56
|
+
this.toolName = toolName;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* This function is responsible for profiling the testcases and adding the scan time to the global
|
|
60
|
+
* array which will be sent to the metrics server to log the number of scans that were performed.
|
|
61
|
+
* This function profiles scanTimes for the V2 metric server:
|
|
62
|
+
* https://aat.w3ibm.mybluemix.net
|
|
63
|
+
*
|
|
64
|
+
* In the case that user provides any url that is https://aat* it will upload based on accountId
|
|
65
|
+
*
|
|
66
|
+
* @param {String} scanTime - Provide the time it took for the testcase to run
|
|
67
|
+
* @param {String} profile - The type of profile the scan time is for:
|
|
68
|
+
* i.e. browser information, features, etc...
|
|
69
|
+
*
|
|
70
|
+
* @return N/A - Global scanTimesV2 object is updated with the time
|
|
71
|
+
*
|
|
72
|
+
* @memberOf this
|
|
73
|
+
*/
|
|
74
|
+
generateReport(config, rulesets, storedReport) {
|
|
75
|
+
if (!config.label || !config.label.includes("IBMa-Node-TeSt")) {
|
|
76
|
+
// URI encode the profile text provided
|
|
77
|
+
let profile = encodeURIComponent(storedReport.scanProfile);
|
|
78
|
+
// Add the time it took for the testcase to run to the global array, indexed by the profile
|
|
79
|
+
this.scanTimesV2[profile] = this.scanTimesV2[profile] || [];
|
|
80
|
+
this.scanTimesV2[profile].push(storedReport.engineReport.summary.scanTime);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
;
|
|
84
|
+
/**
|
|
85
|
+
* This function is responsible for uploading scan results to the metrics server:
|
|
86
|
+
* https://aat.w3ibm.mybluemix.net
|
|
87
|
+
*
|
|
88
|
+
* @param {Function} done - The browser on which the testcases were run on
|
|
89
|
+
*
|
|
90
|
+
* @return N/A - performs the upload of the metrics to the server
|
|
91
|
+
*
|
|
92
|
+
* @memberOf this
|
|
93
|
+
*/
|
|
94
|
+
generateSummary(config, rulesets, endReport, summaryData) {
|
|
95
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
96
|
+
try {
|
|
97
|
+
// Variable Decleration
|
|
98
|
+
let numProfiles = 0;
|
|
99
|
+
let accountId = "";
|
|
100
|
+
// Loop over all the profiles with in the scanTime Object
|
|
101
|
+
for (let profile in this.scanTimesV2) {
|
|
102
|
+
// Loop over all the V2 Scan Times until it reaches 0
|
|
103
|
+
while (this.scanTimesV2[profile].length > 0) {
|
|
104
|
+
// Build a truncatedScanTime Array to upload to the metrics server chunck by chunck
|
|
105
|
+
let subScanTimes = this.scanTimesV2[profile].splice(0, 150);
|
|
106
|
+
// Increment the num Profile
|
|
107
|
+
++numProfiles;
|
|
108
|
+
// Start building the Query string to be sent to the metrics server
|
|
109
|
+
let qs = "?t=" + this.toolName + "&tag=" + profile + "&a=" + accountId + "&pol=" + this.policies + "&st=";
|
|
110
|
+
subScanTimes.forEach(function (t) {
|
|
111
|
+
qs += t;
|
|
112
|
+
qs += ",";
|
|
113
|
+
});
|
|
114
|
+
qs = qs.substr(0, qs.length - 1);
|
|
115
|
+
// Dispatch the call to the metrics server
|
|
116
|
+
// Istanbul is not able to capture the coverate of functions call in a callback therefore we need to skip
|
|
117
|
+
/* istanbul ignore next */
|
|
118
|
+
yield (0, Fetch_js_1.fetch_get)(this.metricsURLV2 + "/api/pub/meter/v2" + qs).then(() => {
|
|
119
|
+
}).catch((_err) => {
|
|
120
|
+
}).finally(() => {
|
|
121
|
+
// Decrement the numProfiles to identify that scan has finished
|
|
122
|
+
--numProfiles;
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
catch (e) {
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
;
|
|
132
|
+
}
|
|
133
|
+
exports.ACReporterMetrics = ACReporterMetrics;
|
|
134
|
+
;
|
|
135
|
+
//# sourceMappingURL=ACReporterMetrics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ACReporterMetrics.js","sourceRoot":"","sources":["../../../../../src-ts/lib/common/report/ACReporterMetrics.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;+EAc+E;;;;;;;;;;;;AAE/E,kDAAgD;AAMhD;;;;iFAIiF;AAEjF;;;;;;;;;;;GAWG;AACH,MAAa,iBAAiB;IACnB,IAAI;QACP,OAAO,SAAS,CAAC;IACrB,CAAC;IASD,YAAY,QAAgB,EAAE,QAAkB;QAPhD,iBAAY,GAAW,4BAA4B,CAAC;QAEpD,gBAAW,GAAG,EAAE,CAAC;QACjB,gBAAW,GAEP,EAAE,CAAC;QAGH,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAEnC,sCAAsC;QACtC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACI,cAAc,CAAC,MAAuB,EAAE,QAAqB,EAAE,YAA6B;QAC/F,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;YAC5D,uCAAuC;YACvC,IAAI,OAAO,GAAG,kBAAkB,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;YAE3D,2FAA2F;YAC3F,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAC5D,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;Q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OAAO,CAAC,GAAG,EAAE;4BACZ,+DAA+D;4BAC/D,EAAE,WAAW,CAAC;wBAClB,CAAC,CAAC,CAAA;oBACN,CAAC;gBACL,CAAC;YACL,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;YACb,CAAC;QACL,CAAC;KAAA;IAAA,CAAC;CACL;AAhGD,8CAgGC;AAAA,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/******************************************************************************
|
|
2
|
+
Copyright:: 2020- IBM, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*****************************************************************************/
|
|
16
|
+
import { IConfigInternal } from "../config/IConfig.js";
|
|
17
|
+
import { Guideline } from "../engine/IGuideline.js";
|
|
18
|
+
import { CompressedReport } from "../engine/IReport.js";
|
|
19
|
+
import { GenSummReturn, IReporter } from "./ReporterManager.js";
|
|
20
|
+
export declare class ACReporterXLSX implements IReporter {
|
|
21
|
+
name(): string;
|
|
22
|
+
generateReport(_reportData: any): {
|
|
23
|
+
reportPath: string;
|
|
24
|
+
report: string;
|
|
25
|
+
} | void;
|
|
26
|
+
generateSummary(config: IConfigInternal, rulesets: Guideline[], endReport: number, summaryData: CompressedReport[]): Promise<GenSummReturn>;
|
|
27
|
+
private static createOverviewSheet;
|
|
28
|
+
private static createScanSummarySheet;
|
|
29
|
+
private static buildIssueSummaryLevel;
|
|
30
|
+
private static buildIssueSummaryTKLevel;
|
|
31
|
+
private static createIssueSummarySheet;
|
|
32
|
+
private static createIssuesSheet;
|
|
33
|
+
private static createDefinitionsSheet;
|
|
34
|
+
private static countDuplicatesInArray;
|
|
35
|
+
private static get_element;
|
|
36
|
+
private static format_date;
|
|
37
|
+
private static stringHash;
|
|
38
|
+
}
|