Showing 97 of 339 total issues
Function padYAxis
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function padYAxis (graph, axis = "y", direction = "top", padding = 1) {
if(padding <= 0) {
throw new Error("Error: Graph axis padding value must be greater than 0");
}
- 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 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"
Further reading
Function nameAPICallParametersFunction
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function nameAPICallParametersFunction(contexts) {
let variation = [];
const exemplarContext = contexts[0];
for (let context of contexts) {
- 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 axisSortingParams
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function axisSortingParams(graph, yAxis) {
let params = {
units: '',
groupBy: { type: '', value: '' },
};
- 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 exportDataToWorksheet
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
var exportDataToWorksheet = function(datatype, metadata, data, format, selection) {
Function getDatasetIdentifiers
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
props, state, varSymbol, relevantMeta, encodedVarTimeIdx
Function SingleAnnualCycleGraph
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function SingleAnnualCycleGraph(props) {
function getMetadata(dataSpec) {
// Find and return metadata matching the parameters in the dataSpec:
// model_id, experiment, variable_id (supplied by parent)
// start_date, end_date, ensemble_name (chosen by this component)
- 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 hideTicksByRange
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function hideTicksByRange(graph, axis = "y", min, max) {
const oldFormatFunction = graph.axis[axis].tick.format;
const axisSeries = getDataSeriesByAxis(graph, axis);
//if a range is not supplied, generate one from the data
- 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 timestampToTimeOfYear
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function timestampToTimeOfYear(
timestamp, resolution='monthly', disambiguateYear = true
) {
const year = disambiguateYear ? ' '.concat(timestampToYear(timestamp)) : '';
const month = moment(timestamp, moment.ISO_8601).utc().format('MMMM');
- 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 DualVariableResponseGraph
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function DualVariableResponseGraph(props) {
function getMetadata() {
const {
model_id, experiment,
variable_id, meta,
- 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 getDataUnits
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function getDataUnits(data, variable_id) {
const units = data.units;
const userFriendlyUnits = getVariableOptions(variable_id, "userFriendlyUnits");
if(userFriendlyUnits) {
for(let i = 0; i < userFriendlyUnits.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"
Further reading
Function allDefinedArray
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
var allDefinedArray = function (array) {
var height = array.length;
var width = array[0].length;
for(var i = 0; i < height; i++) {
for(var j = 0; j < height; j++) {
- 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 fadeSeriesByRank
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function fadeSeriesByRank (graph, ranker) {
let rankDictionary = {};
for(let column of graph.data.columns) {
- 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 refreshValues
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
refreshValues: function () {
/*
* Source new values from the ncWMS server. Possible future breakage due to
* using layer._url and layer._map.
*/
- 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 findMatchingMetadata
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function findMatchingMetadata(example, difference, meta) {
// Given a dataset's metadata and a "difference" listing of attribute values pairs,
// returns metadata for another dataset that:
// - matches all attribute/value pairs in the "difference object"
// - matches the original dataset for any attributes not in "difference"
- 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 validateLongTermAverageData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function validateLongTermAverageData(response) {
if (_.isEmpty(response.data) || (typeof response.data === 'string')) {
throw new Error('Error: long term data unavailable for this model.');
}
for (const run in response.data) {
- 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 timeseriesToTimeseriesGraph
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function timeseriesToTimeseriesGraph(metadata, ...data) {
// blank graph data object to be populated - holds data values
// and individual-timeseries-level display options.
let c3Data = {
columns: [],
- 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"