app/assets/javascripts/tango_status.js
Function plotEventDrops
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var plotEventDrops = function(data) {
var minDates = jQuery.map(data, function(h) {
return Math.min.apply(null, h['dates']);
});
var startTime = new Date(Math.min.apply(null, minDates));
Function plotEventDrops
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
var plotEventDrops = function(data) {
var minDates = jQuery.map(data, function(h) {
return Math.min.apply(null, h['dates']);
});
var startTime = new Date(Math.min.apply(null, minDates));
- 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 plotTimeSeries
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var plotTimeSeries = function(data) {
// Initialize Dataset
var new_jobs = data[0];
var eventarr = [];
for (var i = 0; i < new_jobs.dates.length; i++) {
Function plot_diagram
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var plot_diagram = function(pool) {
current_plot = pool;
var title = "Job Runtime History for ";
title += pool == '' ? "Global" : pool;
MG.data_graphic({
Function plotTimeSeries
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
var plotTimeSeries = function(data) {
// Initialize Dataset
var new_jobs = data[0];
var eventarr = [];
for (var i = 0; i < new_jobs.dates.length; i++) {
- 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"