TargetProcess/tauCharts

View on GitHub

Showing 269 of 3,565 total issues

Function getCubicSpline has 100 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function getCubicSpline(points: Point[], limited: boolean): Point[] {
    if (points.length < 2) {
        return points.slice(0);
    }
    if (points.length === 2) {
Severity: Major
Found in src/utils/path/interpolators/smooth.ts - About 4 hrs to fix

    Function merged has 98 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                .call(function (selection) {
    
                    var node = selection;
    
                    node.attr('class', 'map-container');
    Severity: Major
    Found in src/elements/coords.geomap.js - About 3 hrs to fix

      Function sortChildren has 96 lines of code (exceeds 25 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: Major
      Found in src/utils/utils-dom.ts - About 3 hrs to fix

        Function init has 94 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            init(xConfig) {
        
                const config = Object.assign({}, xConfig);
        
                config.guide = (config.guide || {});
        Severity: Major
        Found in src/elements/element.interval.js - About 3 hrs to fix

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

              drawFrames() {
          
                  var self = this;
          
                  var options = this.config.options;
          Severity: Major
          Found in src/elements/element.generic.cartesian.ts - About 3 hrs to fix

            Function avoidTickTextCollision has 87 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function avoidTickTextCollision(ticks, isHorizontal) {
            
                const textOffsetStep = 11;
                const refOffsetStart = isHorizontal ? -10 : 20;
                const translateParam = isHorizontal ? 0 : 1;
            Severity: Major
            Found in src/utils/d3-decorators.js - About 3 hrs to fix

              Function getClosestElement has 87 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  getClosestElement(cursorX: number, cursorY: number) {
                      if (!this._boundsInfo) {
                          return null;
                      }
                      const {bounds, tree} = this._boundsInfo as BoundsInfo;
              Severity: Major
              Found in src/elements/element.area.ts - About 3 hrs to fix

                Function extractFieldsFormatInfo has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    static extractFieldsFormatInfo(spec: GPLSpec) {
                
                        var specScales = spec.scales;
                
                        var isEmptyScale = function (key: string) {
                Severity: Major
                Found in src/plugins-sdk.ts - About 3 hrs to fix

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

                      constructor(config) {
                  
                          super(config);
                  
                          this.config = config;
                  Severity: Major
                  Found in src/elements/coords.cartesian.js - About 3 hrs to fix

                    Function calcXYGuide has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function calcXYGuide(
                        guide: UnitGuide,
                        settings: ChartSettings,
                        xMeta,
                        yMeta,
                    Severity: Minor
                    Found in src/spec-transform-auto-layout.ts - About 3 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 init has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        init(xConfig) {
                    
                            const config = Object.assign({}, xConfig);
                    
                            config.guide = utils.defaults(
                    Severity: Major
                    Found in src/elements/element.point.ts - About 2 hrs to fix

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

                      import * as utilsDom from './utils/utils-dom';
                      import * as utils from './utils/utils';
                      import * as utilsDraw from './utils/utils-draw';
                      import {GPL} from './charts/tau.gpl';
                      import {Plot} from './charts/tau.plot';
                      Severity: Minor
                      Found in src/tau.charts.ts - About 2 hrs to fix

                        Function draw has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            draw(this: PointInstance) {
                        
                                const node = this.node() as PointClass;
                                const config = node.config;
                                const options = config.options;
                        Severity: Major
                        Found in src/elements/element.point.ts - About 2 hrs to fix

                          Function autoPosition has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              autoPosition(parallel: Parallel, tokens: string[]) {
                          
                                  const calcEllipticXY = (r, angle) => {
                                      const xReserve = 4;
                                      const yReserve = 2;
                          Severity: Major
                          Found in src/elements/decorators/layer-labels.ts - About 2 hrs to fix

                            Function autoDetectDimTypes has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                            Open

                                autoDetectDimTypes: function (data: any[]): ChartDimensionsMap {
                            
                                    var defaultDetect = {
                                        type: 'category',
                                        scale: 'ordinal'
                            Severity: Minor
                            Found in src/data-processor.ts - 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 ChartArea has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

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

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

                              import {Element} from './element';
                              import * as utilsDom from '../utils/utils-dom';
                              import * as utilsDraw from '../utils/utils-draw';
                              import * as utils from '../utils/utils';
                              import {CSS_PREFIX} from '../const';
                              Severity: Minor
                              Found in src/elements/coords.cartesian.js - About 2 hrs to fix

                                Function getLinearInterpolator has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function getLinearInterpolator(pointsFrom: XPoint[], pointsTo: XPoint[]): (t: number) => XPoint[] {
                                
                                    // TODO: Continue unfinished transition of ending points.
                                    pointsFrom = pointsFrom.filter(d => !d.isInterpolated);
                                
                                
                                Severity: Major
                                Found in src/utils/path/interpolators/path-points.ts - About 2 hrs to fix

                                  Function getFacetCount has a Cognitive Complexity of 20 (exceeds 5 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: Minor
                                  Found in src/spec-transform-calc-size.ts - 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

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

                                  import {Emitter} from '../event';
                                  import * as utils from '../utils/utils';
                                  import {FramesAlgebra} from '../algebra';
                                  import {DataFrame} from '../data-frame';
                                  import {
                                  Severity: Minor
                                  Found in src/charts/tau.gpl.ts - About 2 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language