TargetProcess/tauCharts

View on GitHub

Showing 269 of 3,565 total issues

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

function getCubicInterpolator(pointsFrom: XPoint[], pointsTo: XPoint[]) {

    for (var i = 2; i < pointsFrom.length - 1; i += 3) {
        pointsFrom[i - 1].isCubicControl = true;
        pointsFrom[i].isCubicControl = true;
Severity: Minor
Found in src/utils/path/interpolators/path-points.ts - 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 value has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        value: function (predicate) {
            if (this == null) {
                throw new TypeError('Array.prototype.find called on null or undefined');
            }
            if (typeof predicate !== 'function') {
Severity: Minor
Found in src/utils/polyfills.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 _enableBrushing has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    _enableBrushing(cols) {

        const brushWidth = 16;

        var columnsSelections = this.columnsSelections;
Severity: Minor
Found in src/elements/coords.parallel.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 create has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    create(interval) {

        const gen = this.periodGenerator;

        var varSet = this.vars;
Severity: Minor
Found in src/scales/period.ts - 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 alignByX has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

var alignByX = (exp) => {
    return (prev) => {
        return {
            dx: (row) => {

Severity: Minor
Found in src/elements/decorators/layer-labels-rules.ts - 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 alignByY has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

var alignByY = (exp) => {
    return (prev) => {
        return {
            dy: (row) => {

Severity: Minor
Found in src/elements/decorators/layer-labels-rules.ts - 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 setScrollPadding has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    export function setScrollPadding(el: HTMLElement, direction?: 'horizontal' | 'vertical' | 'both') {
        direction = direction || 'both';
        var isBottom = direction === 'horizontal' || direction === 'both';
        var isRight = direction === 'vertical' || direction === 'both';

Severity: Minor
Found in src/utils/utils-dom.ts - 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 _handlePointerEvent has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    _handlePointerEvent(event: MouseEvent) {
        // TODO: Highlight API seems not consistent.
        // Just predicate is not enough, also
        // need coordinates or event object.
        const svgRect = this._svg.getBoundingClientRect();
Severity: Minor
Found in src/charts/tau.plot.ts - 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 getClosestElement has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    getClosestElement(this: PointInstance, _cursorX, _cursorY) {
        if (!this._boundsInfo) {
            return null;
        }
        const {bounds, tree} = this._boundsInfo;
Severity: Minor
Found in src/elements/element.point.ts - 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 calcXYGuide has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    guide: UnitGuide,
    settings: ChartSettings,
    xMeta,
    yMeta,
    inlineLabels?: boolean,
Severity: Minor
Found in src/spec-transform-auto-layout.ts - About 45 mins to fix

    Function getCirclesCurveTangents has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    function getCirclesCurveTangents(a: Point, ca: Point, cb: Point, b: Point) {
        var d = dist(a, b);
        if (d === 0 ||
            (d + a.size / 2 <= b.size / 2) ||
            (d + b.size / 2 <= a.size / 2)
    Severity: Minor
    Found in src/utils/path/svg/brush-line.ts - About 45 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 d3_transition_attr has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    var d3_transition_attr = function (keyOrMap, value) {
        var d3AttrResult = d3.transition.prototype.attr.apply(this, arguments);
    
        if (arguments.length === 0) {
            throw new Error('Unexpected `transition().attr()` arguments.');
    Severity: Minor
    Found in src/utils/d3-decorators.js - About 45 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 calcUnitGuide has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    var calcUnitGuide = function ({unit, meta, settings, allowXVertical, allowYVertical, inlineLabels}: CalcUnitArgs) {
    
        var dimX = meta.dimension(unit.x);
        var dimY = meta.dimension(unit.y);
    
    
    Severity: Minor
    Found in src/spec-transform-auto-layout.ts - About 45 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

    Avoid deeply nested control flow statements.
    Open

                        if ((p1.y - c0.y) * (c3.y - p1.y) <= 0) {
                            tan = 0;
                        } else {
                            if (p1.y > c0.y === c2y > c3.y) {
                                kl = ((c3.y - p1.y) / (c2y - p1.y));
    Severity: Major
    Found in src/utils/path/interpolators/smooth.ts - About 45 mins to fix

      Function getScaleDiffFn has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function getScaleDiffFn(points1, points2) {
      
          // Find remaining points with predictable position
          var src = [];
          var dst = [];
      Severity: Minor
      Found in src/utils/path/interpolators/path-points.ts - About 45 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 ruleExtractAxes has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          ruleExtractAxes(spec: GPLSpec) {
      
              var isCoordsRect = (unitRef: Unit) => {
                  return (unitRef.type === 'COORDS.RECT' || unitRef.type === 'RECT');
              };
      Severity: Minor
      Found in src/spec-transform-extract-axes.ts - About 45 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 getInnerInterpolator has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function getInnerInterpolator({polylineFrom, polylineTo, isCubic}) {
      
          var oldCount = polylineFrom.length;
          var newCount = polylineTo.length;
      
      
      Severity: Minor
      Found in src/utils/path/interpolators/path-points.ts - About 45 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

      Avoid deeply nested control flow statements.
      Open

                              if (source.hasOwnProperty(nextKey)) {
                                  output[nextKey] = source[nextKey];
                              }
      Severity: Major
      Found in src/utils/polyfills.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                for (i = 0; i < arguments.length; i++) {
                                    args.push(arguments[i]);
                                }
        Severity: Major
        Found in src/event.ts - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                      if (h.from >= g.to && h.from < g.from) {
                                          h.from++;
                                      }
          Severity: Major
          Found in src/utils/utils-dom.ts - About 45 mins to fix
            Severity
            Category
            Status
            Source
            Language