|
@@ -39,6 +39,12 @@ var policies = {
|
|
|
"offendersTransformFn": function(offenders) {
|
|
|
return offenders.map(function(offender) {
|
|
|
var parts = /^(.*): (\d) occurrences$/.exec(offender);
|
|
|
+
|
|
|
+ if (!parts) {
|
|
|
+ debug('DOMidDuplicated offenders transform function error with "%s"', offender);
|
|
|
+ return offender;
|
|
|
+ }
|
|
|
+
|
|
|
return '<b>#' + parts[1] + '</b>: ' + parts[2] + ' occurrences';
|
|
|
});
|
|
|
}
|
|
@@ -54,6 +60,11 @@ var policies = {
|
|
|
return offenders.map(function(offender) {
|
|
|
var parts = /^"(.*)" appended to "(.*)"$/.exec(offender);
|
|
|
|
|
|
+ if (!parts) {
|
|
|
+ debug('DOMinserts offenders transform function error with "%s"', offender);
|
|
|
+ return offender;
|
|
|
+ }
|
|
|
+
|
|
|
return offendersHelpers.domPathToButton(parts[1]) + ' appended to ' + offendersHelpers.domPathToButton(parts[2]);
|
|
|
});
|
|
|
}
|
|
@@ -81,7 +92,19 @@ var policies = {
|
|
|
"message": "<p>Number of queries that return no result.</p><p>It suggests the query is not used on the page, probably because it is some dead code.</p><p>Or maybe the code is trying to find an HTML block that is not always here. Look at the JS Timeline to see if the scripts correctly figures out the HTML block is not here and immediatly stops interacting further with the DOM.</p>",
|
|
|
"isOkThreshold": 0,
|
|
|
"isBadThreshold": 100,
|
|
|
- "isAbnormalThreshold": 200
|
|
|
+ "isAbnormalThreshold": 200,
|
|
|
+ "offendersTransformFn": function(offenders) {
|
|
|
+ return offenders.map(function(offender) {
|
|
|
+ var parts = /^(.*) \(in (.*)\) using (.*)$/.exec(offender);
|
|
|
+
|
|
|
+ if (!parts) {
|
|
|
+ debug('DOMqueriesWithoutResults offenders transform function error with "%s"', offender);
|
|
|
+ return offender;
|
|
|
+ }
|
|
|
+
|
|
|
+ return '<b>' + parts[1] + '</b> (in ' + offendersHelpers.domPathToButton(parts[2]) + ') using <b>' + parts[3] + '</b>';
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
"eventsBound": {
|
|
|
"tool": "phantomas",
|