testaro-issues 0.2.1 → 0.3.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # testaro-issues
2
2
 
3
- A classification of about 1300 rules of 10 rule engines into about 350 issues. The rule engines are those in the ensemble of [Testaro](https://github.com/YRA-tech/testaro), which tests web pages for front-end quality (accessibility, usability, and standards conformance).
3
+ A classification of about 1200 rules of 10 rule engines into about 400 issues. The rule engines are those in the ensemble of [Testaro](https://github.com/YRA-tech/testaro), which tests web pages for front-end quality (accessibility, usability, and standards conformance).
4
4
 
5
5
  A _rule engine_ is an application, such as HTML CodeSniffer, that tests software.
6
6
 
package/dist/index.cjs CHANGED
@@ -702,16 +702,40 @@ const issuesData = {
702
702
  "wcag": "1.3.1",
703
703
  "weight": 4
704
704
  },
705
- "metaBad": {
706
- "summary": "meta invalid",
707
- "why": "Document fails to include needed data",
708
- "wcag": "1.3.1",
705
+ "metaAttributesWrong": {
706
+ "summary": "prohibited or missing meta attributes",
707
+ "why": "Browser processes the page incorrectly",
708
+ "wcag": "4.1",
709
+ "weight": 3
710
+ },
711
+ "metaAttributeBad": {
712
+ "summary": "meta attribute value invalid",
713
+ "why": "Browser processes the page incorrectly",
714
+ "wcag": "4.1",
715
+ "weight": 3
716
+ },
717
+ "metaDuplicated": {
718
+ "summary": "meta element duplicated",
719
+ "why": "Browser may process the page incorrectly",
720
+ "wcag": "4.1",
721
+ "weight": 3
722
+ },
723
+ "metaCharsetLate": {
724
+ "summary": "meta charset declared too late",
725
+ "why": "Browser may display incorrect text",
726
+ "wcag": "4.1",
727
+ "weight": 4
728
+ },
729
+ "metaXUACompatible": {
730
+ "summary": "meta X-UA-Compatible incomplete",
731
+ "why": "Internet Explorer may display the page incorrectly",
732
+ "wcag": "4.1",
709
733
  "weight": 3
710
734
  },
711
735
  "metaMisplaced": {
712
736
  "summary": "meta element in invalid location",
713
- "why": "Document fails to provide needed data",
714
- "wcag": "1.3.1",
737
+ "why": "Browser may process the page incorrectly",
738
+ "wcag": "4.1",
715
739
  "weight": 4
716
740
  },
717
741
  "stylesheetBanned": {
@@ -5508,32 +5532,32 @@ const rulesData = {
5508
5532
  "what": "Element has a color attribute but no rel attribute with mask-icon as its value"
5509
5533
  },
5510
5534
  "A document must not include more than one meta element with its name attribute set to the value description.": {
5511
- "issueID": "metaBad",
5535
+ "issueID": "metaDuplicated",
5512
5536
  "quality": 1,
5513
5537
  "what": "Element with name=\"description\" is not the only meta element with that name"
5514
5538
  },
5515
5539
  "A document must not include both a meta element with an http-equiv attribute whose value is content-type, and a meta element with a charset attribute.": {
5516
- "issueID": "metaBad",
5540
+ "issueID": "metaDuplicated",
5517
5541
  "quality": 1,
5518
5542
  "what": "Element with http-equiv=\"content-type\" is incompatible with the meta element with a charset attribute"
5519
5543
  },
5520
5544
  "A document must not include more than one meta element with a http-equiv attribute whose value is content-type.": {
5521
- "issueID": "metaBad",
5545
+ "issueID": "metaDuplicated",
5522
5546
  "quality": 1,
5523
5547
  "what": "Page has more than 1 meta element with http-equiv=\"content-type\""
5524
5548
  },
5525
5549
  "A meta element with an http-equiv attribute whose value is X-UA-Compatible must have a content attribute with the value IE=edge.": {
5526
- "issueID": "metaBad",
5550
+ "issueID": "metaXUACompatible",
5527
5551
  "quality": 1,
5528
5552
  "what": "Element with http-equiv=\"X-UA-Compatible\" has no content=\"IE=edge\""
5529
5553
  },
5530
5554
  "A document must not include more than one meta element with a charset attribute.": {
5531
- "issueID": "metaBad",
5555
+ "issueID": "metaDuplicated",
5532
5556
  "quality": 1,
5533
5557
  "what": "More than 1 meta element has a charset attribute"
5534
5558
  },
5535
5559
  "A charset attribute on a meta element found after the first 1024 bytes.": {
5536
- "issueID": "metaBad",
5560
+ "issueID": "metaCharsetLate",
5537
5561
  "quality": 1,
5538
5562
  "what": "charset attribute on a meta element appears after 1024 bytes"
5539
5563
  },
@@ -6360,17 +6384,17 @@ const rulesData = {
6360
6384
  "what": "Element does not exist in HTML"
6361
6385
  },
6362
6386
  "Attribute .+ not allowed on element meta at this point.*": {
6363
- "issueID": "metaBad",
6387
+ "issueID": "metaAttributesWrong",
6364
6388
  "quality": 1,
6365
6389
  "what": "Attribute is not allowed on a meta element here"
6366
6390
  },
6367
6391
  "Element meta is missing one or more of the following attributes: .+": {
6368
- "issueID": "metaBad",
6392
+ "issueID": "metaAttributesWrong",
6369
6393
  "quality": 1,
6370
6394
  "what": "Element is missing a required attribute"
6371
6395
  },
6372
6396
  "Bad value .+ for attribute .+ on element meta.*": {
6373
- "issueID": "metaBad",
6397
+ "issueID": "metaAttributeBad",
6374
6398
  "quality": 1,
6375
6399
  "what": "Attribute of a meta element has an invalid value"
6376
6400
  },
@@ -7054,32 +7078,32 @@ const rulesData = {
7054
7078
  "what": "Element has a color attribute but no rel attribute with mask-icon as its value"
7055
7079
  },
7056
7080
  "A document must not include more than one meta element with its name attribute set to the value description.": {
7057
- "issueID": "metaBad",
7081
+ "issueID": "metaDuplicated",
7058
7082
  "quality": 1,
7059
7083
  "what": "Element with name=\"description\" is not the only meta element with that name"
7060
7084
  },
7061
7085
  "A document must not include both a meta element with an http-equiv attribute whose value is content-type, and a meta element with a charset attribute.": {
7062
- "issueID": "metaBad",
7086
+ "issueID": "metaDuplicated",
7063
7087
  "quality": 1,
7064
7088
  "what": "Element with http-equiv=\"content-type\" is incompatible with the meta element with a charset attribute"
7065
7089
  },
7066
7090
  "A document must not include more than one meta element with a http-equiv attribute whose value is content-type.": {
7067
- "issueID": "metaBad",
7091
+ "issueID": "metaDuplicated",
7068
7092
  "quality": 1,
7069
7093
  "what": "Page has more than 1 meta element with http-equiv=\"content-type\""
7070
7094
  },
7071
7095
  "A meta element with an http-equiv attribute whose value is X-UA-Compatible must have a content attribute with the value IE=edge.": {
7072
- "issueID": "metaBad",
7096
+ "issueID": "metaXUACompatible",
7073
7097
  "quality": 1,
7074
7098
  "what": "Element with http-equiv=\"X-UA-Compatible\" has no content=\"IE=edge\""
7075
7099
  },
7076
7100
  "A document must not include more than one meta element with a charset attribute.": {
7077
- "issueID": "metaBad",
7101
+ "issueID": "metaDuplicated",
7078
7102
  "quality": 1,
7079
7103
  "what": "More than 1 meta element has a charset attribute"
7080
7104
  },
7081
7105
  "A charset attribute on a meta element found after the first 1024 bytes.": {
7082
- "issueID": "metaBad",
7106
+ "issueID": "metaCharsetLate",
7083
7107
  "quality": 1,
7084
7108
  "what": "charset attribute on a meta element appears after 1024 bytes"
7085
7109
  },
@@ -7906,17 +7930,17 @@ const rulesData = {
7906
7930
  "what": "Element does not exist in HTML"
7907
7931
  },
7908
7932
  "Attribute .+ not allowed on element meta at this point.*": {
7909
- "issueID": "metaBad",
7933
+ "issueID": "metaAttributesWrong",
7910
7934
  "quality": 1,
7911
7935
  "what": "Attribute is not allowed on a meta element here"
7912
7936
  },
7913
7937
  "Element meta is missing one or more of the following attributes: .+": {
7914
- "issueID": "metaBad",
7938
+ "issueID": "metaAttributesWrong",
7915
7939
  "quality": 1,
7916
7940
  "what": "Element is missing a required attribute"
7917
7941
  },
7918
7942
  "Bad value .+ for attribute .+ on element meta.*": {
7919
- "issueID": "metaBad",
7943
+ "issueID": "metaAttributeBad",
7920
7944
  "quality": 1,
7921
7945
  "what": "Attribute of a meta element has an invalid value"
7922
7946
  },
@@ -9724,10 +9748,40 @@ const getEditableData = () => ({
9724
9748
  rules: structuredClone(rules),
9725
9749
  issueRules: structuredClone(issueRules)
9726
9750
  });
9751
+ const makeIssueStats = (issueRuleTable = issueRules) => {
9752
+ const stats = {};
9753
+ Object.entries(issueRuleTable).forEach(([issueID, engineData]) => {
9754
+ stats[issueID] = {};
9755
+ Object.entries(engineData).forEach(([engineID, { invariant, variable }]) => {
9756
+ stats[issueID][engineID] = invariant.length + variable.length;
9757
+ });
9758
+ });
9759
+ return stats;
9760
+ };
9761
+ const getSingleEngineIssues = (stats = issueStats) => Object.entries(stats).filter(([, engineCounts]) => Object.keys(engineCounts).filter((engineID) => engineID !== `nuVnu`).length === 1).map(([issueID, engineCounts]) => {
9762
+ const [engineID, ruleCount] = Object.entries(engineCounts)[0];
9763
+ return {
9764
+ issueID,
9765
+ engineID,
9766
+ ruleCount
9767
+ };
9768
+ }).sort((a, b) => b.ruleCount - a.ruleCount);
9769
+ const getEngineRuleCounts = (ruleTable = rules) => {
9770
+ const counts = {};
9771
+ Object.keys(ruleTable).forEach((engineID) => {
9772
+ counts[engineID] = Object.keys(ruleTable[engineID].invariant).length + Object.keys(ruleTable[engineID].variable).length;
9773
+ });
9774
+ return counts;
9775
+ };
9727
9776
  const issueRules = makeIssueRules(rules);
9777
+ const issueStats = makeIssueStats(issueRules);
9728
9778
  //#endregion
9729
9779
  exports.getEditableData = getEditableData;
9780
+ exports.getEngineRuleCounts = getEngineRuleCounts;
9781
+ exports.getSingleEngineIssues = getSingleEngineIssues;
9730
9782
  exports.issueRules = issueRules;
9783
+ exports.issueStats = issueStats;
9731
9784
  exports.issues = issues;
9732
9785
  exports.makeIssueRules = makeIssueRules;
9786
+ exports.makeIssueStats = makeIssueStats;
9733
9787
  exports.rules = rules;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,6 @@
1
1
  //#region src/index.d.ts
2
2
  type IssueID = keyof typeof issuesData;
3
+ type IssueEngineRuleCounts = Record<string, number>;
3
4
  interface Issue {
4
5
  summary: string;
5
6
  why: string;
@@ -7,7 +8,7 @@ interface Issue {
7
8
  weight: number;
8
9
  max?: number;
9
10
  }
10
- interface IssueRuleGroup {
11
+ interface ruleIDsByType {
11
12
  invariant: string[];
12
13
  variable: string[];
13
14
  }
@@ -722,16 +723,40 @@ declare const issuesData: {
722
723
  readonly wcag: '1.3.1';
723
724
  readonly weight: 4;
724
725
  };
725
- readonly metaBad: {
726
- readonly summary: 'meta invalid';
727
- readonly why: 'Document fails to include needed data';
728
- readonly wcag: '1.3.1';
726
+ readonly metaAttributesWrong: {
727
+ readonly summary: 'prohibited or missing meta attributes';
728
+ readonly why: 'Browser processes the page incorrectly';
729
+ readonly wcag: '4.1';
730
+ readonly weight: 3;
731
+ };
732
+ readonly metaAttributeBad: {
733
+ readonly summary: 'meta attribute value invalid';
734
+ readonly why: 'Browser processes the page incorrectly';
735
+ readonly wcag: '4.1';
736
+ readonly weight: 3;
737
+ };
738
+ readonly metaDuplicated: {
739
+ readonly summary: 'meta element duplicated';
740
+ readonly why: 'Browser may process the page incorrectly';
741
+ readonly wcag: '4.1';
742
+ readonly weight: 3;
743
+ };
744
+ readonly metaCharsetLate: {
745
+ readonly summary: 'meta charset declared too late';
746
+ readonly why: 'Browser may display incorrect text';
747
+ readonly wcag: '4.1';
748
+ readonly weight: 4;
749
+ };
750
+ readonly metaXUACompatible: {
751
+ readonly summary: 'meta X-UA-Compatible incomplete';
752
+ readonly why: 'Internet Explorer may display the page incorrectly';
753
+ readonly wcag: '4.1';
729
754
  readonly weight: 3;
730
755
  };
731
756
  readonly metaMisplaced: {
732
757
  readonly summary: 'meta element in invalid location';
733
- readonly why: 'Document fails to provide needed data';
734
- readonly wcag: '1.3.1';
758
+ readonly why: 'Browser may process the page incorrectly';
759
+ readonly wcag: '4.1';
735
760
  readonly weight: 4;
736
761
  };
737
762
  readonly stylesheetBanned: {
@@ -2237,12 +2262,20 @@ declare const issuesData: {
2237
2262
  };
2238
2263
  declare const issues: Readonly<Record<string, Issue>>;
2239
2264
  declare const rules: Readonly<Record<string, EngineRules>>;
2240
- declare const makeIssueRules: (ruleTable: Record<string, EngineRules>, issueTable?: Record<string, Issue>) => Record<string, Record<string, IssueRuleGroup>>;
2265
+ declare const makeIssueRules: (ruleTable: Record<string, EngineRules>, issueTable?: Record<string, Issue>) => Record<string, Record<string, ruleIDsByType>>;
2241
2266
  declare const getEditableData: () => {
2242
2267
  issues: Readonly<Record<string, Issue>>;
2243
2268
  rules: Readonly<Record<string, EngineRules>>;
2244
- issueRules: Record<string, Record<string, IssueRuleGroup>>;
2269
+ issueRules: Record<string, Record<string, ruleIDsByType>>;
2245
2270
  };
2246
- declare const issueRules: Record<string, Record<string, IssueRuleGroup>>;
2271
+ declare const makeIssueStats: (issueRuleTable?: Record<string, Record<string, ruleIDsByType>>) => Record<string, IssueEngineRuleCounts>;
2272
+ declare const getSingleEngineIssues: (stats?: Record<string, IssueEngineRuleCounts>) => Array<{
2273
+ issueID: string;
2274
+ engineID: string;
2275
+ ruleCount: number;
2276
+ }>;
2277
+ declare const getEngineRuleCounts: (ruleTable?: Record<string, EngineRules>) => Record<string, number>;
2278
+ declare const issueRules: Record<string, Record<string, ruleIDsByType>>;
2279
+ declare const issueStats: Record<string, IssueEngineRuleCounts>;
2247
2280
  //#endregion
2248
- export { IssueRuleGroup, getEditableData, issueRules, issues, makeIssueRules, rules };
2281
+ export { IssueEngineRuleCounts, getEditableData, getEngineRuleCounts, getSingleEngineIssues, issueRules, issueStats, issues, makeIssueRules, makeIssueStats, ruleIDsByType, rules };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,6 @@
1
1
  //#region src/index.d.ts
2
2
  type IssueID = keyof typeof issuesData;
3
+ type IssueEngineRuleCounts = Record<string, number>;
3
4
  interface Issue {
4
5
  summary: string;
5
6
  why: string;
@@ -7,7 +8,7 @@ interface Issue {
7
8
  weight: number;
8
9
  max?: number;
9
10
  }
10
- interface IssueRuleGroup {
11
+ interface ruleIDsByType {
11
12
  invariant: string[];
12
13
  variable: string[];
13
14
  }
@@ -722,16 +723,40 @@ declare const issuesData: {
722
723
  readonly wcag: '1.3.1';
723
724
  readonly weight: 4;
724
725
  };
725
- readonly metaBad: {
726
- readonly summary: 'meta invalid';
727
- readonly why: 'Document fails to include needed data';
728
- readonly wcag: '1.3.1';
726
+ readonly metaAttributesWrong: {
727
+ readonly summary: 'prohibited or missing meta attributes';
728
+ readonly why: 'Browser processes the page incorrectly';
729
+ readonly wcag: '4.1';
730
+ readonly weight: 3;
731
+ };
732
+ readonly metaAttributeBad: {
733
+ readonly summary: 'meta attribute value invalid';
734
+ readonly why: 'Browser processes the page incorrectly';
735
+ readonly wcag: '4.1';
736
+ readonly weight: 3;
737
+ };
738
+ readonly metaDuplicated: {
739
+ readonly summary: 'meta element duplicated';
740
+ readonly why: 'Browser may process the page incorrectly';
741
+ readonly wcag: '4.1';
742
+ readonly weight: 3;
743
+ };
744
+ readonly metaCharsetLate: {
745
+ readonly summary: 'meta charset declared too late';
746
+ readonly why: 'Browser may display incorrect text';
747
+ readonly wcag: '4.1';
748
+ readonly weight: 4;
749
+ };
750
+ readonly metaXUACompatible: {
751
+ readonly summary: 'meta X-UA-Compatible incomplete';
752
+ readonly why: 'Internet Explorer may display the page incorrectly';
753
+ readonly wcag: '4.1';
729
754
  readonly weight: 3;
730
755
  };
731
756
  readonly metaMisplaced: {
732
757
  readonly summary: 'meta element in invalid location';
733
- readonly why: 'Document fails to provide needed data';
734
- readonly wcag: '1.3.1';
758
+ readonly why: 'Browser may process the page incorrectly';
759
+ readonly wcag: '4.1';
735
760
  readonly weight: 4;
736
761
  };
737
762
  readonly stylesheetBanned: {
@@ -2237,12 +2262,20 @@ declare const issuesData: {
2237
2262
  };
2238
2263
  declare const issues: Readonly<Record<string, Issue>>;
2239
2264
  declare const rules: Readonly<Record<string, EngineRules>>;
2240
- declare const makeIssueRules: (ruleTable: Record<string, EngineRules>, issueTable?: Record<string, Issue>) => Record<string, Record<string, IssueRuleGroup>>;
2265
+ declare const makeIssueRules: (ruleTable: Record<string, EngineRules>, issueTable?: Record<string, Issue>) => Record<string, Record<string, ruleIDsByType>>;
2241
2266
  declare const getEditableData: () => {
2242
2267
  issues: Readonly<Record<string, Issue>>;
2243
2268
  rules: Readonly<Record<string, EngineRules>>;
2244
- issueRules: Record<string, Record<string, IssueRuleGroup>>;
2269
+ issueRules: Record<string, Record<string, ruleIDsByType>>;
2245
2270
  };
2246
- declare const issueRules: Record<string, Record<string, IssueRuleGroup>>;
2271
+ declare const makeIssueStats: (issueRuleTable?: Record<string, Record<string, ruleIDsByType>>) => Record<string, IssueEngineRuleCounts>;
2272
+ declare const getSingleEngineIssues: (stats?: Record<string, IssueEngineRuleCounts>) => Array<{
2273
+ issueID: string;
2274
+ engineID: string;
2275
+ ruleCount: number;
2276
+ }>;
2277
+ declare const getEngineRuleCounts: (ruleTable?: Record<string, EngineRules>) => Record<string, number>;
2278
+ declare const issueRules: Record<string, Record<string, ruleIDsByType>>;
2279
+ declare const issueStats: Record<string, IssueEngineRuleCounts>;
2247
2280
  //#endregion
2248
- export { IssueRuleGroup, getEditableData, issueRules, issues, makeIssueRules, rules };
2281
+ export { IssueEngineRuleCounts, getEditableData, getEngineRuleCounts, getSingleEngineIssues, issueRules, issueStats, issues, makeIssueRules, makeIssueStats, ruleIDsByType, rules };
package/dist/index.mjs CHANGED
@@ -701,16 +701,40 @@ const issuesData = {
701
701
  "wcag": "1.3.1",
702
702
  "weight": 4
703
703
  },
704
- "metaBad": {
705
- "summary": "meta invalid",
706
- "why": "Document fails to include needed data",
707
- "wcag": "1.3.1",
704
+ "metaAttributesWrong": {
705
+ "summary": "prohibited or missing meta attributes",
706
+ "why": "Browser processes the page incorrectly",
707
+ "wcag": "4.1",
708
+ "weight": 3
709
+ },
710
+ "metaAttributeBad": {
711
+ "summary": "meta attribute value invalid",
712
+ "why": "Browser processes the page incorrectly",
713
+ "wcag": "4.1",
714
+ "weight": 3
715
+ },
716
+ "metaDuplicated": {
717
+ "summary": "meta element duplicated",
718
+ "why": "Browser may process the page incorrectly",
719
+ "wcag": "4.1",
720
+ "weight": 3
721
+ },
722
+ "metaCharsetLate": {
723
+ "summary": "meta charset declared too late",
724
+ "why": "Browser may display incorrect text",
725
+ "wcag": "4.1",
726
+ "weight": 4
727
+ },
728
+ "metaXUACompatible": {
729
+ "summary": "meta X-UA-Compatible incomplete",
730
+ "why": "Internet Explorer may display the page incorrectly",
731
+ "wcag": "4.1",
708
732
  "weight": 3
709
733
  },
710
734
  "metaMisplaced": {
711
735
  "summary": "meta element in invalid location",
712
- "why": "Document fails to provide needed data",
713
- "wcag": "1.3.1",
736
+ "why": "Browser may process the page incorrectly",
737
+ "wcag": "4.1",
714
738
  "weight": 4
715
739
  },
716
740
  "stylesheetBanned": {
@@ -5507,32 +5531,32 @@ const rulesData = {
5507
5531
  "what": "Element has a color attribute but no rel attribute with mask-icon as its value"
5508
5532
  },
5509
5533
  "A document must not include more than one meta element with its name attribute set to the value description.": {
5510
- "issueID": "metaBad",
5534
+ "issueID": "metaDuplicated",
5511
5535
  "quality": 1,
5512
5536
  "what": "Element with name=\"description\" is not the only meta element with that name"
5513
5537
  },
5514
5538
  "A document must not include both a meta element with an http-equiv attribute whose value is content-type, and a meta element with a charset attribute.": {
5515
- "issueID": "metaBad",
5539
+ "issueID": "metaDuplicated",
5516
5540
  "quality": 1,
5517
5541
  "what": "Element with http-equiv=\"content-type\" is incompatible with the meta element with a charset attribute"
5518
5542
  },
5519
5543
  "A document must not include more than one meta element with a http-equiv attribute whose value is content-type.": {
5520
- "issueID": "metaBad",
5544
+ "issueID": "metaDuplicated",
5521
5545
  "quality": 1,
5522
5546
  "what": "Page has more than 1 meta element with http-equiv=\"content-type\""
5523
5547
  },
5524
5548
  "A meta element with an http-equiv attribute whose value is X-UA-Compatible must have a content attribute with the value IE=edge.": {
5525
- "issueID": "metaBad",
5549
+ "issueID": "metaXUACompatible",
5526
5550
  "quality": 1,
5527
5551
  "what": "Element with http-equiv=\"X-UA-Compatible\" has no content=\"IE=edge\""
5528
5552
  },
5529
5553
  "A document must not include more than one meta element with a charset attribute.": {
5530
- "issueID": "metaBad",
5554
+ "issueID": "metaDuplicated",
5531
5555
  "quality": 1,
5532
5556
  "what": "More than 1 meta element has a charset attribute"
5533
5557
  },
5534
5558
  "A charset attribute on a meta element found after the first 1024 bytes.": {
5535
- "issueID": "metaBad",
5559
+ "issueID": "metaCharsetLate",
5536
5560
  "quality": 1,
5537
5561
  "what": "charset attribute on a meta element appears after 1024 bytes"
5538
5562
  },
@@ -6359,17 +6383,17 @@ const rulesData = {
6359
6383
  "what": "Element does not exist in HTML"
6360
6384
  },
6361
6385
  "Attribute .+ not allowed on element meta at this point.*": {
6362
- "issueID": "metaBad",
6386
+ "issueID": "metaAttributesWrong",
6363
6387
  "quality": 1,
6364
6388
  "what": "Attribute is not allowed on a meta element here"
6365
6389
  },
6366
6390
  "Element meta is missing one or more of the following attributes: .+": {
6367
- "issueID": "metaBad",
6391
+ "issueID": "metaAttributesWrong",
6368
6392
  "quality": 1,
6369
6393
  "what": "Element is missing a required attribute"
6370
6394
  },
6371
6395
  "Bad value .+ for attribute .+ on element meta.*": {
6372
- "issueID": "metaBad",
6396
+ "issueID": "metaAttributeBad",
6373
6397
  "quality": 1,
6374
6398
  "what": "Attribute of a meta element has an invalid value"
6375
6399
  },
@@ -7053,32 +7077,32 @@ const rulesData = {
7053
7077
  "what": "Element has a color attribute but no rel attribute with mask-icon as its value"
7054
7078
  },
7055
7079
  "A document must not include more than one meta element with its name attribute set to the value description.": {
7056
- "issueID": "metaBad",
7080
+ "issueID": "metaDuplicated",
7057
7081
  "quality": 1,
7058
7082
  "what": "Element with name=\"description\" is not the only meta element with that name"
7059
7083
  },
7060
7084
  "A document must not include both a meta element with an http-equiv attribute whose value is content-type, and a meta element with a charset attribute.": {
7061
- "issueID": "metaBad",
7085
+ "issueID": "metaDuplicated",
7062
7086
  "quality": 1,
7063
7087
  "what": "Element with http-equiv=\"content-type\" is incompatible with the meta element with a charset attribute"
7064
7088
  },
7065
7089
  "A document must not include more than one meta element with a http-equiv attribute whose value is content-type.": {
7066
- "issueID": "metaBad",
7090
+ "issueID": "metaDuplicated",
7067
7091
  "quality": 1,
7068
7092
  "what": "Page has more than 1 meta element with http-equiv=\"content-type\""
7069
7093
  },
7070
7094
  "A meta element with an http-equiv attribute whose value is X-UA-Compatible must have a content attribute with the value IE=edge.": {
7071
- "issueID": "metaBad",
7095
+ "issueID": "metaXUACompatible",
7072
7096
  "quality": 1,
7073
7097
  "what": "Element with http-equiv=\"X-UA-Compatible\" has no content=\"IE=edge\""
7074
7098
  },
7075
7099
  "A document must not include more than one meta element with a charset attribute.": {
7076
- "issueID": "metaBad",
7100
+ "issueID": "metaDuplicated",
7077
7101
  "quality": 1,
7078
7102
  "what": "More than 1 meta element has a charset attribute"
7079
7103
  },
7080
7104
  "A charset attribute on a meta element found after the first 1024 bytes.": {
7081
- "issueID": "metaBad",
7105
+ "issueID": "metaCharsetLate",
7082
7106
  "quality": 1,
7083
7107
  "what": "charset attribute on a meta element appears after 1024 bytes"
7084
7108
  },
@@ -7905,17 +7929,17 @@ const rulesData = {
7905
7929
  "what": "Element does not exist in HTML"
7906
7930
  },
7907
7931
  "Attribute .+ not allowed on element meta at this point.*": {
7908
- "issueID": "metaBad",
7932
+ "issueID": "metaAttributesWrong",
7909
7933
  "quality": 1,
7910
7934
  "what": "Attribute is not allowed on a meta element here"
7911
7935
  },
7912
7936
  "Element meta is missing one or more of the following attributes: .+": {
7913
- "issueID": "metaBad",
7937
+ "issueID": "metaAttributesWrong",
7914
7938
  "quality": 1,
7915
7939
  "what": "Element is missing a required attribute"
7916
7940
  },
7917
7941
  "Bad value .+ for attribute .+ on element meta.*": {
7918
- "issueID": "metaBad",
7942
+ "issueID": "metaAttributeBad",
7919
7943
  "quality": 1,
7920
7944
  "what": "Attribute of a meta element has an invalid value"
7921
7945
  },
@@ -9723,6 +9747,32 @@ const getEditableData = () => ({
9723
9747
  rules: structuredClone(rules),
9724
9748
  issueRules: structuredClone(issueRules)
9725
9749
  });
9750
+ const makeIssueStats = (issueRuleTable = issueRules) => {
9751
+ const stats = {};
9752
+ Object.entries(issueRuleTable).forEach(([issueID, engineData]) => {
9753
+ stats[issueID] = {};
9754
+ Object.entries(engineData).forEach(([engineID, { invariant, variable }]) => {
9755
+ stats[issueID][engineID] = invariant.length + variable.length;
9756
+ });
9757
+ });
9758
+ return stats;
9759
+ };
9760
+ const getSingleEngineIssues = (stats = issueStats) => Object.entries(stats).filter(([, engineCounts]) => Object.keys(engineCounts).filter((engineID) => engineID !== `nuVnu`).length === 1).map(([issueID, engineCounts]) => {
9761
+ const [engineID, ruleCount] = Object.entries(engineCounts)[0];
9762
+ return {
9763
+ issueID,
9764
+ engineID,
9765
+ ruleCount
9766
+ };
9767
+ }).sort((a, b) => b.ruleCount - a.ruleCount);
9768
+ const getEngineRuleCounts = (ruleTable = rules) => {
9769
+ const counts = {};
9770
+ Object.keys(ruleTable).forEach((engineID) => {
9771
+ counts[engineID] = Object.keys(ruleTable[engineID].invariant).length + Object.keys(ruleTable[engineID].variable).length;
9772
+ });
9773
+ return counts;
9774
+ };
9726
9775
  const issueRules = makeIssueRules(rules);
9776
+ const issueStats = makeIssueStats(issueRules);
9727
9777
  //#endregion
9728
- export { getEditableData, issueRules, issues, makeIssueRules, rules };
9778
+ export { getEditableData, getEngineRuleCounts, getSingleEngineIssues, issueRules, issueStats, issues, makeIssueRules, makeIssueStats, rules };
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "testaro-issues",
3
- "version": "0.2.1",
4
- "description": "A classification of about 1300 rules of 10 rule engines into about 300 issues. The rule engines are those in the ensemble of Testaro, which tests web pages for front-end quality (accessibility, usability, and standards conformance).",
3
+ "version": "0.3.0",
4
+ "type": "module",
5
+ "description": "A classification of about 1500 rules of 10 rule engines into about 400 issues. The rule engines are those in the ensemble of Testaro, which tests web pages for front-end quality (accessibility, usability, and standards conformance).",
5
6
  "main": "./dist/index.cjs",
6
7
  "module": "./dist/index.mjs",
7
8
  "types": "./dist/index.d.ts",