TargetProcess/tauCharts

View on GitHub

Showing 269 of 3,565 total issues

Function calcSizeRecursively has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        var calcSizeRecursively = (
            prop: 'x' | 'y',
            root: Unit,
            takeStepSizeStrategy: StepSizeStrategy,
            frame: DataFrameObject = null
Severity: Major
Found in src/spec-transform-calc-size.ts - About 2 hrs to fix

    Function getTestWebpackConfig has 67 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function getTestWebpackConfig(DEBUG) {
    
        const path = require('path');
        const webpack = require('webpack');
    
    
    Severity: Major
    Found in karma.conf.js - About 2 hrs to fix

      Function getLinePiece has 67 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var result = (function getLinePiece(t, line) {
              var pointsCount = (line.length - 1) / 3 + 1;
              var q = 0;
              if (t > 0) {
                  var distance = [0];
      Severity: Major
      Found in src/utils/path/interpolators/path-points.ts - About 2 hrs to fix

        Function ruleExtractAxes has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            ruleExtractAxes(spec: GPLSpec) {
        
                var isCoordsRect = (unitRef: Unit) => {
                    return (unitRef.type === 'COORDS.RECT' || unitRef.type === 'RECT');
                };
        Severity: Major
        Found in src/spec-transform-extract-axes.ts - About 2 hrs to fix

          Function buildModel has 66 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              buildModel(screenModel, {prettify, minBarH, minBarW, baseCssClass}) {
          
                  const barSize = ((d) => {
                      var w = screenModel.size(d);
                      if (prettify) {
          Severity: Major
          Found in src/elements/element.interval.js - About 2 hrs to fix

            Function getClosestElement has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

                getClosestElement(_cursorX, _cursorY) {
                    if (!this._boundsInfo) {
                        return null;
                    }
                    const {bounds, tree} = this._boundsInfo;
            Severity: Minor
            Found in src/elements/element.interval.js - About 2 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 ChartLine has 64 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const ChartLine = (rawConfig: ChartConfig) => {
                var config = normalizeConfig(rawConfig);
            
                var data = config.data;
            
            
            Severity: Major
            Found in src/api/chart-line.ts - About 2 hrs to fix

              Function _calcLabels has 63 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _calcLabels(topoJSONData, reverseContours, path) {
              
                      var innerW = this.W;
                      var innerH = this.H;
              
              
              Severity: Major
              Found in src/elements/coords.geomap.js - About 2 hrs to fix

                Function BUILD-LABELS has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    'BUILD-LABELS': (srcSpec, meta) => {
                
                        var spec = utils.clone(srcSpec);
                
                        var xLabels = [];
                Severity: Major
                Found in src/spec-transform-auto-layout.ts - About 2 hrs to fix

                  Function _enableBrushing has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      _enableBrushing(cols) {
                  
                          const brushWidth = 16;
                  
                          var columnsSelections = this.columnsSelections;
                  Severity: Major
                  Found in src/elements/coords.parallel.js - About 2 hrs to fix

                    Function updateGroupContainer has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            const updateGroupContainer = function (selection) {
                    
                                selection.call(attrs(model.groupAttributes));
                    
                                const points = selection
                    Severity: Major
                    Found in src/elements/element.path.base.js - About 2 hrs to fix

                      Function drawFrames has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          drawFrames(frames) {
                      
                              var node = Object.assign({}, this.config);
                      
                              var options = node.options;
                      Severity: Major
                      Found in src/elements/coords.cartesian.js - About 2 hrs to fix

                        Function drawText has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                function drawText(ticks: TickDataBinding) {
                                    const textAnchor = scaleGuide.textAnchor;
                                    const ty = (ko * spacing);
                                    const tdy = (orient === Orient.top ? '0em' : orient === Orient.bottom ? '0.71em' : '0.32em');
                        
                        
                        Severity: Major
                        Found in src/elements/coords.cartesian.axis.ts - About 2 hrs to fix

                          Function ruleApplyRatio has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              ruleApplyRatio(spec: GPLSpec, chartInstance: Plot) {
                          
                                  var isCoordsRect = (unitRef) => {
                                      return (unitRef.type === 'COORDS.RECT' || unitRef.type === 'RECT');
                                  };
                          Severity: Major
                          Found in src/spec-transform-apply-ratio.ts - About 2 hrs to fix

                            Function _getBoundsInfo has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                _getBoundsInfo(bars) {
                                    if (bars.length === 0) {
                                        return null;
                                    }
                            
                            
                            Severity: Major
                            Found in src/elements/element.interval.js - About 2 hrs to fix

                              Function drawFrames has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  drawFrames(frames) {
                              
                                      var node = this.config;
                                      var options = this.config.options;
                              
                              
                              Severity: Major
                              Found in src/elements/element.parallel.line.js - About 2 hrs to fix

                                Function transformConfig has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function transformConfig(type: string, config: ChartConfig) {
                                
                                    var x = config.x;
                                    var y = config.y;
                                    var guide = config.guide;
                                Severity: Major
                                Found in src/api/converter-helpers.ts - About 2 hrs to fix

                                  Function _pickPlace has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      _pickPlace(target) {
                                          if (!this.options.auto) {
                                              return this.options.place;
                                          }
                                          const winBound = 0 | this.options.winBound;
                                  Severity: Major
                                  Found in src/api/balloon.js - About 2 hrs to fix

                                    Function getFacetCount has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    var getFacetCount = (specRef: GPLSpec) => {
                                        var xFacetKeys: string[] = [];
                                        var yFacetKeys: string[] = [];
                                        var getFacetKeys = (root: Unit) => {
                                            // TODO: Maybe there is an API to
                                    Severity: Major
                                    Found in src/spec-transform-calc-size.ts - About 2 hrs to fix

                                      Function draw has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          draw() {
                                              const node = this.node();
                                              const config = node.config;
                                              const options = config.options;
                                              // TODO: hide it somewhere
                                      Severity: Minor
                                      Found in src/elements/element.interval.js - About 2 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