Fix various warnings found by scrutinity

- Some functions didn't return anything
- Some `for…in` related variables weren't declared
- Some variables were unused
main
jvoisin 8 years ago
parent c9c09da89e
commit 03d649b3ea

@ -54,7 +54,7 @@
firstRun = true; firstRun = true;
// Set defaults // Set defaults
for ( option in defaults ) { for ( var option in defaults ) {
localStorage[option] = defaults[option]; localStorage[option] = defaults[option];
} }
} else if ( version !== localStorage['version'] && parseInt(localStorage['upgradeMessage'], 10) ) { } else if ( version !== localStorage['version'] && parseInt(localStorage['upgradeMessage'], 10) ) {
@ -189,7 +189,7 @@
if ( count > 0 ) { if ( count > 0 ) {
// Find the main application to display // Find the main application to display
var i, appName, found = false; var appName, found = false;
w.driver.categoryOrder.forEach(function(match) { w.driver.categoryOrder.forEach(function(match) {
for ( appName in w.detected[url] ) { for ( appName in w.detected[url] ) {

@ -15,9 +15,9 @@ document.addEventListener('DOMContentLoaded', function() {
}, },
load: function() { load: function() {
for ( option in options.opts ) { for ( var option in options.opts ) {
if ( value = localStorage[option] ) { if ( localStorage[option] ) {
options.opts[option] = value; options.opts[option] = localStorage[option];
} }
} }

@ -1,11 +1,7 @@
(function() { (function() {
var lastEnv = [];
try { try {
if ( document && document.contentType === 'text/html' ) { if ( document && document.contentType === 'text/html' ) {
var var html = new XMLSerializer().serializeToString(document),
html = new XMLSerializer().serializeToString(document),
env = []; // TODO: Remove, `env` not used in this scope?
self.port.emit('log', html); self.port.emit('log', html);

@ -54,7 +54,7 @@
firstRun = true; firstRun = true;
// Set defaults // Set defaults
for ( option in defaults ) { for ( var option in defaults ) {
localStorage[option] = defaults[option]; localStorage[option] = defaults[option];
} }
} else if ( version !== localStorage['version'] && parseInt(localStorage['upgradeMessage'], 10) ) { } else if ( version !== localStorage['version'] && parseInt(localStorage['upgradeMessage'], 10) ) {
@ -195,7 +195,7 @@
if ( count > 0 ) { if ( count > 0 ) {
// Find the main application to display // Find the main application to display
var i, appName, found = false; var appName, found = false;
w.driver.categoryOrder.forEach(function(match) { w.driver.categoryOrder.forEach(function(match) {
for ( appName in w.detected[url] ) { for ( appName in w.detected[url] ) {

@ -112,8 +112,6 @@ var exports = {};
try { try {
dict[key] = window.decodeURIComponent(val); dict[key] = window.decodeURIComponent(val);
} catch (e) { } catch (e) {
continue;
} }
} }
return dict; return dict;
@ -307,6 +305,7 @@ var exports = {};
return div; return div;
} }
} }
return null;
}; };
TopSearcher.prototype._jumpedOut = function(el) { TopSearcher.prototype._jumpedOut = function(el) {
@ -988,6 +987,7 @@ var exports = {};
} }
} }
} }
return null;
} }
function onPostMessage(event) { function onPostMessage(event) {

@ -242,7 +242,7 @@ var wappalyzer = (function() {
*/ */
analyze: function(hostname, url, data) { analyze: function(hostname, url, data) {
var var
i, j, app, confidence, type, regexMeta, regexScript, match, content, meta, header, version, id, i, app, confidence, type, regexMeta, regexScript, match, content, meta, header, version, id,
profiler = new Profiler(), profiler = new Profiler(),
apps = {}, apps = {},
excludes = [], excludes = [],

Loading…
Cancel
Save