From 336491b54ca9f88c1f122bd37b4134fa73c1db3c Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Mon, 16 Mar 2015 00:16:36 +0100 Subject: [PATCH] Remove unused vars --- .jshintrc | 2 +- lib/cartodb/cache_validator.js | 5 ++--- lib/cartodb/cartodb_windshaft.js | 2 +- lib/cartodb/controllers/template_maps.js | 4 +--- lib/cartodb/monitoring/health_check.js | 9 ++++----- lib/cartodb/server_options.js | 6 ++---- 6 files changed, 11 insertions(+), 17 deletions(-) diff --git a/.jshintrc b/.jshintrc index 2b7a9367..4f460e41 100644 --- a/.jshintrc +++ b/.jshintrc @@ -26,7 +26,7 @@ // // "single" : require single quotes // // "double" : require double quotes "undef" : true, // true: Require all non-global variables to be declared (prevents global leaks) -// "unused" : true, // true: Require all defined variables be used + "unused" : true, // true: Require all defined variables be used // "strict" : true, // true: Requires all functions run in ES5 Strict Mode // "maxparams" : false, // {int} Max number of formal params allowed per function // "maxdepth" : false, // {int} Max depth of nested blocks (within functions) diff --git a/lib/cartodb/cache_validator.js b/lib/cartodb/cache_validator.js index b974e094..4b3f2181 100644 --- a/lib/cartodb/cache_validator.js +++ b/lib/cartodb/cache_validator.js @@ -1,6 +1,5 @@ -var _ = require('underscore'), - Varnish = require('node-varnish'), - varnish_queue = null; +var Varnish = require('node-varnish'); +var varnish_queue = null; function init(host, port, secret) { varnish_queue = new Varnish.VarnishQueue(host, port, secret); diff --git a/lib/cartodb/cartodb_windshaft.js b/lib/cartodb/cartodb_windshaft.js index 82da2d68..41255f9d 100644 --- a/lib/cartodb/cartodb_windshaft.js +++ b/lib/cartodb/cartodb_windshaft.js @@ -127,7 +127,7 @@ var CartodbWindshaft = function(serverOptions) { //console.log("Adding cache channel to route\n" + req.route.path + " not matching any in:\n" + mapCreateRoutes.join("\n")); serverOptions.addCacheChannel(that, req, this); }, - function sendResponse(err, added) { + function sendResponse(err/*, added*/) { if ( err ) console.log(err + err.stack); ws_sendResponse.apply(that, thatArgs); return null; diff --git a/lib/cartodb/controllers/template_maps.js b/lib/cartodb/controllers/template_maps.js index d6b6f528..c23d86a9 100644 --- a/lib/cartodb/controllers/template_maps.js +++ b/lib/cartodb/controllers/template_maps.js @@ -141,7 +141,6 @@ TemplateMapsController.prototype.retrieve = function(req, res) { this.app.doCORS(res); var cdbuser = this.serverOptions.userByReq(req); - var template; var tpl_id; Step( function checkPerms(){ @@ -203,7 +202,6 @@ TemplateMapsController.prototype.destroy = function(req, res) { this.app.doCORS(res); var cdbuser = this.serverOptions.userByReq(req); - var template; var tpl_id; Step( function checkPerms(){ @@ -228,7 +226,7 @@ TemplateMapsController.prototype.destroy = function(req, res) { } self.templateMaps.delTemplate(cdbuser, tpl_id, this); }, - function prepareResponse(err, tpl_val){ + function prepareResponse(err/*, tpl_val*/){ if ( err ) throw err; return { status: 'ok' }; }, diff --git a/lib/cartodb/monitoring/health_check.js b/lib/cartodb/monitoring/health_check.js index f925c616..9e239583 100644 --- a/lib/cartodb/monitoring/health_check.js +++ b/lib/cartodb/monitoring/health_check.js @@ -1,8 +1,7 @@ -var _ = require('underscore'), - dot = require('dot'), - fs = require('fs'), - path = require('path'), - Step = require('step'); +var dot = require('dot'); +var fs = require('fs'); +var path = require('path'); +var Step = require('step'); function HealthCheck(metadataBackend, tilelive) { this.metadataBackend = metadataBackend; diff --git a/lib/cartodb/server_options.js b/lib/cartodb/server_options.js index e77a544b..cf1f383c 100644 --- a/lib/cartodb/server_options.js +++ b/lib/cartodb/server_options.js @@ -573,7 +573,7 @@ module.exports = function(redisPool) { callback(new Error('Error parsing lzma as JSON: ' + err)); } }, - function(percent) { // progress + function(/*percent*/) { // progress //console.log("LZMA decompression " + percent + "%"); } ); @@ -603,7 +603,7 @@ module.exports = function(redisPool) { return; } if ( tksplit.length > 1 ) { - var template_hash = tksplit.shift(); // unused + /*var template_hash = */tksplit.shift(); // unused } req.params.token = tksplit.shift(); //console.log("Request for token " + req.params.token + " with signature from " + req.params.signer); @@ -616,8 +616,6 @@ module.exports = function(redisPool) { // for cartodb, ensure interactivity is cartodb_id or user specified req.params.interactivity = req.params.interactivity || 'cartodb_id'; - var that = this; - if (req.profiler) req.profiler.done('req2params.setup'); Step(