Better handling of CSS parsing errors

This commit is contained in:
Gaël Métais
2014-09-26 16:50:42 +02:00
parent 06ea90f073
commit a02fd2496f
4 changed files with 116 additions and 22 deletions
+2 -7
View File
@@ -70,9 +70,6 @@ app.controller('ResultsCtrl', function ($scope) {
});
}
// Check if the CSS was correctly parsed
$scope.cssParsingError = (!$scope.phantomasResults.metrics.cssRules && $scope.phantomasResults.metrics.cssCount > 0);
// Grab the notes
$scope.notations = {
domComplexity: getDomComplexityScore(),
@@ -261,9 +258,7 @@ app.controller('ResultsCtrl', function ($scope) {
}
function getCSSComplexityScore() {
if ($scope.cssParsingError) {
return 'F';
} else if (!$scope.phantomasResults.metrics.cssRules) {
if (!$scope.phantomasResults.metrics.cssRules) {
return 'NA';
}
@@ -289,7 +284,7 @@ app.controller('ResultsCtrl', function ($scope) {
}
function getBadCssScore() {
if ($scope.cssParsingError) {
if ($scope.phantomasResults.metrics.cssParsingErrors) {
return 'F';
} else if (!$scope.phantomasResults.metrics.cssRules) {
return 'NA';