Sfoglia il codice sorgente

Better DOM duplicated queries handling

Gaël Métais 10 anni fa
parent
commit
45a9abebe3

+ 1 - 1
app/public/scripts/resultsCtrl.js

@@ -57,7 +57,7 @@ app.controller('ResultsCtrl', function ($scope) {
         // Read all the duplicated queries and calculate a more appropriated score
         $scope.duplicatedQueriesCountAll = 0;
         if ($scope.phantomasResults.offenders.DOMqueriesDuplicated) {
-            var regex = /^{.*}: *(\d+) queries$/;
+            var regex = /\): *(\d+) queries$/;
             $scope.phantomasResults.offenders.DOMqueriesDuplicated.forEach(function(query) {
                 var regexResult = regex.exec(query);
                 if (regexResult) {

+ 1 - 8
phantomas_custom/modules/domQYLT/domQYLT.js

@@ -221,14 +221,7 @@ exports.module = function(phantomas) {
         //phantomas.log('DOM query: by %s - "%s" (using %s on context %s)', type, query, fnName, context);
         phantomas.incrMetric('DOMqueries');
 
-        var domQuery = {
-            type: type,
-            query: query,
-            fnName: fnName,
-            context: context
-        };
-
-        DOMqueries.push(JSON.stringify(domQuery));
+        DOMqueries.push(type + ' "' + query + '" with ' + fnName + ' (in context ' + context + ')');
     });
 
     phantomas.on('report', function() {