From aeb1da74fe77e80f693ef4cd7a07e054b5e10fb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20M=C3=A9tais?= Date: Thu, 18 Sep 2014 16:43:11 +0200 Subject: [PATCH] Small adjustments in notations --- app/node_views/results.html | 9 ++++++--- app/public/scripts/resultsCtrl.js | 9 +++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/node_views/results.html b/app/node_views/results.html index 000d825..064fe1a 100644 --- a/app/node_views/results.html +++ b/app/node_views/results.html @@ -93,7 +93,7 @@
-
{{notations.badPractices}}
+
{{notations.jsBadPractices}}
Bad Javascript
    @@ -109,12 +109,15 @@
  • Console messages: {{phantomasResults.metrics.consoleMessages}}
  • +
  • + Global variables: {{phantomasResults.metrics.globalVariables}} +
{{notations.scripts}}
-
Scripts loaded
+
JS files loaded
  • @@ -186,7 +189,7 @@
{{notations.cssCount}}
-
CSS loaded
+
CSS files loaded
  • diff --git a/app/public/scripts/resultsCtrl.js b/app/public/scripts/resultsCtrl.js index 3816175..67321ff 100644 --- a/app/public/scripts/resultsCtrl.js +++ b/app/public/scripts/resultsCtrl.js @@ -71,7 +71,7 @@ app.controller('ResultsCtrl', function ($scope) { domManipulations: getDomManipulationsScore(), duplicatedDomQueries: getDuplicatedDomQueriesScore(), eventsBound: getEventsBoundScore(), - badPractices: getBadPracticesScore(), + jsBadPractices: getJSBadPracticesScore(), scripts: getScriptsScore(), jQueryLoading: getJQueryLoadingScore(), cssComplexity: getCSSComplexityScore(), @@ -241,12 +241,13 @@ app.controller('ResultsCtrl', function ($scope) { return note; } - function getBadPracticesScore() { + function getJSBadPracticesScore() { var note = 'A'; var score = $scope.phantomasResults.metrics.documentWriteCalls * 3 + - $scope.phantomasResults.metrics.evalCalls * 3 + + $scope.phantomasResults.metrics.evalCalls * 2 + $scope.phantomasResults.metrics.jsErrors * 10 + - $scope.phantomasResults.metrics.consoleMessages; + $scope.phantomasResults.metrics.consoleMessages / 2 + + $scope.phantomasResults.metrics.globalVariables / 10; if (score > 5) { note = 'B'; }