TargetProcess/tauCharts

View on GitHub

Showing 269 of 3,565 total issues

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

        getHighlightAttrs: function (node, model, filter) {
            const config = node.config;
            const guide = config.guide;
            const screenModel = node.screenModel;
            const showOnHover = node.config.guide.showAnchors === 'hover';
Severity: Minor
Found in src/elements/decorators/anchors.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 _expandUnitsStructure has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    _expandUnitsStructure(root: Unit, parentPipe: DataFilter[] = []) {

        var self = this;

        if (root.expression.operator === false) {
Severity: Minor
Found in src/charts/tau.gpl.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

                        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.from && h.from <= g.to) {
                                    h.from--;
                                }
    Severity: Major
    Found in src/utils/utils-dom.ts - About 45 mins to fix

      Function cross_period has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              dataFn: () => any[],
              dimX: string,
              dimY: string,
              xPeriod: string,
              yPeriod: string,
      Severity: Minor
      Found in src/algebra.ts - About 45 mins to fix

        Consider simplifying this complex logical expression.
        Open

                if (
                    (!isAuto && config.guide.x.fillGaps) ||
                    (isAuto && (isStack || (xPeriod && isYValue)))
                ) {
                    return GrammarRegistry.get('fillGaps')(model, {
        Severity: Major
        Found in src/utils/utils-grammar.ts - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

                      if (firstUnit.type === 'ELEMENT.INTERVAL' &&
                          (prop === 'y') === Boolean(firstUnit.flip) &&
                          firstUnit.label &&
                          !chart.getScaleInfo(firstUnit.label, frame).isEmpty()
                      ) {
          Severity: Major
          Found in src/spec-transform-calc-size.ts - About 40 mins to fix

            Function splitCubicSegment has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            export function splitCubicSegment(t: number, p0: Point, c0: Point, c1: Point, p1: Point) {
            Severity: Minor
            Found in src/utils/path/bezier.ts - About 35 mins to fix

              Function splitCurveSegment has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function splitCurveSegment(t: number, p0: Point, c0: Point, c1: Point, p1: Point) {
              Severity: Minor
              Found in src/utils/path/svg/brush-line.ts - About 35 mins to fix

                Function getStepLine has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                export function getStepLine(points: Point[]) {
                    var result: Point[] = [];
                    var hasId = (points[0].id !== undefined);
                    var hasSize = (points[0].size !== undefined);
                    for (var i = 1, p0, p1, m0, m1; i < points.length; i++) {
                Severity: Minor
                Found in src/utils/path/interpolators/step.ts - About 35 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 getStepAfterLine has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                export function getStepAfterLine(points: Point[]) {
                    var result: Point[] = [];
                    var hasId = (points[0].id !== undefined);
                    var hasSize = (points[0].size !== undefined);
                    for (var i = 1, p0, p1, m; i < points.length; i++) {
                Severity: Minor
                Found in src/utils/path/interpolators/step.ts - About 35 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 fetchJson has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                export default function fetchJson(url, callback) {
                    const req = new XMLHttpRequest();
                    req.onload = () => {
                        if (req.status >= 200 && req.status < 300) {
                            const text = req.responseText;
                Severity: Minor
                Found in src/utils/fetchJson.js - About 35 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 start has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    start(nIterations) {
                        // main simulated annealing function
                        var ti = 1.0;
                        const t0 = 1.0;
                        const itemsLength = this.items.length;
                Severity: Minor
                Found in src/elements/decorators/layer-labels-annealing-simulator.js - About 35 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 getStepBeforeLine has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                export function getStepBeforeLine(points: Point[]) {
                    var result: Point[] = [];
                    var hasId = (points[0].id !== undefined);
                    var hasSize = (points[0].size !== undefined);
                    for (var i = 1, p0, p1, m; i < points.length; i++) {
                Severity: Minor
                Found in src/utils/path/interpolators/step.ts - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    create(interval: [number, number]) {
                
                        var props = this.scaleConfig;
                        var varSet = this.vars;
                
                
                Severity: Minor
                Found in src/scales/ordinal.ts - About 35 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 ChartParallel has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                const ChartParallel = (config: ParallelConfig) => {
                
                    var guide = Object.assign({columns: {}}, (config.guide as ChartConfig) || {});
                
                    var scales = {};
                Severity: Minor
                Found in src/api/chart-parallel.ts - About 35 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 ChartMap has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                const ChartMap = (config: MapConfig) => {
                    let guide = Object.assign({sourcemap: config.settings.defaultSourceMap}, (<MapGuide>config.guide) || {});
                
                    guide.size = utils.defaults(guide.size || {}, {min: 1, max: 10});
                    guide.code = utils.defaults(guide.code || {}, {georole: 'countries'});
                Severity: Minor
                Found in src/api/chart-map.ts - About 35 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 getHighlightAttrs has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                        getHighlightAttrs: function (node, model, filter) {
                            const config = node.config;
                            const guide = config.guide;
                            const screenModel = node.screenModel;
                            const showOnHover = node.config.guide.showAnchors === 'hover';
                Severity: Minor
                Found in src/elements/decorators/anchors.ts - About 35 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 _getBoundsInfo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    _getBoundsInfo(this: GrammarElement, dots: Element[]) {
                        if (dots.length === 0) {
                            return null;
                        }
                
                
                Severity: Minor
                Found in src/elements/element.area.ts - About 35 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 x-num-auto has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    'x-num-auto': function (x) {
                        if (isNaN(x)) {
                            return 'NaN';
                        }
                        var abs = Math.abs(x);
                Severity: Minor
                Found in src/formatter-registry.ts - About 35 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