Showing 25 of 1,086 total issues
Function getRoutes
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports = module.exports.getRoutes = function (){
var PREFIX_PING_PLUGIN = 'watchmen-ping-';
var router = express.Router();
Function enableUI
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function enableUI() {
var i,
el,
ithSorter = function ithSorter(i) {
var col = cols[i];
Function exports
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
exports = module.exports = (function(){
var DEFAULT_TARGET_UPTIME = 0.99;
var DEFAULT_TARGET_WARNING_PERCENTAGE = 0.02;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getUptime
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function getUptime (service, outages, currentOutage, since) {
var totalDownTime = 0;
var now = +new Date();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getRoutes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
module.exports.getRoutes = function (storage) {
if (!storage) {
throw new Error('storage needed');
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"