|
@@ -75,7 +75,8 @@ app.controller('ResultsCtrl', function ($scope) {
|
|
jQueryLoading: getJQueryLoadingScore(),
|
|
jQueryLoading: getJQueryLoadingScore(),
|
|
cssComplexity: getCSSComplexityScore(),
|
|
cssComplexity: getCSSComplexityScore(),
|
|
badCss: getBadCssScore(),
|
|
badCss: getBadCssScore(),
|
|
- requests: requestsScore()
|
|
|
|
|
|
+ requests: requestsScore(),
|
|
|
|
+ network: networkScore()
|
|
};
|
|
};
|
|
}
|
|
}
|
|
|
|
|
|
@@ -373,6 +374,32 @@ app.controller('ResultsCtrl', function ($scope) {
|
|
return note;
|
|
return note;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function networkScore() {
|
|
|
|
+ var note = 'A';
|
|
|
|
+ var score = $scope.phantomasResults.metrics.notFound * 25 +
|
|
|
|
+ $scope.phantomasResults.metrics.closedConnections * 10 +
|
|
|
|
+ $scope.phantomasResults.metrics.cachingDisabled * 2 +
|
|
|
|
+ $scope.phantomasResults.metrics.cachingNotSpecified +
|
|
|
|
+ $scope.phantomasResults.metrics.cachingTooShort / 2 +
|
|
|
|
+ $scope.phantomasResults.metrics.domains;
|
|
|
|
+ if (score > 20) {
|
|
|
|
+ note = 'B';
|
|
|
|
+ }
|
|
|
|
+ if (score > 40) {
|
|
|
|
+ note = 'C';
|
|
|
|
+ }
|
|
|
|
+ if (score > 60) {
|
|
|
|
+ note = 'D';
|
|
|
|
+ }
|
|
|
|
+ if (score > 80) {
|
|
|
|
+ note = 'E';
|
|
|
|
+ }
|
|
|
|
+ if (score > 100) {
|
|
|
|
+ note = 'F';
|
|
|
|
+ }
|
|
|
|
+ return note;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
function parseBacktrace(str) {
|
|
function parseBacktrace(str) {
|