TargetProcess/tauCharts

View on GitHub

Showing 269 of 3,565 total issues

Function createAxis has 440 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function createAxis(config: AxisConfig) {

    const orient = Orient[config.scaleGuide.scaleOrient];
    const scale = config.scale;
    const scaleGuide = config.scaleGuide;
Severity: Major
Found in src/elements/coords.cartesian.axis.ts - About 2 days to fix

    File tau.plot.ts has 796 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import {Balloon} from '../api/balloon';
    import {Emitter, EventHandlerMap} from '../event';
    import {Plugins} from '../plugins';
    import * as utils from '../utils/utils';
    import * as utilsDom from '../utils/utils-dom';
    Severity: Major
    Found in src/charts/tau.plot.ts - About 1 day to fix

      File utils.ts has 703 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import * as d3Array from 'd3-array';
      import * as d3Scale from 'd3-scale';
      const d3 = {
          ...d3Array,
          ...d3Scale,
      Severity: Major
      Found in src/utils/utils.ts - About 1 day to fix

        Function d3Labeler has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring.
        Open

        var d3Labeler = function () {
            var lab = [],
                anc = [],
                w = 1, // box width
                h = 1, // box width
        Severity: Minor
        Found in src/utils/d3-labeler.js - About 1 day 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

        File spec-transform-auto-layout.ts has 665 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import * as utils from './utils/utils';
        import {FormatterRegistry} from './formatter-registry';
        import * as d3 from 'd3-scale';
        import {
            ChartSettings,
        Severity: Major
        Found in src/spec-transform-auto-layout.ts - About 1 day to fix

          File path-points.ts has 606 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import * as utils from '../../utils';
          import {getBezierPoint, splitCubicSegment as split} from '../bezier';
          import {Point} from '../point';
          
          interface XPoint extends Point {
          Severity: Major
          Found in src/utils/path/interpolators/path-points.ts - About 1 day to fix

            Plot has 65 functions (exceeds 20 allowed). Consider refactoring.
            Open

            export class Plot extends Emitter {
            
                protected _nodes: GrammarElement[];
                protected _svg: SVGSVGElement;
                protected _filtersStore: {
            Severity: Major
            Found in src/charts/tau.plot.ts - About 1 day to fix

              Function d3Labeler has 228 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              var d3Labeler = function () {
                  var lab = [],
                      anc = [],
                      w = 1, // box width
                      h = 1, // box width
              Severity: Major
              Found in src/utils/d3-labeler.js - About 1 day to fix

                Function scalesPool has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
                Open

                    scalesPool(scaleType: string, dimName: string, guide: ScaleGuide, settings: ChartSettings) {
                
                        var k = `${scaleType}_${dimName}`;
                
                        if (this.dist.scales.hasOwnProperty(k)) {
                Severity: Minor
                Found in src/spec-converter.ts - About 1 day 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 transform has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
                Open

                    transform(chart: Plot) {
                
                        var specRef = this.spec;
                
                        if (!this.isApplicable) {
                Severity: Minor
                Found in src/spec-transform-calc-size.ts - About 1 day 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 _drawMap has 219 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    _drawMap(frames, topoJSONData) {
                
                        var self = this;
                
                        var guide = this.config.guide;
                Severity: Major
                Found in src/elements/coords.geomap.js - About 1 day to fix

                  File coords.cartesian.axis.ts has 516 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import {defaults, take, normalizeAngle} from '../utils/utils';
                  import {selectOrAppend, classes} from '../utils/utils-dom';
                  import {cutText, wrapText, avoidTickTextCollision} from '../utils/d3-decorators';
                  import {CSS_PREFIX} from '../const';
                  import * as utilsDraw from '../utils/utils-draw';
                  Severity: Major
                  Found in src/elements/coords.cartesian.axis.ts - About 1 day to fix

                    Function sortChildren has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
                    Open

                        export function sortChildren(parent: Element, sorter: (a: Element, b: Element) => number) {
                            if (parent.childElementCount > 0) {
                    
                                // Note: move DOM elements with
                                // minimal number of iterations
                    Severity: Minor
                    Found in src/utils/utils-dom.ts - About 7 hrs 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

                    File grammar-registry.ts has 458 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import * as utils from './utils/utils';
                    import {UnitDomainPeriodGenerator} from './unit-domain-period-generator';
                    import {TauChartError as Error, errorCodes} from './error';
                    import {
                        GrammarModel,
                    Severity: Minor
                    Found in src/grammar-registry.ts - About 7 hrs to fix

                      Function buildModel has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
                      Open

                          buildModel(screenModel, {prettify, minBarH, minBarW, baseCssClass}) {
                      
                              const barSize = ((d) => {
                                  var w = screenModel.size(d);
                                  if (prettify) {
                      Severity: Minor
                      Found in src/elements/element.interval.js - About 6 hrs 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

                      File layer-labels-rules.ts has 448 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import {LayerLabelsModel, LayerLabelsModelObj} from './layer-labels-model';
                      import {ScaleFunction} from '../../definitions';
                      import {hasXOverflow, hasYOverflow} from '../../utils/utils';
                      var rules: {[alias: string]: LabelRule} = {};
                      
                      
                      Severity: Minor
                      Found in src/elements/decorators/layer-labels-rules.ts - About 6 hrs to fix

                        File element.interval.js has 446 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import {CSS_PREFIX} from '../const';
                        import {GrammarRegistry} from '../grammar-registry';
                        import {LayerLabels} from './decorators/layer-labels';
                        import {
                            d3_animationInterceptor,
                        Severity: Minor
                        Found in src/elements/element.interval.js - About 6 hrs to fix

                          File coords.geomap.js has 438 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import * as d3Array from 'd3-array';
                          import * as d3Geo from 'd3-geo';
                          import * as d3Selection from 'd3-selection';
                          import fetchJson from '../utils/fetchJson';
                          const d3 = {
                          Severity: Minor
                          Found in src/elements/coords.geomap.js - About 6 hrs to fix

                            Function value has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                            Open

                                    value: (function () {
                                        var toStr = Object.prototype.toString;
                                        var isCallable = function (fn) {
                                            return typeof fn === 'function' || toStr.call(fn) === '[object Function]';
                                        };
                            Severity: Minor
                            Found in src/utils/polyfills.js - About 6 hrs 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 getCubicSpline has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function getCubicSpline(points: Point[], limited: boolean): Point[] {
                                if (points.length < 2) {
                                    return points.slice(0);
                                }
                                if (points.length === 2) {
                            Severity: Minor
                            Found in src/utils/path/interpolators/smooth.ts - About 6 hrs 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