govau/performance-dashboard

View on GitHub

Showing 107 of 240 total issues

Function transformDataForPolar has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const transformDataForPolar = (config, slices) => {
  const recentSlices = [slices[slices.length - 1]];

  //
  // I have a series and the series has at least one or many data points
Severity: Minor
Found in client/src/_shared/utils/transformForHighcharts.js - About 25 mins to fix

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

Method value has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def value(prefix = nil, suffix = nil)
    if prefix.present? && suffix.present? 
      if @raw_value.present? 
        "#{prefix}#{@raw_value}#{suffix}"
      else
Severity: Minor
Found in app/models/pseudo_datapoint.rb - About 25 mins to fix

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 getWidgetOptions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const getWidgetOptions = widget => {
  let res = {};

  const { options } = widget;

Severity: Minor
Found in client/src/_shared/utils/proposedApiChanges.js - About 25 mins to fix

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 makeFact has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const makeFact = (widget, dashboard) => {
  if (__DEV__) {
    const isWidget = require('shared/redux/widgets/widgetsHelpers').isWidget;
    const isDashboard = require('shared/redux/dashboards/dashboardsHelpers')
      .isDashboard;
Severity: Minor
Found in client/src/_shared/redux/facts/factSelectors.js - About 25 mins to fix

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 mapStateToProps has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const mapStateToProps = (state, ownProps) => {
  let { widget, dashboard, slices } = ownProps;
  const {
    ui: { isHighContrastMode, viewport },
  } = state;
Severity: Minor
Found in client/src/_shared/components/chartWidget/chartWidget_container.js - About 25 mins to fix

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 formatValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const formatValue = (value, units) => {
  if (typeof value === 'undefined') {
    throw Error(
      'Group has no datapoint or value is not provided. Something is very wrong.',
    );

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 constructor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  constructor(options) {
    this.chart = options.chart;
    this.widget_id = options.widget_id;
    this.type = this.chart.type;
    this.displayRoundedData = this.chart.displayRoundedData;

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

Severity
Category
Status
Source
Language