From 53fd2e48e50756835dcdfc9b599252a5463f6718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20M=C3=A9tais?= Date: Fri, 11 Sep 2015 10:23:13 +0200 Subject: [PATCH] Cooler on global variables, not on document.write --- lib/metadata/policies.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/metadata/policies.js b/lib/metadata/policies.js index 213cad0..96cfee3 100644 --- a/lib/metadata/policies.js +++ b/lib/metadata/policies.js @@ -195,8 +195,8 @@ var policies = { "label": "document.write calls", "message": "

They slow down the page construction, especially if they are used to insert scripts in the page. Remove them ASAP.

If you cannot remove them because they come from a third-party script (such as ads), have a look at PostScribe.

", "isOkThreshold": 0, - "isBadThreshold": 10, - "isAbnormalThreshold": 20, + "isBadThreshold": 5, + "isAbnormalThreshold": 10, "hasOffenders": true, "offendersTransformFn": function(offenders) { return { @@ -254,8 +254,8 @@ var policies = { "tool": "phantomas", "label": "Global variables", "message": "

It is a bad practice because they clutter up the global namespace. If two scripts use the same variable name in the global scope, it can cause conflicts and it is generally hard to debug.

Global variables also take a (very) little bit longer to be accessed than variables in the local scope of a function.

", - "isOkThreshold": 30, - "isBadThreshold": 150, + "isOkThreshold": 40, + "isBadThreshold": 200, "isAbnormalThreshold": 700, "hasOffenders": true, "offendersTransformFn": function(offenders) {