Jelajahi Sumber

Cooler on global variables, not on document.write

Gaël Métais 9 tahun lalu
induk
melakukan
53fd2e48e5
1 mengubah file dengan 4 tambahan dan 4 penghapusan
  1. 4 4
      lib/metadata/policies.js

+ 4 - 4
lib/metadata/policies.js

@@ -195,8 +195,8 @@ var policies = {
         "label": "document.write calls",
         "label": "document.write calls",
         "message": "<p>They slow down the page construction, especially if they are used to insert scripts in the page. Remove them ASAP.</p><p>If you cannot remove them because they come from a third-party script (such as ads), have a look at <a href=\"https://github.com/krux/postscribe\" target=\"_blank\">PostScribe</a>.</p>",
         "message": "<p>They slow down the page construction, especially if they are used to insert scripts in the page. Remove them ASAP.</p><p>If you cannot remove them because they come from a third-party script (such as ads), have a look at <a href=\"https://github.com/krux/postscribe\" target=\"_blank\">PostScribe</a>.</p>",
         "isOkThreshold": 0,
         "isOkThreshold": 0,
-        "isBadThreshold": 10,
-        "isAbnormalThreshold": 20,
+        "isBadThreshold": 5,
+        "isAbnormalThreshold": 10,
         "hasOffenders": true,
         "hasOffenders": true,
         "offendersTransformFn": function(offenders) {
         "offendersTransformFn": function(offenders) {
             return {
             return {
@@ -254,8 +254,8 @@ var policies = {
         "tool": "phantomas",
         "tool": "phantomas",
         "label": "Global variables",
         "label": "Global variables",
         "message": "<p>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.</p><p>Global variables also take a (very) little bit longer to be accessed than variables in the local scope of a function.</p>",
         "message": "<p>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.</p><p>Global variables also take a (very) little bit longer to be accessed than variables in the local scope of a function.</p>",
-        "isOkThreshold": 30,
-        "isBadThreshold": 150,
+        "isOkThreshold": 40,
+        "isBadThreshold": 200,
         "isAbnormalThreshold": 700,
         "isAbnormalThreshold": 700,
         "hasOffenders": true,
         "hasOffenders": true,
         "offendersTransformFn": function(offenders) {
         "offendersTransformFn": function(offenders) {