TargetProcess/tauCharts

View on GitHub

Showing 269 of 3,565 total issues

Function ChartLine has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

const ChartLine = (rawConfig: ChartConfig) => {
    var config = normalizeConfig(rawConfig);

    var data = config.data;

Severity: Minor
Found in src/api/chart-line.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 ruleApplyDefaults has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    ruleApplyDefaults(spec: GPLSpec) {

        var settings = spec.settings || {};

        var traverse = (node, iterator, parentNode) => {
Severity: Minor
Found in src/spec-converter.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 highlightDataPoints has 27 lines of code (exceeds 25 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

    Function highlight has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        highlight(filter) {
    
            const container = this.node().config.options.container;
    
            const x = 'tau-chart__highlighted';
    Severity: Minor
    Found in src/elements/element.path.base.js - About 1 hr to fix

      Function _runTask has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _runTask(task: Task) {
              var start = performance.now();
              if (this._callbacks.error) {
                  try {
                      this._result = task.call(null,
      Severity: Minor
      Found in src/charts/task-runner.ts - About 1 hr to fix

        Function normalizeConfig has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function normalizeConfig(config: ChartConfig) {
        
            var x = normalizeSettings(config.x);
            var y = normalizeSettings(config.y);
        
        
        Severity: Minor
        Found in src/api/converter-helpers.ts - About 1 hr to fix

          Function optimizeXAxisLabel has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              static optimizeXAxisLabel(root: Unit, settings: ChartSettings) {
                  const {xAxisTickLabelLimit} = settings;
          
                  const enterSpec = (rootUnit: Unit) => {
          
          
          Severity: Minor
          Found in src/spec-transform-optimize.ts - About 1 hr to fix

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

                init(xConfig) {
            
                    const config = BasePath.init(xConfig);
            
                    config.transformRules = [
            Severity: Minor
            Found in src/elements/element.path.js - About 1 hr to fix

              Function createDiscreteScale has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  createDiscreteScale(varSet: any[], brewer: string[]) {
              
                      var defaultColorClass = () => 'color-default';
              
                      var buildArrayGetClass = (domain: any[], brewer: string[]) => {
              Severity: Minor
              Found in src/scales/color.ts - About 1 hr to fix

                Function labels has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                                .map((d) => {
                
                                    var info = (d.properties || {});
                
                                    var center = path.centroid(d);
                Severity: Minor
                Found in src/elements/coords.geomap.js - About 1 hr to fix

                  Function normal has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      normal(srcSize, calcSize, specRef, tryOptimizeSpec) {
                  
                          const {yFacetCount} = getFacetCount(specRef);
                          if (yFacetCount > 0) {
                              SpecTransformOptimize.facetsLabelsAtTop(specRef.unit, specRef.settings);
                  Severity: Minor
                  Found in src/spec-transform-calc-size.ts - About 1 hr to fix

                    Function cross_period has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        cross_period(
                            dataFn: () => any[],
                            dimX: string,
                            dimY: string,
                            xPeriod: string,
                    Severity: Minor
                    Found in src/algebra.ts - About 1 hr to fix

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

                          constructor(spec: ChartConfig) {
                              this.spec = spec;
                      
                              this.dist = {
                                  sources: <DataSources>{
                      Severity: Minor
                      Found in src/spec-converter.ts - About 1 hr to fix

                        Function _insertLayout has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            _insertLayout(target: HTMLElement | string, xSize?: Size) {
                                this._target = target;
                                this._defaultSize = Object.assign({}, xSize);
                        
                                var targetNode: Element = d3.select(target as any).node();
                        Severity: Minor
                        Found in src/charts/tau.plot.ts - About 1 hr to fix

                          Function isIntersect has 8 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  ax0: number,
                                  ay0: number,
                                  ax1: number,
                                  ay1: number,
                                  bx0: number,
                          Severity: Major
                          Found in src/utils/utils-draw.ts - About 1 hr to fix

                            Function intersect has 8 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                var intersect = function (x1, x2, x3, x4, y1, y2, y3, y4) {
                            Severity: Major
                            Found in src/utils/d3-labeler.js - About 1 hr to fix

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

                                      value: function (predicate) {
                                          if (this == null) {
                                              throw new TypeError('Array.prototype.findIndex called on null or undefined');
                                          }
                                          if (typeof predicate !== 'function') {
                              Severity: Minor
                              Found in src/utils/polyfills.js - About 55 mins 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 drawFrames has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  drawFrames(frames) {
                              
                                      var node = Object.assign({}, this.config);
                              
                                      var options = node.options;
                              Severity: Minor
                              Found in src/elements/coords.cartesian.js - About 55 mins 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 defaults has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  export function defaults<T>(obj: T, ...defaultObjs: T[]): T {
                                      var length = defaultObjs.length;
                                      if (length === 0 || !obj) {
                                          return obj;
                                      }
                              Severity: Minor
                              Found in src/utils/utils.ts - About 55 mins 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 depthFirstSearch has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  static depthFirstSearch(node, predicate) {
                              
                                      if (predicate(node)) {
                                          return node;
                                      }
                              Severity: Minor
                              Found in src/plugins-sdk.ts - About 55 mins 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