TargetProcess/tauCharts

View on GitHub

Showing 269 of 3,565 total issues

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

function createDispatcher(eventName: string) {
    var eventFunction = events[eventName];

    if (!eventFunction) {
        eventFunction = function () {
Severity: Minor
Found in src/event.ts - About 1 hr to fix

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

        _setupTaskRunner(liveSpec: GPLSpec) {
            this._resetTaskRunner();
            this._taskRunner = new TaskRunner({
                timeout: (liveSpec.settings.renderingTimeout || Number.MAX_SAFE_INTEGER),
                syncInterval: (liveSpec.settings.asyncRendering ?
    Severity: Minor
    Found in src/charts/tau.plot.ts - About 1 hr to fix

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

          getClosestElement(this: PointInstance, _cursorX, _cursorY) {
              if (!this._boundsInfo) {
                  return null;
              }
              const {bounds, tree} = this._boundsInfo;
      Severity: Minor
      Found in src/elements/element.point.ts - About 1 hr to fix

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

            _getBoundsInfo(dots) {
                if (dots.length === 0) {
                    return null;
                }
        
        
        Severity: Minor
        Found in src/elements/element.path.base.js - About 1 hr to fix

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

              draw() {
                  const node = this.node();
                  const config = node.config;
                  const guide = config.guide;
                  const options = config.options;
          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 constructor has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

              constructor(dataFrame: DataFrame, scaleConfig: ScaleConfig) {
          
                  this._fields = {};
          
                  var data;
          Severity: Minor
          Found in src/scales/base.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 init has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

              init(xConfig) {
          
                  const config = Object.assign({}, xConfig);
          
                  config.guide = (config.guide || {});
          Severity: Minor
          Found in src/elements/element.interval.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 _drawMap has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

              _drawMap(frames, topoJSONData) {
          
                  var self = this;
          
                  var guide = this.config.guide;
          Severity: Minor
          Found in src/elements/coords.geomap.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 ruleApplyRatio has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

              ruleApplyRatio(spec: GPLSpec, chartInstance: Plot) {
          
                  var isCoordsRect = (unitRef) => {
                      return (unitRef.type === 'COORDS.RECT' || unitRef.type === 'RECT');
                  };
          Severity: Minor
          Found in src/spec-transform-apply-ratio.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 init has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

              init(xConfig) {
          
                  const config = Object.assign({}, xConfig);
          
                  config.guide = utils.defaults(
          Severity: Minor
          Found in src/elements/element.point.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 init has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

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

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

              Function value has 46 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      value: (function () {
                          var toStr = Object.prototype.toString;
                          var isCallable = function (fn) {
                              return typeof fn === 'function' || toStr.call(fn) === '[object Function]';
                          };
              Severity: Minor
              Found in src/utils/polyfills.js - About 1 hr to fix

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

                  Function drawAxisLabel has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          function drawAxisLabel() {
                              const guide = labelGuide;
                  
                              const labelTextNode = selectOrAppend(selection, `text.label`)
                                  .attr('class', classes('label', guide.cssClass))
                  Severity: Minor
                  Found in src/elements/coords.cartesian.axis.ts - About 1 hr to fix

                    Function _loopTasks has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        _loopTasks() {
                    
                            var task: Task;
                            var duration: number;
                            var frameDuration = 0;
                    Severity: Minor
                    Found in src/charts/task-runner.ts - About 1 hr to fix

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

                          var result = (function getLinePiece(t, line) {
                              var q = 0;
                              if (t > 0) {
                                  var distance = [0];
                                  var totalDistance = 0;
                      Severity: Minor
                      Found in src/utils/path/interpolators/path-points.ts - About 1 hr to fix

                        Function getFieldFormatters has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            static getFieldFormatters(spec: GPLSpec, formatters: {[field: string]: Formatter}) {
                        
                                const info = PluginsSDK.extractFieldsFormatInfo(spec);
                                Object.keys(info).forEach((k) => {
                                    if (info[k].parentField) {
                        Severity: Minor
                        Found in src/plugins-sdk.ts - About 1 hr to fix

                          Function d3_transition_attr has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          var d3_transition_attr = function (keyOrMap, value) {
                              var d3AttrResult = d3.transition.prototype.attr.apply(this, arguments);
                          
                              if (arguments.length === 0) {
                                  throw new Error('Unexpected `transition().attr()` arguments.');
                          Severity: Minor
                          Found in src/utils/d3-decorators.js - About 1 hr to fix

                            Function mcrotate has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                var mcrotate = function (currT) {
                                    // Monte Carlo rotation 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
                              Severity
                              Category
                              Status
                              Source
                              Language