TargetProcess/tauCharts

View on GitHub

Showing 269 of 3,565 total issues

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

    drawFrames(frames) {

        var cfg = Object.assign({}, this.config);
        var options = cfg.options;

Severity: Minor
Found in src/elements/coords.parallel.js - About 1 hr to fix

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

        _getBoundsInfo(this: PointInstance, dots: Element[]) {
            if (dots.length === 0) {
                return null;
            }
    
    
    Severity: Minor
    Found in src/elements/element.point.ts - About 1 hr to fix

      Function autoDetectDimTypes has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          autoDetectDimTypes: function (data: any[]): ChartDimensionsMap {
      
              var defaultDetect = {
                  type: 'category',
                  scale: 'ordinal'
      Severity: Minor
      Found in src/data-processor.ts - About 1 hr to fix

        Function create has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            create(interval) {
        
                const gen = this.periodGenerator;
        
                var varSet = this.vars;
        Severity: Minor
        Found in src/scales/period.ts - About 1 hr to fix

          Function selectOrAppend has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              export function selectOrAppend(_container: Element | d3Selection, selector: string) {
                  var delimitersActions = {
                      '.': (text, el) => el.classed(text, true),
                      '#': (text, el) => el.attr('id', text)
                  };
          Severity: Minor
          Found in src/utils/utils-dom.ts - About 1 hr to fix

            Function interpolated has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    const interpolated = (() => {
                        interface Pair {
                            start: ElementInfo;
                            end: ElementInfo;
                            y: number;
            Severity: Minor
            Found in src/elements/element.area.ts - About 1 hr to fix

              Function method has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          ((model) => {
                              const dataSource = model.data();
                              const xColors = dataSource
                                  .reduce((map, row) => {
                                      const x = row[model.scaleX.dim];
              Severity: Minor
              Found in src/grammar-registry.ts - About 1 hr to fix

                Function xml has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function xml(tag: string) {
                    var childrenArgIndex = 2;
                    var attrs = arguments[1];
                    if (typeof arguments[1] !== 'object' || Array.isArray(arguments[1])) {
                        childrenArgIndex = 1;
                Severity: Minor
                Found in src/utils/utils.ts - About 1 hr to fix

                  Function mcmove has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      var mcmove = function (currT) {
                          // Monte Carlo translation move
                  
                          // select a random label
                          var i = Math.floor(Math.random() * lab.length);
                  Severity: Minor
                  Found in src/utils/d3-labeler.js - About 1 hr to fix

                    Function _drawGrid has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        _drawGrid(container, node, width, height) {
                    
                            var grid = selectOrAppend(container, `g.grid`)
                                .attr('transform', utilsDraw.translate(0, 0))
                                .call((selection) => {
                    Severity: Minor
                    Found in src/elements/coords.cartesian.js - About 1 hr to fix

                      Function _handlePointerEvent has 37 lines of code (exceeds 25 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 1 hr to fix

                        Function reg has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            reg(unitType: string, xUnit: GrammarElement | ElementConsructor, xSeed?: string) {
                        
                                if (xSeed) {
                                    SeedsMap[unitType] = xSeed;
                                    UnitsMap[unitType] = <ElementConsructor><any>function (config, Base) {
                        Severity: Minor
                        Found in src/units-registry.ts - About 1 hr to fix

                          Function hideOnLabelLabelOverlap has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              hideOnLabelLabelOverlap(data: TextInfo[]) {
                          
                                  var extremumOrder = {min: 0, max: 1, norm: 2};
                                  var collisionSolveStrategies = {
                                      'min/min': ((p0, p1) => p1.y - p0.y), // desc
                          Severity: Minor
                          Found in src/elements/decorators/layer-labels.ts - About 1 hr to fix

                            Function fixOuterTicksOverflow has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    function fixOuterTicksOverflow(text: d3Selection) {
                                        if (values.length === 0) {
                                            return;
                                        }
                            
                            
                            Severity: Minor
                            Found in src/elements/coords.cartesian.axis.ts - About 1 hr to fix

                              Function highlightDataPoints has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  highlightDataPoints(filter) {
                                      const node = this.node();
                                      const elModel = this.domElementModel;
                                      const dots = highlightAnchors(node, elModel, filter);
                                      const container = node.config.options.container;
                              Severity: Minor
                              Found in src/elements/element.path.base.js - About 1 hr 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 12 (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.path.base.js - About 1 hr 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 get has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  get: (formatAlias: string | ((x: any) => string) , nullOrUndefinedAlias?: string) => {
                                      var formatter = null;
                                      if (typeof formatAlias === `function`) {
                                          formatter = formatAlias;
                                      } else {
                              Severity: Minor
                              Found in src/formatter-registry.ts - About 1 hr 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 createTicks has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      function createTicks(): TickDataBinding {
                                          return take((selection
                                              .selectAll('.tick') as d3Selection)
                                              .data(values, (x) => String(scale(x)))
                                              .order())
                              Severity: Minor
                              Found in src/elements/coords.cartesian.axis.ts - About 1 hr to fix

                                Function _fnDrawColumns has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    _fnDrawColumns(grid, config) {
                                        var colsGuide = config.guide.columns || {};
                                        var xBase = this.xBase;
                                        var columnsScalesMap = this.columnsScalesMap;
                                        var d3Axis = d3.axisLeft();
                                Severity: Minor
                                Found in src/elements/coords.parallel.js - About 1 hr to fix

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

                                      buildModel(screenModel) {
                                  
                                          const baseModel = BasePath.baseModel(screenModel);
                                          const guide = this.node().config.guide;
                                          const countCss = getLineClassesByCount(screenModel.model.scaleColor.domain().length);
                                  Severity: Minor
                                  Found in src/elements/element.path.js - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language