diff --git a/lib/metadata/scoreProfileGeneric.json b/lib/metadata/scoreProfileGeneric.json index 55c2b9d..b1775f6 100644 --- a/lib/metadata/scoreProfileGeneric.json +++ b/lib/metadata/scoreProfileGeneric.json @@ -23,7 +23,6 @@ "label": "Bad JavaScript", "policies": { "jsErrors": 2, - "evalCalls": 1, "documentWriteCalls": 2, "consoleMessages": 0.5, "globalVariables": 0.5 diff --git a/lib/tools/phantomas/custom_modules/modules/javaScriptBottleYLT/javaScriptBottleYLT.js b/lib/tools/phantomas/custom_modules/modules/javaScriptBottleYLT/javaScriptBottleYLT.js index 36b9e20..ae459f9 100644 --- a/lib/tools/phantomas/custom_modules/modules/javaScriptBottleYLT/javaScriptBottleYLT.js +++ b/lib/tools/phantomas/custom_modules/modules/javaScriptBottleYLT/javaScriptBottleYLT.js @@ -7,11 +7,11 @@ */ /* global document: true, window: true */ -exports.version = '0.1'; +exports.version = '0.1.a'; exports.module = function(phantomas) { 'use strict'; - + phantomas.setMetric('documentWriteCalls'); //@desc number of calls to either document.write or document.writeln phantomas.setMetric('evalCalls'); // @desc number of calls to eval (either direct or via setTimeout / setInterval) @@ -25,23 +25,23 @@ exports.module = function(phantomas) { } // spy calls to eval() - phantomas.spy(window, 'eval', function(code) { + /*phantomas.spy(window, 'eval', function(code) { report('eval() called directly', phantomas.getCaller(), phantomas.getBacktrace(), 'evalCalls'); phantomas.log('eval\'ed code: ' + (code || '').substring(0, 150) + '(...)'); - }); + });*/ // spy calls to setTimeout / setInterval with string passed instead of a function - phantomas.spy(window, 'setTimeout', function(fn, interval) { + /*phantomas.spy(window, 'setTimeout', function(fn, interval) { if (typeof fn !== 'string') return; report('eval() called via setTimeout("' + fn + '")', phantomas.getCaller(), phantomas.getBacktrace(), 'evalCalls'); - }); + });*/ - phantomas.spy(window, 'setInterval', function(fn, interval) { + /*phantomas.spy(window, 'setInterval', function(fn, interval) { if (typeof fn !== 'string') return; report('eval() called via setInterval("' + fn + '")', phantomas.getCaller(), phantomas.getBacktrace(), 'evalCalls'); - }); + });*/ // spy document.write(ln) phantomas.spy(document, 'write', function(arg) {