Small adjustments in notations

This commit is contained in:
Gaël Métais
2014-09-18 16:43:11 +02:00
parent e3c2f0272f
commit aeb1da74fe
2 changed files with 11 additions and 7 deletions
+5 -4
View File
@@ -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';
}