TargetProcess/tauCharts

View on GitHub

Showing 269 of 3,565 total issues

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

    constructor(xSource: DataFrame, scaleConfig: ScaleConfig) {

        super(xSource, scaleConfig);

        var props = this.scaleConfig;
Severity: Minor
Found in src/scales/time.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 interpolateEnding has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

function interpolateEnding({t, polyline, decreasing, rightToLeft}) {

    var reverse = Boolean(decreasing) !== Boolean(rightToLeft);

    var result = (function getLinePiece(t, line) {
Severity: Minor
Found in src/utils/path/interpolators/path-points.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 value has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

        value: function (target) {
            if (target === undefined || target === null) {
                throw new TypeError('Cannot convert undefined or null to object');
            }

Severity: Minor
Found in src/utils/polyfills.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 interpolateCubicEnding has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

function interpolateCubicEnding({t, polyline, decreasing, rightToLeft}) {

    var reverse = Boolean(decreasing) !== Boolean(rightToLeft);

    var result = (function getLinePiece(t, line) {
Severity: Minor
Found in src/utils/path/interpolators/path-points.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 constructor has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    constructor(dataFrame: DataFrame, scaleConfig: ScaleConfig) {

        this._fields = {};

        var data;
Severity: Major
Found in src/scales/base.ts - About 2 hrs to fix

    Function ChartParallel has 55 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const ChartParallel = (config: ParallelConfig) => {
    
        var guide = Object.assign({columns: {}}, (config.guide as ChartConfig) || {});
    
        var scales = {};
    Severity: Major
    Found in src/api/chart-parallel.ts - About 2 hrs to fix

      Function _displayTimeoutWarning has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _displayTimeoutWarning({proceed, cancel, timeout}: {proceed: () => void, cancel: () => void, timeout: number}) {
              var width = 200;
              var height = 100;
              var linesCount = 3;
              var lineSpacing = 1.5;
      Severity: Major
      Found in src/charts/tau.plot.ts - About 2 hrs to fix

        Function defineGrammarModel has 55 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            defineGrammarModel(fnCreateScale: ScaleFactoryMethod): GrammarModel {
                const config = this.config;
                this.regScale('x', fnCreateScale('pos', config.x, [0, config.options.width]))
                    .regScale('y', fnCreateScale('pos', config.y, [config.options.height, 0]))
                    .regScale('y', fnCreateScale(
        Severity: Major
        Found in src/elements/element.generic.cartesian.ts - About 2 hrs to fix

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

              getClosestElement(_cursorX, _cursorY) {
                  if (!this._boundsInfo) {
                      return null;
                  }
                  const {bounds, tree} = this._boundsInfo;
          Severity: Major
          Found in src/elements/element.interval.js - About 2 hrs to fix

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

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

              Function _drawGrid has a Cognitive Complexity of 16 (exceeds 5 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 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 entire-view has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  'entire-view'(srcSize, calcSize, specRef, tryOptimizeSpec) {
              
                      var g = specRef.unit.guide;
                      var {xFacetCount, yFacetCount} = getFacetCount(specRef);
                      if (yFacetCount > 0) {
              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

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

                  getClosestElement(cursorX: number, cursorY: number) {
                      if (!this._boundsInfo) {
                          return null;
                      }
                      const {bounds, tree} = this._boundsInfo as BoundsInfo;
              Severity: Minor
              Found in src/elements/element.area.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 buildModel has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  buildModel(screenModel) {
              
                      const config = this.node().config;
                      const guide = config.guide;
                      const options = config.options;
              Severity: Major
              Found in src/elements/element.line.js - About 2 hrs to fix

                Function wrapText has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                var wrapText = (textNode, getScaleStepSize, linesLimit, tickLabelFontHeight, isY, getComputedTextLength) => {
                
                    getComputedTextLength = getComputedTextLength || d3getComputedTextLength();
                
                    var addLine = (targetD3, text, lineHeight, x, y, dy, lineNumber) => {
                Severity: Major
                Found in src/utils/d3-decorators.js - About 2 hrs to fix

                  Function energy has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      var energy = function (index) {
                          // energy function, tailored for label placement
                  
                          var m = lab.length,
                              ener = 0,
                  Severity: Major
                  Found in src/utils/d3-labeler.js - About 2 hrs to fix

                    Function getScaleDiffFn has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function getScaleDiffFn(points1, points2) {
                    
                        // Find remaining points with predictable position
                        var src = [];
                        var dst = [];
                    Severity: Major
                    Found in src/utils/path/interpolators/path-points.ts - About 2 hrs to fix

                      Function ChartMap has 50 lines of code (exceeds 25 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 2 hrs to fix

                        Function exports has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        module.exports = function (config) {
                        
                            const DEBUG = Boolean(config.tauchartsDebug);
                        
                            config.set({
                        Severity: Minor
                        Found in karma.conf.js - About 1 hr to fix

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

                              'BUILD-COMPACT': (srcSpec, meta, settings) => {
                          
                                  var spec = utils.clone(srcSpec);
                                  fnTraverseSpec(
                                      utils.clone(spec.unit),
                          Severity: Minor
                          Found in src/spec-transform-auto-layout.ts - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language