Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Terminate simple statements with semicolons. Remove semicolons from c…

…ompound statements.
  • Loading branch information...
commit 9dbf47934edd5ec508b24508cfb47aae1d6f6ea7 1 parent e61f0ae
coderunr coderunr authored
2  app.js
View
@@ -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;
2  app/api/app.js
View
@@ -36,7 +36,7 @@ var refreshUpCount = function(callback) {
upCount = count;
callback();
});
-}
+};
Check.on('afterInsert', function() { upCount = undefined; });
Check.on('afterRemove', function() { upCount = undefined; });
2  app/api/routes/check.js
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);
6 app/api/routes/ping.js
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) {
2  app/api/routes/tag.js
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);
2  app/dashboard/app.js
View
@@ -33,7 +33,7 @@ app.configure(function(){
} else {
return '';
}
- }
+ };
res.locals.moment = moment;
next();
});
16 fixtures/computeStats.js
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) {
2  fixtures/fixEvents.js
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();
-})
+});
10 fixtures/populate.js
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) {
2  lib/monitor.js
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) {
2  lib/pollers/http.js
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;
};
2  lib/pollers/https.js
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;
};
4 lib/qosAggregator.js
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);
2  models/check.js
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);
});
2  models/ping.js
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);
4 models/tag.js
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);
});
});
Please sign in to comment.
Something went wrong with that request. Please try again.