Gapminder/vizabi

View on GitHub

Showing 540 of 540 total issues

Function collisionResolver has 143 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function collisionResolver() {
  return (function collision_resolver() {
    const DURATION = 300;
    let labelHeight = 0;
    // MAINN FUNCTION. RUN COLLISION RESOLVER ON A GROUP g
Severity: Major
Found in src/helpers/d3.collisionResolver.js - About 5 hrs to fix

    Function collision_resolver has 141 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      return (function collision_resolver() {
        const DURATION = 300;
        let labelHeight = 0;
        // MAINN FUNCTION. RUN COLLISION RESOLVER ON A GROUP g
        function resolver(g) {
    Severity: Major
    Found in src/helpers/d3.collisionResolver.js - About 5 hrs to fix

      Hook has 40 functions (exceeds 20 allowed). Consider refactoring.
      Open

      const Hook = DataConnected.extend({
      
        //some hooks can be important. like axis x and y
        //that means, if X or Y doesn't have data at some point, we can't show markers
        _important: false,
      Severity: Minor
      Found in src/models/hook.js - About 5 hrs to fix

        Function redraw has 132 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          redraw() {
        
            const _this = this;
            this.translator = this.model.locale.getTFunction();
        
        
        Severity: Major
        Found in src/components/dialogs/find/show.js - About 5 hrs to fix

          Function set has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
          Open

            set(attr, val, force, persistent, caller) {
              const setting = this._setting;
              let attrs;
              let freezeCall = false; // boolean, indicates if this .set()-call froze the modelTree
          
          
          Severity: Minor
          Found in src/base/model.js - About 5 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 component.js has 382 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import * as utils from "base/utils";
          import Events from "base/events";
          import Model from "base/model";
          import globals from "base/globals";
          
          
          Severity: Minor
          Found in src/base/component.js - About 5 hrs to fix

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

            module.exports = output => {
              const plugins = [
                new CleanWebpackPlugin(['build']),
                extractSrc,
                new CopyWebpackPlugin([
            Severity: Major
            Found in webpack.external.js - About 4 hrs to fix

              Function init has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
              Open

                init(model, context) {
              
                  this.name = "gapminder-timeslider";
                  this.template = this.template || require("./timeslider.html");
                  this.prevPosition = null;
              Severity: Minor
              Found in src/components/timeslider/timeslider.js - About 4 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 _repositionLabels has 120 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function _repositionLabels(d, i, _cache, labelContext, _X, _Y, _X0, _Y0, duration, showhide, lineGroup) {
              
                    const cache = _cache || _this.cached[d[_this.KEY]];
              
                    const labelGroup = d3.select(labelContext);
              Severity: Major
              Found in src/helpers/labels.js - About 4 hrs to fix

                Function framesQueue has 118 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  framesQueue(framesArray, whatId) {
                    const _context = this;
                    return new function() {
                      this.defaultCallbacks = [];
                      this.callbacks = {};
                Severity: Major
                Found in src/base/datastorage.js - About 4 hrs to fix

                  Function queryQueue has 118 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    queryQueue(readerObject, queryMergeId) {
                      const _context = this;
                      const _parsersCompare = function(readerParsers, queryParcers) {
                        return Object.keys(queryParcers).filter(p => queryParcers[p] !== readerParsers[p]).length == 0 &&
                        (Object.keys(readerParsers).length == 0 || Object.keys(queryParcers).length != 0);
                  Severity: Major
                  Found in src/base/datastorage.js - About 4 hrs to fix

                    Function axis has 117 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function axis(g) {
                          const checkDmn = axis.scale().domain();
                          const checkRng = axis.scale().range();
                          if (!checkDmn[0] && checkDmn[0] !== 0 || !checkDmn[1] && checkDmn[1] !== 0
                          || !checkRng[0] && checkRng[0] !== 0 || !checkRng[1] && checkRng[1] !== 0) {
                    Severity: Major
                    Found in src/helpers/d3.axisWithLabelPicker.js - About 4 hrs to fix

                      Function _initCircles has 109 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        _initCircles() {
                          const {
                            _svg,
                            _maxHeight,
                            _width,
                      Severity: Major
                      Found in src/helpers/d3.colorPicker.js - About 4 hrs to fix

                        Function redraw has 107 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          redraw(data, useDataFiltered) {
                            const _this = this;
                        
                            const isHook = _this._targetModel.isHook();
                        
                        
                        Severity: Major
                        Found in src/components/treemenu/treemenu.js - About 4 hrs to fix

                          Function getFrames has 106 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            getFrames(forceFrame, selected) {
                              const _this = this;
                              if (!this.cachedFrames) this.cachedFrames = {};
                          
                              const KEYS = utils.unique(this._getAllDimensions({ exceptType: "time" }));
                          Severity: Major
                          Found in src/models/marker.js - About 4 hrs to fix

                            Function _buildIndicatorsTree has 106 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              _buildIndicatorsTree(tagsArray) {
                                if (tagsArray === true || !tagsArray) tagsArray = [];
                            
                                const _this = this;
                            
                            
                            Severity: Major
                            Found in src/components/treemenu/treemenu.js - About 4 hrs to fix

                              TimeModel has 33 functions (exceeds 20 allowed). Consider refactoring.
                              Open

                              const TimeModel = DataConnected.extend({
                              
                                /**
                                 * Default values for this model
                                 */
                              Severity: Minor
                              Found in src/models/time.js - About 4 hrs to fix

                                Function buildScale has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  buildScale(scaleType = this.scaleType) {
                                    let domain;
                                
                                    if (scaleType == "time") {
                                
                                
                                Severity: Minor
                                Found in src/models/axis.js - About 4 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 getDimensionModelsForSpace has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  getDimensionModelsForSpace(oldSpace, newSpaceDimensions) {
                                
                                    this.updateDimensionModels();
                                
                                    // match new space to entities
                                Severity: Minor
                                Found in src/base/dimensionmanager.js - About 4 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

                                TreeMenu has 32 functions (exceeds 20 allowed). Consider refactoring.
                                Open

                                const TreeMenu = Component.extend({
                                
                                  //setters-getters
                                  indicatorsTree(input) {
                                    if (!arguments.length) return this._indicatorsTree;
                                Severity: Minor
                                Found in src/components/treemenu/treemenu.js - About 4 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language