Showing 97 of 339 total issues
Function dataToGraphSpec
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function dataToGraphSpec(meta, data) {
// Convert `data` (described by `meta`) to a graph specification compatible
// with `DataGraph`.
let graph = timeseriesToAnnualCycleGraph(meta, ...data);
Function PercentileLongTermAveragesGraph
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function PercentileLongTermAveragesGraph(props) {
function getMetadata(timeOfYear) {
// get a list of all available percentiles
function parsePercentile(metad) {
Function SingleContextGraph
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function SingleContextGraph(props) {
function getMetadata() {
const {
ensemble_name, experiment, variable_id, area, contextMeta, model_id
} = props;
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 refreshValues
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
refreshValues: function () {
/*
* Source new values from the ncWMS server. Possible future breakage due to
* using layer._url and layer._map.
*/
Function render
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const faqs = T.get(this.context, 'help.faq.items');
if (!_.isArray(faqs)) {
return null;
Function shortestUniqueTimeseriesNamingFunction
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function shortestUniqueTimeseriesNamingFunction(metadata, data) {
if (metadata.length === 0) {
throw new Error('No data to show');
}
Function render
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<Panel>
<Panel.Heading>
<Panel.Title>
Function generateDataCellsFromC3Graph
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
var generateDataCellsFromC3Graph = function(graph, seriesLabel="Time Series", variable="") {
var headers = [];
var rows = [];
var column_labels = [seriesLabel];
Function fillContainer
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
fillContainer: function () {
Object.assign(this.container.style, {
position: 'relative',
width: this.options.width + 'px',
height: this.options.height + 'px',
Function allDefinedObject
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
var allDefinedObject = function (obj) {
for(let att in obj) {
if(typeof obj[att] == "undefined") {
return false;
}
- 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 getAllTimestamps
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function getAllTimestamps(data) {
let allTimes = [];
const addSeries = function (seriesData) {
for (let timestamp in seriesData) {
- 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 timeseriesToAnnualCycleGraph
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function timeseriesToAnnualCycleGraph(metadata, ...data) {
// blank graph data object to be populated - holds data values
// and individual-timeseries-level display options.
let c3Data = {
columns: [],
Function onAdd
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
onAdd: function () {
// Container element
this.container = L.DomUtil.create('div', 'leaflet-control');
Object.assign(this.container.style, {
Function getData
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
getData: function (props) {
if(this.multiYearMeanSelected(props)) { //load Annual Cycle graph
this.setAnnualCycleGraphNoDataMessage("Loading Data");
var monthlyMetadata = _.find(props.meta,{
Function DualVariableResponseGraph
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function DualVariableResponseGraph(props) {
function getMetadata() {
const {
model_id, experiment,
variable_id, meta,
Function DualTimeSeriesGraph
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function DualTimeSeriesGraph(props) {
function getMetadata() {
const {
model_id, experiment,
variable_id, meta,
Function refreshValues
has a Cognitive Complexity of 12 (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 makeTimeSliceGraph
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function makeTimeSliceGraph (timestamp, graph) {
let slicedData = [];
let timestamps = [];
let sliceIndex = -1;
Function loadMap
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
loadMap(
props,
dataSpec,
newVariable = false,
newComparand = false