Function makeVariableResponseGraph
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
function makeVariableResponseGraph(x, y, graph) {
let c3Data = {};
const seriesNameContains = function (series, keyword) {
return caseInsensitiveStringSearch(series[0], keyword);
Function makeAnomalyGraph
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
function makeAnomalyGraph(base, variable_id, graph) {
//anomalies for some variables are typically expressed as percentages.
//if this is a single variable graph, check the variable configuration
//to see if this is one of them; if so, display percentages on the chart.
const displayPercent =
- 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 makeAnomalyGraph
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
function makeAnomalyGraph(base, variable_id, graph) {
//anomalies for some variables are typically expressed as percentages.
//if this is a single variable graph, check the variable configuration
//to see if this is one of them; if so, display percentages on the chart.
const displayPercent =
File chart-transformers.js
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
/************************************************************************
* chart-transformers.js - functions that accept a C3 chart specification
* for a timeseries chart and alter the data to produce a different
* type of chart.
*
Function addAnomalyTooltipFormatter
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function addAnomalyTooltipFormatter(oldFormatter, baseSeries, displayPercent) {
const newTooltipValueFormatter = function (value, ratio, id, index) {
let nominal = oldFormatter(value, ratio, id, index);
if (_.isUndefined(nominal)) {
//this series doesn't display in tooltip.
- 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 makeVariableResponseGraph
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function makeVariableResponseGraph(x, y, graph) {
let c3Data = {};
const seriesNameContains = function (series, keyword) {
return caseInsensitiveStringSearch(series[0], keyword);
- 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 makeTimeSliceGraph
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function makeTimeSliceGraph(timestamp, graph) {
let slicedData = [];
let timestamps = [];
let sliceIndex = -1;
Function makeTimeSliceGraph
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function makeTimeSliceGraph(timestamp, graph) {
let slicedData = [];
let timestamps = [];
let sliceIndex = -1;
- 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"