From c3ca19546047af0d7133aa1b785a5cd92c7a0198 Mon Sep 17 00:00:00 2001 From: Pierre Baumard Date: Fri, 9 Aug 2024 18:47:13 +0200 Subject: [PATCH 01/19] Rule specifications normalization in progress --- .../src/main/rules/EC1/EC1.json | 10 +- .../src/main/rules/EC1/java/EC1.asciidoc | 31 ++- .../src/main/rules/EC10/EC10.json | 13 +- .../src/main/rules/EC10/python/EC10.asciidoc | 13 +- .../src/main/rules/EC11/EC11.json | 14 +- .../main/rules/EC11/javascript/EC11.asciidoc | 9 +- .../src/main/rules/EC12/EC12.json | 16 +- .../main/rules/EC12/javascript/EC12.asciidoc | 11 +- .../src/main/rules/EC13/EC13.json | 4 +- .../main/rules/EC13/javascript/EC13.asciidoc | 9 +- .../src/main/rules/EC2/EC2.json | 10 +- .../src/main/rules/EC2/java/EC2.asciidoc | 50 ++-- .../src/main/rules/EC2/php/EC2.asciidoc | 62 +++-- .../src/main/rules/EC2/python/EC2.asciidoc | 62 +++-- .../src/main/rules/EC203/EC203.json | 10 +- .../main/rules/EC203/python/EC203.asciidoc | 48 ++-- .../src/main/rules/EC22/EC22.json | 12 +- .../src/main/rules/EC22/php/EC22.asciidoc | 15 +- .../src/main/rules/EC24/EC24.json | 2 +- .../src/main/rules/EC24/java/EC24.asciidoc | 4 +- .../main/rules/EC24/javascript/EC24.asciidoc | 7 +- .../src/main/rules/EC25/EC25.json | 4 +- .../main/rules/EC25/javascript/EC25.asciidoc | 11 +- .../src/main/rules/EC26/EC26.json | 4 +- .../main/rules/EC26/javascript/EC26.asciidoc | 8 +- .../src/main/rules/EC27/EC27.json | 10 +- .../src/main/rules/EC27/java/EC27.asciidoc | 15 +- .../src/main/rules/EC28/EC28.json | 10 +- .../src/main/rules/EC28/java/EC28.asciidoc | 20 +- .../src/main/rules/EC29/EC29.json | 4 +- .../main/rules/EC29/javascript/EC29.asciidoc | 9 +- .../src/main/rules/EC3/EC3.json | 10 +- .../src/main/rules/EC3/java/EC3.asciidoc | 17 +- .../src/main/rules/EC3/php/EC3.asciidoc | 27 +- .../src/main/rules/EC30/EC30.json | 4 +- .../main/rules/EC30/javascript/EC30.asciidoc | 10 +- .../src/main/rules/EC31/EC31.json | 4 +- .../main/rules/EC31/javascript/EC31.asciidoc | 18 +- .../src/main/rules/EC32/EC32.json | 10 +- .../src/main/rules/EC32/java/EC32.asciidoc | 13 +- .../src/main/rules/EC34/EC34.json | 10 +- .../src/main/rules/EC34/php/EC34.asciidoc | 18 +- .../src/main/rules/EC34/python/EC34.asciidoc | 14 +- .../src/main/rules/EC35/EC35.json | 10 +- .../src/main/rules/EC35/php/EC35.asciidoc | 21 +- .../src/main/rules/EC35/python/EC35.asciidoc | 15 +- .../src/main/rules/EC36/EC36.json | 5 +- .../src/main/rules/EC36/html/EC36.asciidoc | 18 +- .../src/main/rules/EC4/EC4.json | 10 +- .../src/main/rules/EC4/php/EC4.asciidoc | 28 ++- .../src/main/rules/EC4/python/EC4.asciidoc | 31 ++- .../src/main/rules/EC404/EC404.json | 10 +- .../main/rules/EC404/python/EC404.asciidoc | 16 +- .../src/main/rules/EC5/EC5.json | 10 +- .../src/main/rules/EC5/java/EC5.asciidoc | 15 +- .../src/main/rules/EC500/EC500.json | 12 +- .../src/main/rules/EC500/java/EC500.asciidoc | 13 +- .../src/main/rules/EC501/EC501.json | 14 +- .../src/main/rules/EC501/java/EC501.asciidoc | 14 +- .../src/main/rules/EC502/EC502.json | 16 +- .../src/main/rules/EC502/java/EC502.asciidoc | 16 +- .../src/main/rules/EC503/EC503.json | 14 +- .../src/main/rules/EC503/java/EC503.asciidoc | 14 +- .../src/main/rules/EC504/EC504.json | 14 +- .../src/main/rules/EC504/java/EC504.asciidoc | 13 +- .../src/main/rules/EC505/EC505.json | 12 +- .../src/main/rules/EC505/java/EC505.asciidoc | 23 +- .../src/main/rules/EC505/swift/EC505.asciidoc | 16 +- .../src/main/rules/EC505/xml/EC505.asciidoc | 14 +- .../src/main/rules/EC506/EC506.json | 13 +- .../src/main/rules/EC506/java/EC506.asciidoc | 12 +- .../src/main/rules/EC507/EC507.json | 14 +- .../src/main/rules/EC507/java/EC507.asciidoc | 13 +- .../src/main/rules/EC507/xml/EC507.asciidoc | 16 +- .../src/main/rules/EC508/EC508.json | 13 +- .../src/main/rules/EC508/java/EC508.asciidoc | 16 +- .../src/main/rules/EC509/EC509.json | 14 +- .../src/main/rules/EC509/java/EC509.asciidoc | 15 +- .../src/main/rules/EC509/swift/EC509.asciidoc | 15 +- .../src/main/rules/EC510/EC510.json | 14 +- .../src/main/rules/EC510/java/EC510.asciidoc | 16 +- .../src/main/rules/EC511/EC511.json | 14 +- .../src/main/rules/EC511/java/EC511.asciidoc | 17 +- .../src/main/rules/EC512/EC512.json | 6 +- .../src/main/rules/EC512/java/EC512.asciidoc | 16 +- .../src/main/rules/EC513/EC513.json | 14 +- .../src/main/rules/EC513/java/EC513.asciidoc | 13 +- .../src/main/rules/EC513/swift/EC513.asciidoc | 13 +- .../src/main/rules/EC514/EC514.json | 14 +- .../src/main/rules/EC514/java/EC514.asciidoc | 13 +- .../src/main/rules/EC514/swift/EC514.asciidoc | 13 +- .../src/main/rules/EC515/EC515.json | 14 +- .../src/main/rules/EC515/java/EC515.asciidoc | 14 +- .../src/main/rules/EC515/swift/EC515.asciidoc | 15 +- .../src/main/rules/EC516/EC516.json | 14 +- .../src/main/rules/EC516/java/EC516.asciidoc | 18 +- .../src/main/rules/EC517/EC517.json | 14 +- .../src/main/rules/EC517/java/EC517.asciidoc | 13 +- .../src/main/rules/EC518/EC518.json | 14 +- .../src/main/rules/EC518/java/EC518.asciidoc | 15 +- .../src/main/rules/EC519/EC519.json | 12 +- .../src/main/rules/EC519/java/EC519.asciidoc | 23 +- .../src/main/rules/EC519/swift/EC519.asciidoc | 24 +- .../src/main/rules/EC519/xml/EC519.asciidoc | 23 +- .../src/main/rules/EC520/EC520.json | 14 +- .../src/main/rules/EC520/java/EC520.asciidoc | 25 +- .../src/main/rules/EC520/swift/EC520.asciidoc | 19 +- .../src/main/rules/EC520/xml/EC520.asciidoc | 19 +- .../src/main/rules/EC521/EC521.json | 15 +- .../src/main/rules/EC521/java/EC521.asciidoc | 14 +- .../src/main/rules/EC522/EC522.json | 10 +- .../src/main/rules/EC522/java/EC522.asciidoc | 18 +- .../src/main/rules/EC522/java/EC522.json | 7 +- .../rules/EC522/javascript/EC522.asciidoc | 13 +- .../main/rules/EC522/javascript/EC522.json | 6 +- .../src/main/rules/EC522/swift/EC522.asciidoc | 16 +- .../src/main/rules/EC522/swift/EC522.json | 8 +- .../src/main/rules/EC523/EC523.json | 8 +- .../src/main/rules/EC523/java/EC523.asciidoc | 15 +- .../src/main/rules/EC523/java/EC523.json | 2 - .../rules/EC523/javascript/EC523.asciidoc | 13 +- .../main/rules/EC523/javascript/EC523.json | 7 +- .../src/main/rules/EC524/EC524.json | 15 +- .../src/main/rules/EC524/java/EC524.asciidoc | 13 +- .../src/main/rules/EC524/swift/EC524.asciidoc | 18 +- .../src/main/rules/EC525/EC525.json | 15 +- .../src/main/rules/EC525/java/EC525.asciidoc | 13 +- .../src/main/rules/EC526/EC526.json | 14 +- .../src/main/rules/EC526/java/EC526.asciidoc | 14 +- .../src/main/rules/EC527/EC527.json | 15 +- .../src/main/rules/EC527/java/EC527.asciidoc | 16 +- .../src/main/rules/EC528/EC528.json | 12 +- .../src/main/rules/EC528/java/EC528.asciidoc | 15 +- .../src/main/rules/EC529/EC529.json | 13 +- .../src/main/rules/EC529/java/EC529.asciidoc | 13 +- .../src/main/rules/EC530/EC530.json | 10 +- .../src/main/rules/EC530/java/EC530.asciidoc | 14 +- .../src/main/rules/EC530/java/EC530.json | 2 - .../rules/EC530/javascript/EC530.asciidoc | 6 +- .../main/rules/EC530/javascript/EC530.json | 2 - .../src/main/rules/EC530/swift/EC530.asciidoc | 21 +- .../src/main/rules/EC530/swift/EC530.json | 5 +- .../src/main/rules/EC531/EC531.json | 16 +- .../src/main/rules/EC531/java/EC531.asciidoc | 17 +- .../src/main/rules/EC532/EC532.json | 17 +- .../src/main/rules/EC532/java/EC532.asciidoc | 21 +- .../src/main/rules/EC533/EC533.json | 12 +- .../src/main/rules/EC533/swift/EC533.asciidoc | 20 +- .../src/main/rules/EC534/EC534.json | 15 +- .../src/main/rules/EC534/swift/EC534.asciidoc | 21 +- .../src/main/rules/EC540/EC540.json | 12 +- .../src/main/rules/EC540/xml/EC540.asciidoc | 12 +- .../src/main/rules/EC543/EC543.json | 12 +- .../src/main/rules/EC543/xml/EC543.asciidoc | 21 +- .../src/main/rules/EC544/EC544.json | 14 +- .../src/main/rules/EC544/xml/EC544.asciidoc | 18 +- .../src/main/rules/EC547/EC547.json | 15 +- .../src/main/rules/EC547/xml/EC547.asciidoc | 18 +- .../src/main/rules/EC548/EC548.json | 16 +- .../src/main/rules/EC548/xml/EC548.asciidoc | 15 +- .../src/main/rules/EC602/EC602.json | 13 +- .../src/main/rules/EC603/EC603.json | 15 +- .../src/main/rules/EC603/swift/EC603.asciidoc | 14 +- .../src/main/rules/EC66/EC66.json | 10 +- .../src/main/rules/EC66/php/EC66.asciidoc | 22 +- .../src/main/rules/EC67/EC67.json | 10 +- .../src/main/rules/EC67/java/EC67.asciidoc | 19 +- .../src/main/rules/EC67/php/EC67.asciidoc | 22 +- .../src/main/rules/EC69/EC69.json | 10 +- .../src/main/rules/EC69/csharp/EC69.asciidoc | 15 +- .../src/main/rules/EC69/java/EC69.asciidoc | 13 +- .../src/main/rules/EC69/php/EC69.asciidoc | 23 +- .../src/main/rules/EC69/python/EC69.asciidoc | 12 +- .../src/main/rules/EC7/EC7.json | 10 +- .../src/main/rules/EC7/python/EC7.asciidoc | 21 +- .../src/main/rules/EC72/EC72.json | 10 +- .../src/main/rules/EC72/csharp/EC72.asciidoc | 15 +- .../src/main/rules/EC72/java/EC72.asciidoc | 13 +- .../src/main/rules/EC72/php/EC72.asciidoc | 34 ++- .../src/main/rules/EC72/python/EC72.asciidoc | 15 +- .../src/main/rules/EC74/EC74.json | 10 +- .../src/main/rules/EC74/java/EC74.asciidoc | 14 +- .../src/main/rules/EC74/php/EC74.asciidoc | 22 +- .../src/main/rules/EC74/python/EC74.asciidoc | 13 +- .../src/main/rules/EC75/EC75.json | 10 +- .../src/main/rules/EC75/csharp/EC75.asciidoc | 15 +- .../src/main/rules/EC76/EC76.json | 11 +- .../src/main/rules/EC76/java/EC76.asciidoc | 20 +- .../src/main/rules/EC77/EC77.json | 10 +- .../src/main/rules/EC77/java/EC77.asciidoc | 20 +- .../src/main/rules/EC78/EC78.json | 10 +- .../src/main/rules/EC78/java/EC78.asciidoc | 14 +- .../src/main/rules/EC79/EC79.json | 10 +- .../src/main/rules/EC79/java/EC79.asciidoc | 13 +- .../src/main/rules/EC81/EC81.json | 10 +- .../src/main/rules/EC81/csharp/EC81.asciidoc | 17 +- .../src/main/rules/EC82/EC82.json | 11 +- .../src/main/rules/EC82/csharp/EC82.asciidoc | 19 +- .../src/main/rules/EC83/EC83.json | 10 +- .../src/main/rules/EC83/csharp/EC83.asciidoc | 19 +- .../src/main/rules/EC84/EC84.json | 10 +- .../src/main/rules/EC84/csharp/EC84.asciidoc | 19 +- .../src/main/rules/EC85/EC85.json | 8 +- .../src/main/rules/EC85/csharp/EC85.asciidoc | 36 +-- .../src/main/rules/EC86/EC86.json | 9 +- .../src/main/rules/EC86/csharp/EC86.asciidoc | 18 +- .../src/main/rules/EC87/EC87.json | 10 +- .../src/main/rules/EC87/csharp/EC87.asciidoc | 23 +- .../src/main/rules/EC88/EC88.json | 10 +- .../src/main/rules/EC88/csharp/EC88.asciidoc | 20 +- .../src/main/rules/EC89/EC89.json | 10 +- .../src/main/rules/EC89/python/EC89.asciidoc | 15 +- .../src/main/rules/EC9/EC9.json | 4 +- .../main/rules/EC9/javascript/EC9.asciidoc | 14 +- .../src/main/rules/EC91/EC91.json | 10 +- .../src/main/rules/EC91/csharp/EC91.asciidoc | 18 +- .../src/main/rules/EC92/EC92.json | 10 +- .../src/main/rules/EC92/csharp/EC92.asciidoc | 17 +- .../src/main/rules/EC93/EC93.json | 10 +- .../src/main/rules/EC93/csharp/EC93.asciidoc | 19 +- .../src/main/rules/EC94/EC94.json | 10 +- .../src/main/rules/EC94/java/EC94.asciidoc | 13 +- .../main/rules/etsdiff-methodology.asciidoc | 2 +- .../fr/greencodeinitiative/RulesTest.java | 233 ++++++++++++++++++ pom.xml | 48 ++++ 225 files changed, 2719 insertions(+), 811 deletions(-) create mode 100644 ecocode-rules-specifications/src/test/java/fr/greencodeinitiative/RulesTest.java diff --git a/ecocode-rules-specifications/src/main/rules/EC1/EC1.json b/ecocode-rules-specifications/src/main/rules/EC1/EC1.json index 826bb1dda..257f041c0 100644 --- a/ecocode-rules-specifications/src/main/rules/EC1/EC1.json +++ b/ecocode-rules-specifications/src/main/rules/EC1/EC1.json @@ -1,5 +1,5 @@ { - "title": "Avoid Spring repository call in loop or stream operations", + "title": "Spring repository should not be called in loop or stream operations", "type": "CODE_SMELL", "status": "ready", "remediation": { @@ -12,5 +12,11 @@ "eco-design", "ecocode" ], - "defaultSeverity": "Minor" + "defaultSeverity": "Minor", + "code": { + "impacts": { + "RELIABILITY": "LOW" + }, + "attribute": "EFFICIENT" + } } diff --git a/ecocode-rules-specifications/src/main/rules/EC1/java/EC1.asciidoc b/ecocode-rules-specifications/src/main/rules/EC1/java/EC1.asciidoc index 524e8d0c2..457dad28a 100644 --- a/ecocode-rules-specifications/src/main/rules/EC1/java/EC1.asciidoc +++ b/ecocode-rules-specifications/src/main/rules/EC1/java/EC1.asciidoc @@ -1,9 +1,17 @@ +:!sectids: + +== Why is this an issue? + The use of Spring repository in a loop induces unnecessary calculations by the CPU and therefore superfluous energy consumption. Also, the use of Spring repository in a stream operation like "peek, forEach, forEachOrdered, map" induces unnecessary multiple access to the database instead of single batch call. -## Noncompliant Code Example +== How to fix it -```java +=== Noncompliant Code Example + +[source,java] +---- +// Noncompliant private final List ids = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); List employees = new ArrayList<>(); @@ -14,9 +22,11 @@ for (Integer id: ids) { employees.add(employee.get()); } } -``` +---- -```java +[source,java] +---- +// Noncompliant List employees = new ArrayList<>(); Stream stream = Stream.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); stream.forEach(id -> { @@ -25,16 +35,21 @@ stream.forEach(id -> { employees.add(employee.get()); } }); -``` +---- -## Compliant Solution +== Compliant solution -```java +[source,java] +---- private final List ids = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); List employees = employeeRepository.findAllById(ids); -``` +---- ```java private final List ids = Stream.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10).toList(); List employees = employeeRepository.findAllById(ids); ``` + +== Resources + +Reference/Validation is unknown. diff --git a/ecocode-rules-specifications/src/main/rules/EC10/EC10.json b/ecocode-rules-specifications/src/main/rules/EC10/EC10.json index ec7fbffd9..f6377762a 100644 --- a/ecocode-rules-specifications/src/main/rules/EC10/EC10.json +++ b/ecocode-rules-specifications/src/main/rules/EC10/EC10.json @@ -1,5 +1,5 @@ { - "title": "Avoid using unoptimized vector images", + "title": "Unoptimized vector images should be avoided", "type": "CODE_SMELL", "status": "ready", "remediation": { @@ -8,7 +8,14 @@ }, "tags": [ "eco-design", - "ecocode" + "ecocode", + "performance" ], - "defaultSeverity": "Minor" + "defaultSeverity": "Minor", + "code": { + "impacts": { + "RELIABILITY": "LOW" + }, + "attribute": "EFFICIENT" + } } diff --git a/ecocode-rules-specifications/src/main/rules/EC10/python/EC10.asciidoc b/ecocode-rules-specifications/src/main/rules/EC10/python/EC10.asciidoc index cf2483171..876fdb4c6 100644 --- a/ecocode-rules-specifications/src/main/rules/EC10/python/EC10.asciidoc +++ b/ecocode-rules-specifications/src/main/rules/EC10/python/EC10.asciidoc @@ -1,6 +1,11 @@ +:!sectids: + +== Why is this an issue? + SVG images generated by common drawing softwares contains unnecessary data: calc layer, metadata, namespaces and comments. -## Noncompliant Code Example +== How to fix it +=== Noncompliant code example ```xml @@ -30,10 +35,14 @@ SVG images generated by common drawing softwares contains unnecessary data: calc ``` -## Compliant Solution +=== Compliant solution ```xml ``` + +== Resources + +- https://github.com/cnumr/best-practices/blob/main/chapters/BP_036_fr.md[CNumR best practices (3rd edition) BP_036] diff --git a/ecocode-rules-specifications/src/main/rules/EC11/EC11.json b/ecocode-rules-specifications/src/main/rules/EC11/EC11.json index b03cb64dd..6efe68c92 100644 --- a/ecocode-rules-specifications/src/main/rules/EC11/EC11.json +++ b/ecocode-rules-specifications/src/main/rules/EC11/EC11.json @@ -1,12 +1,6 @@ { - "title": "Disallow multiple access of same DOM element.", + "title": "DOM manipulation should be limited", "type": "CODE_SMELL", - "code": { - "impacts": { - "MAINTAINABILITY": "MEDIUM" - }, - "attribute": "EFFICIENT" - }, "status": "ready", "remediation": { "func": "Constant\/Issue", @@ -18,6 +12,12 @@ "performance" ], "defaultSeverity": "Major", + "code": { + "impacts": { + "RELIABILITY": "MEDIUM" + }, + "attribute": "EFFICIENT" + }, "compatibleLanguages": [ "JAVASCRIPT", "TYPESCRIPT" diff --git a/ecocode-rules-specifications/src/main/rules/EC11/javascript/EC11.asciidoc b/ecocode-rules-specifications/src/main/rules/EC11/javascript/EC11.asciidoc index 94ef0077d..e3c87ceb3 100644 --- a/ecocode-rules-specifications/src/main/rules/EC11/javascript/EC11.asciidoc +++ b/ecocode-rules-specifications/src/main/rules/EC11/javascript/EC11.asciidoc @@ -10,14 +10,19 @@ Assigning the DOM object to a variable not only improves performance but also en It makes the code more concise and self-explanatory. Developers reading the code can understand that the variable holds a reference to a specific DOM element, and its subsequent use is likely for multiple operations. +== How to fix it +=== Noncompliant code example + Here's an example in JavaScript to illustrate this rule: [source,js,data-diff-id="2",data-diff-type="noncompliant"] ---- const width = document.getElementById('block').clientWidth; -const height = document.getElementById('block').clientHeight; // Non-compliant +const height = document.getElementById('block').clientHeight; // Noncompliant ---- +=== Compliant solution + [source,js,data-diff-id="1",data-diff-type="noncompliant"] ---- const blockElement = document.getElementById('block'); // Compliant @@ -32,5 +37,5 @@ In the second example, the DOM element reference is cached in the `blockElement` === Documentation -- https://github.com/cnumr/best-practices/blob/main/chapters/BP_054_en.md[CNUMR best practices] - Reduce DOM access via JavaScript +- https://github.com/cnumr/best-practices/blob/main/chapters/BP_054_en.md[CNumR best practices] - Reduce DOM access via JavaScript - https://developer.mozilla.org/en-US/docs/Learn/Performance/JavaScript#tips_for_writing_more_efficient_code[Mozilla Web Technology for Developers] - Tips for writing more efficient code diff --git a/ecocode-rules-specifications/src/main/rules/EC12/EC12.json b/ecocode-rules-specifications/src/main/rules/EC12/EC12.json index 633a643d2..1998ae15b 100644 --- a/ecocode-rules-specifications/src/main/rules/EC12/EC12.json +++ b/ecocode-rules-specifications/src/main/rules/EC12/EC12.json @@ -1,12 +1,6 @@ { - "title": "Disallow multiple style changes at once.", + "title": "Multiple style changes should be batched", "type": "CODE_SMELL", - "code": { - "impacts": { - "MAINTAINABILITY": "MEDIUM" - }, - "attribute": "EFFICIENT" - }, "status": "ready", "remediation": { "func": "Constant\/Issue", @@ -18,8 +12,14 @@ "performance" ], "defaultSeverity": "Major", + "code": { + "impacts": { + "RELIABILITY": "MEDIUM" + }, + "attribute": "EFFICIENT" + }, "compatibleLanguages": [ "JAVASCRIPT", "TYPESCRIPT" ] -} +} \ No newline at end of file diff --git a/ecocode-rules-specifications/src/main/rules/EC12/javascript/EC12.asciidoc b/ecocode-rules-specifications/src/main/rules/EC12/javascript/EC12.asciidoc index b75571d8b..57cb75677 100644 --- a/ecocode-rules-specifications/src/main/rules/EC12/javascript/EC12.asciidoc +++ b/ecocode-rules-specifications/src/main/rules/EC12/javascript/EC12.asciidoc @@ -10,17 +10,22 @@ Making multiple CSS changes in a single batch can trigger multiple reflows and r Reflows and repaints are resource-intensive operations that can lead to performance issues. Applying changes individually minimizes the number of reflows and repaints, improving overall page performance. +== How to fix it +=== Noncompliant code example + Here's an example in JavaScript and CSS to illustrate this rule: [source,html,data-diff-id="3",data-diff-type="noncompliant"] ---- ---- +=== Compliant solution + [source,html,data-diff-id="10",data-diff-type="compliant"] ----