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,143 @@
|
|
|
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 { eRuleLevel } from "../config/IConfig.js";
|
|
17
|
+
import { Guideline, eGuidelineCategory } from "./IGuideline.js";
|
|
18
|
+
import { Issue, eRulePolicy as eRulePolicyNew, eRuleConfidence as eRuleConfidenceNew } from "./IRule.js";
|
|
19
|
+
import { Bounds as BoundsNew } from "./IBounds.js";
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated See ./IRule
|
|
22
|
+
*/
|
|
23
|
+
export { eRuleConfidence } from "./IRule";
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated See ./IRule
|
|
26
|
+
*/
|
|
27
|
+
export { eRulePolicy } from "./IRule";
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated See ./IGuideline
|
|
30
|
+
*/
|
|
31
|
+
export { eToolkitLevel } from "./IGuideline";
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated See ./IGuideline::eGuidelineCategory
|
|
34
|
+
*/
|
|
35
|
+
export { eGuidelineCategory as eRuleCategory } from "./IGuideline";
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated See ./IGuideline::eGuidelineType
|
|
38
|
+
*/
|
|
39
|
+
export { eGuidelineType as eRuleType } from "./IGuideline";
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated See ./IBounds
|
|
42
|
+
*/
|
|
43
|
+
export type Bounds = BoundsNew;
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated See ./IGuidline
|
|
46
|
+
*/
|
|
47
|
+
export type IRuleset = Guideline;
|
|
48
|
+
export type IEngineReport = {
|
|
49
|
+
results: Issue[];
|
|
50
|
+
numExecuted: number;
|
|
51
|
+
ruleTime: number;
|
|
52
|
+
totalTime?: number;
|
|
53
|
+
screenshot?: string;
|
|
54
|
+
nls?: {
|
|
55
|
+
[ruleId: string]: {
|
|
56
|
+
[reasonId: string]: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
summary?: {
|
|
60
|
+
counts?: EngineSummaryCounts;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export type IEngineResult = Issue;
|
|
64
|
+
export type IBaselineResult = IEngineResult & {
|
|
65
|
+
ignored: boolean;
|
|
66
|
+
help: string;
|
|
67
|
+
level: eRuleLevel;
|
|
68
|
+
};
|
|
69
|
+
export type EngineSummaryCounts = {
|
|
70
|
+
violation: number;
|
|
71
|
+
potentialviolation: number;
|
|
72
|
+
recommendation: number;
|
|
73
|
+
potentialrecommendation: number;
|
|
74
|
+
manual: number;
|
|
75
|
+
pass: number;
|
|
76
|
+
};
|
|
77
|
+
export type SummaryCounts = {
|
|
78
|
+
violation: number;
|
|
79
|
+
potentialviolation: number;
|
|
80
|
+
recommendation: number;
|
|
81
|
+
potentialrecommendation: number;
|
|
82
|
+
manual: number;
|
|
83
|
+
pass: number;
|
|
84
|
+
ignored: number;
|
|
85
|
+
elements: number;
|
|
86
|
+
elementsViolation: number;
|
|
87
|
+
elementsViolationReview: number;
|
|
88
|
+
};
|
|
89
|
+
export type IBaselineReport = {
|
|
90
|
+
results: IBaselineResult[];
|
|
91
|
+
numExecuted: number;
|
|
92
|
+
nls: {
|
|
93
|
+
[ruleId: string]: {
|
|
94
|
+
[reasonId: string]: string;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
summary: {
|
|
98
|
+
counts: SummaryCounts;
|
|
99
|
+
scanTime: number;
|
|
100
|
+
ruleArchive: string;
|
|
101
|
+
policies: string[];
|
|
102
|
+
reportLevels: string[];
|
|
103
|
+
startScan: number;
|
|
104
|
+
URL: string;
|
|
105
|
+
};
|
|
106
|
+
scanID: string;
|
|
107
|
+
toolID: string;
|
|
108
|
+
label: string;
|
|
109
|
+
};
|
|
110
|
+
export type CompressedReport = [
|
|
111
|
+
number,
|
|
112
|
+
string,
|
|
113
|
+
string,
|
|
114
|
+
string,
|
|
115
|
+
string,
|
|
116
|
+
number,
|
|
117
|
+
number,
|
|
118
|
+
string,
|
|
119
|
+
string[],
|
|
120
|
+
string[],
|
|
121
|
+
CompressedIssue[],
|
|
122
|
+
SummaryCounts
|
|
123
|
+
];
|
|
124
|
+
export type CompressedIssue = [
|
|
125
|
+
// results
|
|
126
|
+
eGuidelineCategory | undefined,
|
|
127
|
+
string,
|
|
128
|
+
[
|
|
129
|
+
eRulePolicyNew,
|
|
130
|
+
eRuleConfidenceNew
|
|
131
|
+
],
|
|
132
|
+
// value
|
|
133
|
+
number | string | undefined,
|
|
134
|
+
string[],
|
|
135
|
+
{
|
|
136
|
+
[ns: string]: string;
|
|
137
|
+
},
|
|
138
|
+
number,
|
|
139
|
+
string,
|
|
140
|
+
string,
|
|
141
|
+
boolean,
|
|
142
|
+
string
|
|
143
|
+
];
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
/**
|
|
17
|
+
* @deprecated See ./IRule
|
|
18
|
+
*/
|
|
19
|
+
export { eRuleConfidence } from "./IRule";
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated See ./IRule
|
|
22
|
+
*/
|
|
23
|
+
export { eRulePolicy } from "./IRule";
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated See ./IGuideline
|
|
26
|
+
*/
|
|
27
|
+
export { eToolkitLevel } from "./IGuideline";
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated See ./IGuideline::eGuidelineCategory
|
|
30
|
+
*/
|
|
31
|
+
export { eGuidelineCategory as eRuleCategory } from "./IGuideline";
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated See ./IGuideline::eGuidelineType
|
|
34
|
+
*/
|
|
35
|
+
export { eGuidelineType as eRuleType } from "./IGuideline";
|
|
36
|
+
//# sourceMappingURL=IReport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IReport.js","sourceRoot":"","sources":["../../../../../src-ts/lib/common/engine/IReport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;+EAc+E;AAO/E;;GAEG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C;;GAEG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C;;GAEG;AACH,OAAO,EAAE,kBAAkB,IAAI,aAAa,EAAE,MAAM,cAAc,CAAC;AAEnE;;GAEG;AACH,OAAO,EAAE,cAAc,IAAI,SAAS,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
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 { eGuidelineCategory } from "./IGuideline.js";
|
|
17
|
+
import { IMapResult } from "./IMapper.js";
|
|
18
|
+
import { eToolkitLevel as eToolkitLevelNew } from "./IGuideline.js";
|
|
19
|
+
import { Bounds } from "./IBounds.js";
|
|
20
|
+
export declare enum eRuleConfidence {
|
|
21
|
+
PASS = "PASS",
|
|
22
|
+
FAIL = "FAIL",
|
|
23
|
+
POTENTIAL = "POTENTIAL",
|
|
24
|
+
MANUAL = "MANUAL"
|
|
25
|
+
}
|
|
26
|
+
export declare enum eRulePolicy {
|
|
27
|
+
VIOLATION = "VIOLATION",
|
|
28
|
+
RECOMMENDATION = "RECOMMENDATION",
|
|
29
|
+
INFORMATION = "INFORMATION"
|
|
30
|
+
}
|
|
31
|
+
export declare function RulePass(reasonId: number | string, messageArgs?: string[], apiArgs?: any[]): RuleResult;
|
|
32
|
+
export declare function RuleRender(reasonId: number | string, messageArgs?: string[], apiArgs?: any[]): RuleResult;
|
|
33
|
+
export declare function RuleFail(reasonId: number | string, messageArgs?: string[], apiArgs?: any[]): RuleResult;
|
|
34
|
+
export declare function RulePotential(reasonId: number | string, messageArgs?: string[], apiArgs?: any[]): RuleResult;
|
|
35
|
+
export declare function RuleManual(reasonId: number | string, messageArgs?: string[], apiArgs?: any[]): RuleResult;
|
|
36
|
+
export type RuleResult = {
|
|
37
|
+
value: [eRulePolicy, eRuleConfidence];
|
|
38
|
+
reasonId?: number | string;
|
|
39
|
+
messageArgs?: string[];
|
|
40
|
+
apiArgs?: any[];
|
|
41
|
+
};
|
|
42
|
+
export type Issue = RuleResult & {
|
|
43
|
+
ruleId: string;
|
|
44
|
+
node: Node;
|
|
45
|
+
category?: eGuidelineCategory;
|
|
46
|
+
path: {
|
|
47
|
+
[ns: string]: string;
|
|
48
|
+
};
|
|
49
|
+
ruleTime: number;
|
|
50
|
+
message: string;
|
|
51
|
+
bounds?: Bounds;
|
|
52
|
+
snippet: string;
|
|
53
|
+
level?: string;
|
|
54
|
+
};
|
|
55
|
+
export type RuleContextHierarchy = {
|
|
56
|
+
[namespace: string]: IMapResult[];
|
|
57
|
+
};
|
|
58
|
+
export type RuleContext = {
|
|
59
|
+
[namespace: string]: IMapResult;
|
|
60
|
+
};
|
|
61
|
+
export type Rule = {
|
|
62
|
+
id: string;
|
|
63
|
+
rulesets: Array<{
|
|
64
|
+
id: string | string[];
|
|
65
|
+
num: string | string[];
|
|
66
|
+
level: eRulePolicy;
|
|
67
|
+
toolkitLevel: eToolkitLevelNew;
|
|
68
|
+
reasonCodes?: string[];
|
|
69
|
+
}>;
|
|
70
|
+
refactor?: {
|
|
71
|
+
[oldRuleId: string]: {
|
|
72
|
+
[oldReasonCode: string]: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
messages: {
|
|
76
|
+
[locale: string]: {
|
|
77
|
+
[reasonId: string]: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
help: {
|
|
81
|
+
[locale: string]: {
|
|
82
|
+
[reasonId: string]: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* How this rule maps to ACT rules, if any (https://act-rules.github.io/rules/)
|
|
87
|
+
*
|
|
88
|
+
* string: For a single rule mapping that matches exactly to the rule (Pass -> pass, Potential -> cantTell, Fail -> fail, unlisted => inapplicable)
|
|
89
|
+
* Array<>: Custom mapping of rule to ACT results
|
|
90
|
+
*/
|
|
91
|
+
act?: string | string[] | Array<string | {
|
|
92
|
+
[actRuleId: string]: {
|
|
93
|
+
[reasonId: string]: "pass" | "fail" | "cantTell" | "inapplicable";
|
|
94
|
+
};
|
|
95
|
+
}>;
|
|
96
|
+
context: string;
|
|
97
|
+
dependencies?: string[];
|
|
98
|
+
run: (context: RuleContext, options?: {}, contextHierarchies?: RuleContextHierarchy) => RuleResult | RuleResult[] | null;
|
|
99
|
+
enabled?: boolean;
|
|
100
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
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
|
+
export var eRuleConfidence;
|
|
17
|
+
(function (eRuleConfidence) {
|
|
18
|
+
eRuleConfidence["PASS"] = "PASS";
|
|
19
|
+
eRuleConfidence["FAIL"] = "FAIL";
|
|
20
|
+
eRuleConfidence["POTENTIAL"] = "POTENTIAL";
|
|
21
|
+
eRuleConfidence["MANUAL"] = "MANUAL";
|
|
22
|
+
})(eRuleConfidence || (eRuleConfidence = {}));
|
|
23
|
+
export var eRulePolicy;
|
|
24
|
+
(function (eRulePolicy) {
|
|
25
|
+
eRulePolicy["VIOLATION"] = "VIOLATION";
|
|
26
|
+
eRulePolicy["RECOMMENDATION"] = "RECOMMENDATION";
|
|
27
|
+
eRulePolicy["INFORMATION"] = "INFORMATION";
|
|
28
|
+
})(eRulePolicy || (eRulePolicy = {}));
|
|
29
|
+
export function RulePass(reasonId, messageArgs, apiArgs) {
|
|
30
|
+
if (typeof reasonId === "undefined" || reasonId === null)
|
|
31
|
+
throw new Error("Reason ID must be defined");
|
|
32
|
+
return {
|
|
33
|
+
value: [eRulePolicy.INFORMATION, eRuleConfidence.PASS],
|
|
34
|
+
reasonId: reasonId,
|
|
35
|
+
messageArgs: messageArgs || [],
|
|
36
|
+
apiArgs: apiArgs || []
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export function RuleRender(reasonId, messageArgs, apiArgs) {
|
|
40
|
+
if (typeof reasonId === "undefined" || reasonId === null)
|
|
41
|
+
throw new Error("Reason ID must be defined");
|
|
42
|
+
return {
|
|
43
|
+
value: [eRulePolicy.INFORMATION, eRuleConfidence.PASS],
|
|
44
|
+
reasonId: 0,
|
|
45
|
+
messageArgs: messageArgs || [],
|
|
46
|
+
apiArgs: apiArgs || []
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export function RuleFail(reasonId, messageArgs, apiArgs) {
|
|
50
|
+
if (typeof reasonId === "undefined" || reasonId === null)
|
|
51
|
+
throw new Error("Reason ID must be defined");
|
|
52
|
+
return {
|
|
53
|
+
value: [eRulePolicy.INFORMATION, eRuleConfidence.FAIL],
|
|
54
|
+
reasonId: reasonId,
|
|
55
|
+
messageArgs: messageArgs || [],
|
|
56
|
+
apiArgs: apiArgs || []
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export function RulePotential(reasonId, messageArgs, apiArgs) {
|
|
60
|
+
if (typeof reasonId === "undefined" || reasonId === null)
|
|
61
|
+
throw new Error("Reason ID must be defined");
|
|
62
|
+
return {
|
|
63
|
+
value: [eRulePolicy.INFORMATION, eRuleConfidence.POTENTIAL],
|
|
64
|
+
reasonId: reasonId,
|
|
65
|
+
messageArgs: messageArgs || [],
|
|
66
|
+
apiArgs: apiArgs || []
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export function RuleManual(reasonId, messageArgs, apiArgs) {
|
|
70
|
+
if (typeof reasonId === "undefined" || reasonId === null)
|
|
71
|
+
throw new Error("Reason ID must be defined");
|
|
72
|
+
return {
|
|
73
|
+
value: [eRulePolicy.INFORMATION, eRuleConfidence.MANUAL],
|
|
74
|
+
reasonId: reasonId,
|
|
75
|
+
messageArgs: messageArgs || [],
|
|
76
|
+
apiArgs: apiArgs || []
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=IRule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IRule.js","sourceRoot":"","sources":["../../../../../src-ts/lib/common/engine/IRule.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;+EAc+E;AAO/E,MAAM,CAAN,IAAY,eAKX;AALD,WAAY,eAAe;IACvB,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,0CAAuB,CAAA;IACvB,oCAAiB,CAAA;AACrB,CAAC,EALW,eAAe,KAAf,eAAe,QAK1B;AAED,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACnB,sCAAuB,CAAA;IACvB,gDAAiC,CAAA;IACjC,0CAA2B,CAAA;AAC/B,CAAC,EAJW,WAAW,KAAX,WAAW,QAItB;AAED,MAAM,UAAU,QAAQ,CAAC,QAAyB,EAAE,WAAuB,EAAE,OAAgB;IACzF,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IACvG,OAAO;QACH,KAAK,EAAE,CAAC,WAAW,CAAC,WAAW,EAAE,eAAe,CAAC,IAAI,CAAC;QACtD,QAAQ,EAAE,QAAQ;QAClB,WAAW,EAAE,WAAW,IAAI,EAAE;QAC9B,OAAO,EAAE,OAAO,IAAI,EAAE;KACzB,CAAA;AACL,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,QAAyB,EAAE,WAAuB,EAAE,OAAgB;IAC3F,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IACvG,OAAO;QACH,KAAK,EAAE,CAAC,WAAW,CAAC,WAAW,EAAE,eAAe,CAAC,IAAI,CAAC;QACtD,QAAQ,EAAE,CAAC;QACX,WAAW,EAAE,WAAW,IAAI,EAAE;QAC9B,OAAO,EAAE,OAAO,IAAI,EAAE;KACzB,CAAA;AACL,CAAC;AACD,MAAM,UAAU,QAAQ,CAAC,QAAyB,EAAE,WAAuB,EAAE,OAAgB;IACzF,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IACvG,OAAO;QACH,KAAK,EAAE,CAAC,WAAW,CAAC,WAAW,EAAE,eAAe,CAAC,IAAI,CAAC;QACtD,QAAQ,EAAE,QAAQ;QAClB,WAAW,EAAE,WAAW,IAAI,EAAE;QAC9B,OAAO,EAAE,OAAO,IAAI,EAAE;KACzB,CAAA;AACL,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,QAAyB,EAAE,WAAuB,EAAE,OAAgB;IAC9F,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IACvG,OAAO;QACH,KAAK,EAAE,CAAC,WAAW,CAAC,WAAW,EAAE,eAAe,CAAC,SAAS,CAAC;QAC3D,QAAQ,EAAE,QAAQ;QAClB,WAAW,EAAE,WAAW,IAAI,EAAE;QAC9B,OAAO,EAAE,OAAO,IAAI,EAAE;KACzB,CAAA;AACL,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,QAAyB,EAAE,WAAuB,EAAE,OAAgB;IAC3F,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IACvG,OAAO;QACH,KAAK,EAAE,CAAC,WAAW,CAAC,WAAW,EAAE,eAAe,CAAC,MAAM,CAAC;QACxD,QAAQ,EAAE,QAAQ;QAClB,WAAW,EAAE,WAAW,IAAI,EAAE;QAC9B,OAAO,EAAE,OAAO,IAAI,EAAE;KACzB,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/******************************************************************************
|
|
2
|
+
Copyright:: 2023- 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 { Guideline } from "./IGuideline.js";
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated
|
|
19
|
+
*/
|
|
20
|
+
export type IRuleset = Guideline;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/******************************************************************************
|
|
2
|
+
Copyright:: 2023- 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
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=IRuleset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IRuleset.js","sourceRoot":"","sources":["../../../../../src-ts/lib/common/engine/IRuleset.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;8EAc8E"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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 ACReporterCSV implements IReporter {
|
|
21
|
+
name(): string;
|
|
22
|
+
private static toCSV;
|
|
23
|
+
generateReport(_reportData: any): {
|
|
24
|
+
reportPath: string;
|
|
25
|
+
report: string;
|
|
26
|
+
} | void;
|
|
27
|
+
generateSummary(config: IConfigInternal, _rulesets: Guideline[], endReport: number, compressedReports: CompressedReport[]): Promise<GenSummReturn>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
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 { ReporterManager } from "./ReporterManager.js";
|
|
17
|
+
export class ACReporterCSV {
|
|
18
|
+
name() {
|
|
19
|
+
return "csv";
|
|
20
|
+
}
|
|
21
|
+
static toCSV = function (str) {
|
|
22
|
+
if (str === null) {
|
|
23
|
+
return '"null"';
|
|
24
|
+
}
|
|
25
|
+
else if (!str || str.length == 0) {
|
|
26
|
+
return '""';
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
str = str.replace(/"/g, '""');
|
|
30
|
+
return `"${str}"`;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
generateReport(_reportData) {
|
|
34
|
+
}
|
|
35
|
+
async generateSummary(config, _rulesets, endReport, compressedReports) {
|
|
36
|
+
let toCSV = ACReporterCSV.toCSV;
|
|
37
|
+
let resultStr = `Label,Level,RuleId,Message,Xpath,Help\n`;
|
|
38
|
+
let startScan = 0;
|
|
39
|
+
for (const compressedReport of compressedReports) {
|
|
40
|
+
let reportStored = ReporterManager.uncompressReport(compressedReport);
|
|
41
|
+
if (startScan === 0) {
|
|
42
|
+
startScan = reportStored.engineReport.summary.startScan;
|
|
43
|
+
}
|
|
44
|
+
let report = reportStored.engineReport;
|
|
45
|
+
for (const result of report.results) {
|
|
46
|
+
resultStr += `${toCSV(reportStored.label)},${toCSV(result.level)},${toCSV(result.ruleId)},${toCSV(result.message)},${toCSV(result.path.dom)},${toCSV(result.help)}\n`;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
let startScanD = new Date(startScan);
|
|
50
|
+
let reportFilename = `results_${startScanD.toISOString().replace(/:/g, "-")}.csv`;
|
|
51
|
+
if (config.outputFilenameTimestamp === false) {
|
|
52
|
+
reportFilename = `results.csv`;
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
summaryPath: reportFilename,
|
|
56
|
+
summary: resultStr
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=ACReporterCSV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ACReporterCSV.js","sourceRoot":"","sources":["../../../../../src-ts/lib/common/report/ACReporterCSV.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;gFAcgF;AAKhF,OAAO,EAA4B,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEjF,MAAM,OAAO,aAAa;IACf,IAAI;QACP,OAAO,KAAK,CAAC;IACjB,CAAC;IACO,MAAM,CAAC,KAAK,GAAG,UAAS,GAAG;QAC/B,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;YACf,OAAO,QAAQ,CAAC;QACpB,CAAC;aAAM,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;YACjC,OAAO,IAAI,CAAC;QAChB,CAAC;aAAM,CAAC;YACJ,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAC9B,OAAO,IAAI,GAAG,GAAG,CAAC;QACtB,CAAC;IACL,CAAC,CAAA;IAEM,cAAc,CAAC,WAAW;IACjC,CAAC;IACM,KAAK,CAAC,eAAe,CAAC,MAAuB,EAAE,SAAsB,EAAE,SAAiB,EAAE,iBAAqC;QAClI,IAAI,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC;QAChC,IAAI,SAAS,GAAG,yCAAyC,CAAC;QAC1D,IAAI,SAAS,GAAG,CAAC,CAAC;QAClB,KAAK,MAAM,gBAAgB,IAAI,iBAAiB,EAAE,CAAC;YAC/C,IAAI,YAAY,GAAG,eAAe,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;YACtE,IAAI,SAAS,KAAK,CAAC,EAAE,CAAC;gBAClB,SAAS,GAAG,YAAY,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC;YAC5D,CAAC;YACD,IAAI,MAAM,GAAG,YAAY,CAAC,YAAY,CAAC;YACvC,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBAClC,SAAS,IAAI,GAAG,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAA;YACzK,CAAC;QACL,CAAC;QACD,IAAI,UAAU,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC;QACrC,IAAI,cAAc,GAAG,WAAW,UAAU,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,IAAI,EAAC,GAAG,CAAC,MAAM,CAAC;QACjF,IAAI,MAAM,CAAC,uBAAuB,KAAK,KAAK,EAAE,CAAC;YAC3C,cAAc,GAAG,aAAa,CAAC;QACnC,CAAC;QACD,OAAO;YACH,WAAW,EAAE,cAAc;YAC3B,OAAO,EAAE,SAAS;SACrB,CAAA;IACL,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
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, IReporterStored } from "./ReporterManager.js";
|
|
20
|
+
export declare class ACReporterHTML implements IReporter {
|
|
21
|
+
name(): string;
|
|
22
|
+
generateReport(config: IConfigInternal, rulesets: Guideline[], storedReport: IReporterStored): {
|
|
23
|
+
reportPath: string;
|
|
24
|
+
report: string;
|
|
25
|
+
} | void;
|
|
26
|
+
generateSummary(_config: IConfigInternal, rulesets: Guideline[], _endReport: number, _summaryData: CompressedReport[]): Promise<GenSummReturn>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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 { genReport } from "./genReport.js";
|
|
17
|
+
export class ACReporterHTML {
|
|
18
|
+
name() {
|
|
19
|
+
return "html";
|
|
20
|
+
}
|
|
21
|
+
generateReport(config, rulesets, storedReport) {
|
|
22
|
+
let cloneReport = JSON.parse(JSON.stringify(storedReport.engineReport));
|
|
23
|
+
let outReport = {
|
|
24
|
+
report: {
|
|
25
|
+
timestamp: storedReport.startScan,
|
|
26
|
+
nls: cloneReport.nls,
|
|
27
|
+
results: cloneReport.results.filter((issue) => issue.value[1] !== "PASS"),
|
|
28
|
+
passUniqueElements: Array.from(new Set(cloneReport.results.map(result => result.path.dom))),
|
|
29
|
+
counts: {
|
|
30
|
+
total: {
|
|
31
|
+
All: 0
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
rulesets: rulesets,
|
|
36
|
+
tabURL: storedReport.url
|
|
37
|
+
};
|
|
38
|
+
return {
|
|
39
|
+
reportPath: `${storedReport.label.replace(/[:?&=]/g, "_")}.html`,
|
|
40
|
+
report: genReport(outReport)
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
async generateSummary(_config, rulesets, _endReport, _summaryData) {
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=ACReporterHTML.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ACReporterHTML.js","sourceRoot":"","sources":["../../../../../src-ts/lib/common/report/ACReporterHTML.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;gFAcgF;AAMhF,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,OAAO,cAAc;IAChB,IAAI;QACP,OAAO,MAAM,CAAC;IAClB,CAAC;IAEM,cAAc,CAAC,MAAuB,EAAE,QAAqB,EAAE,YAA6B;QAC/F,IAAI,WAAW,GAAoB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC;QAEzF,IAAI,SAAS,GAAG;YACZ,MAAM,EAAE;gBACJ,SAAS,EAAE,YAAY,CAAC,SAAS;gBACjC,GAAG,EAAE,WAAW,CAAC,GAAG;gBACpB,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC;gBAC9E,kBAAkB,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;gBAC3F,MAAM,EAAE;oBACJ,KAAK,EAAE;wBACH,GAAG,EAAE,CAAC;qBACT;iBACJ;aACJ;YACD,QAAQ,EAAE,QAAQ;YAClB,MAAM,EAAE,YAAY,CAAC,GAAG;SAC3B,CAAA;QAED,OAAO;YACH,UAAU,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,EAAC,GAAG,CAAC,OAAO;YAC/D,MAAM,EAAE,SAAS,CAAC,SAAS,CAAC;SAC/B,CAAC;IACN,CAAC;IACM,KAAK,CAAC,eAAe,CAAC,OAAwB,EAAE,QAAqB,EAAE,UAAkB,EAAE,YAAgC;IAClI,CAAC;CACJ"}
|
|
@@ -0,0 +1,36 @@
|
|
|
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, IReporterStored } from "./ReporterManager.js";
|
|
20
|
+
export declare class ACReporterJSON implements IReporter {
|
|
21
|
+
name(): string;
|
|
22
|
+
generateReport(config: IConfigInternal, rulesets: Guideline[], storedReport: IReporterStored): {
|
|
23
|
+
reportPath: string;
|
|
24
|
+
report: string;
|
|
25
|
+
} | void;
|
|
26
|
+
generateSummary(config: IConfigInternal, _rulesets: Guideline[], endReport: number, compressedReports: CompressedReport[]): Promise<GenSummReturn>;
|
|
27
|
+
static generateReportSummary(config: IConfigInternal, rulesets: Guideline[], storedReport: IReporterStored): {
|
|
28
|
+
counts: import("../engine/IReport.js").SummaryCounts;
|
|
29
|
+
scanTime: any;
|
|
30
|
+
ruleArchive: string;
|
|
31
|
+
policies: string[];
|
|
32
|
+
reportLevels: import("../config/IConfig.js").eRuleLevel[];
|
|
33
|
+
startScan: number;
|
|
34
|
+
URL: string;
|
|
35
|
+
};
|
|
36
|
+
}
|