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
{{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';
}