Small adjustments in notations
This commit is contained in:
@@ -93,7 +93,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div ng-class="notations.badPractices">{{notations.badPractices}}</div>
|
||||
<div ng-class="notations.jsBadPractices">{{notations.jsBadPractices}}</div>
|
||||
<div class="notation">Bad Javascript</div>
|
||||
<div class="criteria">
|
||||
<ul>
|
||||
@@ -109,12 +109,15 @@
|
||||
<li ng-if="phantomasResults.metrics.consoleMessages">
|
||||
Console messages: {{phantomasResults.metrics.consoleMessages}}
|
||||
</li>
|
||||
<li ng-if="phantomasResults.metrics.globalVariables">
|
||||
Global variables: {{phantomasResults.metrics.globalVariables}}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div ng-class="notations.scripts">{{notations.scripts}}</div>
|
||||
<div class="notation">Scripts loaded</div>
|
||||
<div class="notation">JS files loaded</div>
|
||||
<div class="criteria">
|
||||
<ul>
|
||||
<li ng-if="phantomasResults.metrics.jsCount">
|
||||
@@ -186,7 +189,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<div ng-class="notations.cssCount">{{notations.cssCount}}</div>
|
||||
<div class="notation">CSS loaded</div>
|
||||
<div class="notation">CSS files loaded</div>
|
||||
<div class="criteria">
|
||||
<ul>
|
||||
<li ng-if="phantomasResults.metrics.cssCount">
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user