Browse Source

Add DOM IDs duplicated to DOM Complexity notation

Gaël Métais 10 years ago
parent
commit
e3c2f0272f
2 changed files with 5 additions and 1 deletions
  1. 3 0
      app/node_views/results.html
  2. 2 1
      app/public/scripts/resultsCtrl.js

+ 3 - 0
app/node_views/results.html

@@ -53,6 +53,9 @@
                             <li ng-if="phantomasResults.metrics.iframesCount">
                                 Number of iframes: {{phantomasResults.metrics.iframesCount}}
                             </li>
+                            <li ng-if="phantomasResults.metrics.DOMidDuplicated">
+                                IDs duplicated: {{phantomasResults.metrics.DOMidDuplicated}}
+                            </li>
                         </ul>
                     </div>
                 </div>

+ 2 - 1
app/public/scripts/resultsCtrl.js

@@ -156,7 +156,8 @@ app.controller('ResultsCtrl', function ($scope) {
         var note = 'A';
         var score = $scope.phantomasResults.metrics.DOMelementsCount +
                     Math.pow($scope.phantomasResults.metrics.DOMelementMaxDepth, 2) +
-                    $scope.phantomasResults.metrics.iframesCount * 50;
+                    $scope.phantomasResults.metrics.iframesCount * 50 +
+                    $scope.phantomasResults.metrics.DOMidDuplicated * 25;
         if (score > 1000) {
             note = 'B';
         }