jens-ox/metrics-graphics

View on GitHub

Showing 7 of 36 total issues

File abstractChart.js has 274 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { isArrayOfArrays, isArrayOfObjectsOrEmpty, getWidth, getHeight, randomId, makeAccessorFunction } from '../misc/utility'
import { select, event } from 'd3-selection'
import Scale from '../components/scale'
import Axis from '../components/axis'
import Tooltip from '../components/tooltip'
Severity: Minor
Found in packages/lib/src/js/charts/abstractChart.js - About 2 hrs to fix

    AbstractChart has 23 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export default class AbstractChart {
      id = null
    
      // base chart fields
      data = null
    Severity: Minor
    Found in packages/lib/src/js/charts/abstractChart.js - About 2 hrs to fix

      Function mountBrush has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        mountBrush (whichBrush) {
          if (!whichBrush) return
          const brush = typeof whichBrush === 'string'
            ? whichBrush === 'x' ? brushX() : brushY()
            : d3brush()
      Severity: Minor
      Found in packages/lib/src/js/charts/abstractChart.js - About 1 hr to fix

        Function constructor has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          constructor ({
            data,
            target,
            markers,
            baselines,
        Severity: Minor
        Found in packages/lib/src/js/charts/abstractChart.js - About 1 hr to fix

          Function constructor has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

            constructor ({
              data,
              xAccessor,
              yAccessor,
              y0Accessor,
          Severity: Minor
          Found in packages/lib/src/js/components/area.js - About 55 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 normalizePoints has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

            normalizePoints ({ points, isNested, aggregate, defined = null }) {
              this.points = isNested
                ? points.map((pointArray, arrayIndex) => pointArray
                  .filter(p => !defined || defined(p))
                  .map((point, index) => ({
          Severity: Minor
          Found in packages/lib/src/js/components/delaunay.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 constructor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

            constructor ({
              data,
              xAccessor,
              yAccessor,
              xScale,
          Severity: Minor
          Found in packages/lib/src/js/components/line.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

          Severity
          Category
          Status
          Source
          Language