Permalink
Browse files

Terminate simple statements with semicolons. Remove semicolons from c…

…ompound statements.
  • Loading branch information...
1 parent e61f0ae commit 9dbf47934edd5ec508b24508cfb47aae1d6f6ea7 @coderunr coderunr committed Jan 12, 2013
View
2 app.js
@@ -96,7 +96,7 @@ io.sockets.on('connection', function(socket) {
fs.exists('./plugins/index.js', function(exists) {
if (exists) {
require('./plugins').init(app, io, config, mongoose);
- };
+ }
});
var port = process.env.PORT || config.server.port;
View
@@ -36,7 +36,7 @@ var refreshUpCount = function(callback) {
upCount = count;
callback();
});
-}
+};
Check.on('afterInsert', function() { upCount = undefined; });
Check.on('afterRemove', function() { upCount = undefined; });
View
@@ -48,7 +48,7 @@ module.exports = function(app) {
req.check = check;
next();
});
- }
+ };
app.get('/checks/:id', loadCheck, function(req, res, next) {
res.json(req.check);
View
@@ -62,13 +62,13 @@ module.exports = function(app) {
Check.findById(req.body.checkId, function(err1, check) {
if (err1) {
return res.send(err1.message, 500);
- };
+ }
if (!check) {
return rest.send('Error: No existing check with id ' + req.body.checkId, 403);
- };
+ }
if (!check.needsPoll) {
return res.send('Error: This check was already polled. No ping was created', 403);
- };
+ }
var status = req.body.status === 'true';
Ping.createForCheck(status, req.body.timestamp, req.body.time, check, req.body.name, req.body.error, function(err2, ping) {
if (err2) {
View
@@ -30,7 +30,7 @@ module.exports = function(app) {
req.tag = tag;
next();
});
- }
+ };
app.get('/tags/:name', loadTag, function(req, res, next) {
res.json(req.tag);
View
@@ -33,7 +33,7 @@ app.configure(function(){
} else {
return '';
}
- }
+ };
res.locals.moment = moment;
next();
});
View
@@ -13,14 +13,14 @@ var emptyStats = function(callback) {
if (!checks.length) return callback(new Error('No check in database, please use the populate script first'));
async.forEach(checks, function(check, cb) { check.removeStats(cb); }, callback);
});
-}
+};
var updateUptime = function(callback) {
console.log('Updating uptime');
Check.find({}, function(err, checks) {
async.forEach(checks, function(check, cb) { check.updateUptime(cb); }, callback);
});
-}
+};
var updateHourlyQosSinceTheFirstPing = function(callback) {
Ping
@@ -43,7 +43,7 @@ var updateHourlyQosSinceTheFirstPing = function(callback) {
callback
);
});
-}
+};
var updateDailyQosSinceTheFirstPing = function(callback) {
Ping
@@ -62,7 +62,7 @@ var updateDailyQosSinceTheFirstPing = function(callback) {
callback
);
});
-}
+};
var updateMonthlyQosSinceTheFirstPing = function(callback) {
Ping
@@ -83,7 +83,7 @@ var updateMonthlyQosSinceTheFirstPing = function(callback) {
callback
);
});
-}
+};
var updateYearlyQosSinceTheFirstPing = function(callback) {
Ping
@@ -104,17 +104,17 @@ var updateYearlyQosSinceTheFirstPing = function(callback) {
callback
);
});
-}
+};
var updateLastDayQos = function(callback) {
console.log('Updating last day Qos for all checks');
QosAggregator.updateLast24HoursQos(callback);
-}
+};
var ensureTagsHaveFirstTestedDate = function(callback) {
console.log('Updating tags for firstTested date');
Tag.ensureTagsHaveFirstTestedDate(callback);
-}
+};
async.series([emptyStats, updateUptime, updateHourlyQosSinceTheFirstPing, updateDailyQosSinceTheFirstPing, updateMonthlyQosSinceTheFirstPing, updateYearlyQosSinceTheFirstPing, updateLastDayQos, ensureTagsHaveFirstTestedDate], function(err) {
if (err) {
View
@@ -30,4 +30,4 @@ Event.find({ message: { $exists: false }}).each(function(err, event) {
if (!event) process.exit();
event.message = event.isGoDown ? 'down' : 'up';
event.save();
-})
+});
View
@@ -12,7 +12,7 @@ var removeChecks = function(callback) {
function(cb) { CheckEvent.collection.remove(cb); },
function(cb) { Check.collection.remove(cb); },
], callback);
-}
+};
var createFixtureChecks = function(callback) {
async.parallel([
@@ -22,7 +22,7 @@ var createFixtureChecks = function(callback) {
function(cb) { createDummyCheck(80, 'My Unstable Site', ['average', 'all'], cb); },
function(cb) { createDummyCheck(70, 'The lousy site I built for Al', ['low', 'all'], cb); },
], callback);
-}
+};
var createDummyCheck = function(quality, name, tags, callback) {
console.log('Creating check "' + name + '"');
@@ -34,7 +34,7 @@ var createDummyCheck = function(quality, name, tags, callback) {
tags: tags || ['all']
});
check.save(callback);
-}
+};
var createFixturePings = function(callback) {
Check.find({}, function(err, checks) {
@@ -58,13 +58,13 @@ var createFixturePings = function(callback) {
nbPings++;
if (nbPings % 288 == 0) {
console.log(new Date(date) + ' Created pings for check "' + check.name + '"');
- };
+ }
},
callme
);
}, callback);
});
-}
+};
async.series([removeChecks, createFixtureChecks, createFixturePings], function(err) {
if (err) {
View
@@ -142,7 +142,7 @@ Monitor.prototype.createPing = function(check, error, timestamp, time, callback)
options.headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': postData.length
- }
+ };
var self = this;
var req = http.request(options, function(res) {
if (res.statusCode != 200) {
View
@@ -40,7 +40,7 @@ HttpPoller.prototype.initialize = function() {
HttpPoller.prototype.setUserAgent = function(userAgent) {
if (typeof this.target.headers == 'undefined') {
this.target.headers = {};
- };
+ }
this.target.headers['User-Agent'] = userAgent;
};
View
@@ -39,7 +39,7 @@ HttpsPoller.prototype.initialize = function() {
HttpsPoller.prototype.setUserAgent = function(userAgent) {
if (typeof this.target.headers == 'undefined') {
this.target.headers = {};
- };
+ }
this.target.headers['User-Agent'] = userAgent;
};
View
@@ -325,7 +325,7 @@ QosAggregator.prototype.createCheckDailyStats = function(documents, callback) {
count: document.count,
responsiveness: document.responsiveness,
responseTime: document.responseTime,
- }
+ };
var intervalBuilder = new IntervalBuilder();
intervalBuilder.addTarget(document._id);
intervalBuilder.build(document.start, document.end, function(err, outages, downtime) {
@@ -381,7 +381,7 @@ QosAggregator.prototype.createTagDailyStats = function(documents, callback) {
count: document.count,
responsiveness: document.responsiveness,
responseTime: document.responseTime,
- }
+ };
var intervalBuilder = new IntervalBuilder();
Check.findForTag(document._id, function(err, checks) {
if (err) return next(err);
View
@@ -223,7 +223,7 @@ Check.methods.getStatsForPeriod = function(period, begin, end, callback) {
outages: stat.outages || [],
end: stat.end ? stat.end.valueOf() : (Date.parse(stat.timestamp) + periodPrefs['duration'])
});
- };
+ }
}).on('close', function() {
callback(null, stats);
});
View
@@ -38,7 +38,7 @@ Ping.statics.createForCheck = function(status, timestamp, time, check, monitorNa
if (!status) {
ping.downtime = check.interval || 60000;
ping.error = error;
- };
+ }
ping.save(function(err1) {
if (err1) return callback(err1);
check.setLastTest(status, timestamp, error);
View
@@ -134,7 +134,7 @@ Tag.methods.getChecksForPeriod = function(period, date, callback) {
var ids = [];
res.forEach(function(doc) {
ids.push(doc._id);
- })
+ });
var query = { check: { $in: ids }, timestamp: { $gte: begin, $lte: end } };
var stream = self.db.model(periodPrefs['model']).find(query).populate('check').stream();
stream
@@ -157,7 +157,7 @@ Tag.methods.getChecksForPeriod = function(period, date, callback) {
checkNames.sort();
checkNames.forEach(function(checkName) {
orderedStats.push(stats[checkName]);
- })
+ });
callback(null, orderedStats);
});
});

0 comments on commit 9dbf479

Please sign in to comment.