Gapminder/vizabi

View on GitHub
src/components/treemenu/treemenu.js

Summary

Maintainability
F
1 wk
Test Coverage

File treemenu.js has 1273 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import * as utils from "base/utils";
import Component from "base/component";
import Class from "base/class";
import Hook from "models/hook";
import Marker from "models/marker";
Severity: Major
Found in src/components/treemenu/treemenu.js - About 3 days to fix

    Function resize has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring.
    Open

      resize() {
        const _this = this;
    
        this.profiles = {
          "small": {
    Severity: Minor
    Found in src/components/treemenu/treemenu.js - About 1 day 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 redraw has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
    Open

      redraw(data, useDataFiltered) {
        const _this = this;
    
        const isHook = _this._targetModel.isHook();
    
    
    Severity: Minor
    Found in src/components/treemenu/treemenu.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

    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 _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

        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

          Function resize has 99 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            resize() {
              const _this = this;
          
              this.profiles = {
                "small": {
          Severity: Major
          Found in src/components/treemenu/treemenu.js - About 3 hrs to fix

            Function createSubmenu has 80 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              createSubmenu(select, data, toplevel) {
                if (!data.children) return;
                const _this = this;
                const noDescriptionText = _this.translator("hints/nodescr");
                const helpTranslateText = _this.translator("dialogs/helptranslate");
            Severity: Major
            Found in src/components/treemenu/treemenu.js - About 3 hrs to fix

              Function _enableSearch has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
              Open

                _enableSearch() {
                  const _this = this;
              
                  const input = this.wrapper.select("." + css.search);
              
              
              Severity: Minor
              Found in src/components/treemenu/treemenu.js - About 3 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

              Menu has 24 functions (exceeds 20 allowed). Consider refactoring.
              Open

              const Menu = Class.extend({
                init(parent, menu, options) {
                  const _this = this;
                  this.parent = parent;
                  this.OPTIONS = options;
              Severity: Minor
              Found in src/components/treemenu/treemenu.js - About 2 hrs to fix

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

                  setWidth(width, recursive, immediate) {
                    if (this.width != width && this.entity.node()) {
                      this.width = width;
                      if ((this.entity.classed(css.list_top_level) || this.entity.classed("active")) && this.direction == MENU_HORIZONTAL) {
                        if (!immediate) {
                Severity: Minor
                Found in src/components/treemenu/treemenu.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 readyOnce has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  readyOnce() {
                    //this function is only called once at start, when both DOM and this.model are ready
                    //this.element contains the view where you can append the menu
                    this.element = d3.select(this.placeholder);
                    //menu class private
                Severity: Major
                Found in src/components/treemenu/treemenu.js - About 2 hrs to fix

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

                    init(parent, item, options) {
                      const _this = this;
                      this.parentMenu = parent;
                      this.entity = item;
                      this.entity.select("." + css.list_item_label).call(select => {
                  Severity: Minor
                  Found in src/components/treemenu/treemenu.js - About 1 hr to fix

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

                      _enableSearch() {
                        const _this = this;
                    
                        const input = this.wrapper.select("." + css.search);
                    
                    
                    Severity: Minor
                    Found in src/components/treemenu/treemenu.js - About 1 hr to fix

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

                        scrollToSelected() {
                          if (!this.selectedNode) return;
                          const _this = this;
                          const scrollToItem = function(listNode, itemNode) {
                            listNode.scrollTop = 0;
                      Severity: Minor
                      Found in src/components/treemenu/treemenu.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 restoreWidth has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                        restoreWidth(width, isClosedElement, cb) {
                          const _this = this;
                          if (isClosedElement) {
                            this.parent.parentMenu.restoreWidth(width, false, cb);
                          } else if (width <= 0) {
                      Severity: Minor
                      Found in src/components/treemenu/treemenu.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 init has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        init(parent, menu, options) {
                          const _this = this;
                          this.parent = parent;
                          this.OPTIONS = options;
                          this.width = this.OPTIONS.MIN_COL_WIDTH;
                      Severity: Minor
                      Found in src/components/treemenu/treemenu.js - About 1 hr to fix

                        Function getMatches has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            const getMatches = function(value) {
                              const matches = {
                                _id: "root",
                                children: []
                              };
                        Severity: Minor
                        Found in src/components/treemenu/treemenu.js - About 1 hr to fix

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

                            scrollToSelected() {
                              if (!this.selectedNode) return;
                              const _this = this;
                              const scrollToItem = function(listNode, itemNode) {
                                listNode.scrollTop = 0;
                          Severity: Minor
                          Found in src/components/treemenu/treemenu.js - About 1 hr to fix

                            Avoid deeply nested control flow statements.
                            Open

                                        if (containerHeight > this.height) {
                                          containerHeight = this.height - 20;
                                        }
                            Severity: Major
                            Found in src/components/treemenu/treemenu.js - About 45 mins to fix

                              Function findItemById has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                findItemById(id) {
                                  for (let i = 0; i < this.menuItems.length; i++) {
                                    if (this.menuItems[i].entity.datum().id == id) {
                                      return this.menuItems[i];
                                    }
                              Severity: Minor
                              Found in src/components/treemenu/treemenu.js - About 45 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 calculateMissingWidth has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                calculateMissingWidth(width, cb) {
                                  const _this = this;
                                  if (this.entity.classed(css.list_top_level)) {
                                    if (width > this.OPTIONS.MAX_MENU_WIDTH) {
                                      if (typeof cb === "function") cb(width - this.OPTIONS.MAX_MENU_WIDTH);
                              Severity: Minor
                              Found in src/components/treemenu/treemenu.js - About 35 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

                              Avoid too many return statements within this function.
                              Open

                                        if (!indicatorsDB[f].scales) return true;
                              Severity: Major
                              Found in src/components/treemenu/treemenu.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                          return false;
                                Severity: Major
                                Found in src/components/treemenu/treemenu.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                              if (b.id == "advanced") return -1;
                                  Severity: Major
                                  Found in src/components/treemenu/treemenu.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                                if (b.id == "_default") return -1;
                                    Severity: Major
                                    Found in src/components/treemenu/treemenu.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                                  if (_this._targetModel.allow.scales.indexOf(indicatorsDB[f].scales[i]) > -1) return true;
                                      Severity: Major
                                      Found in src/components/treemenu/treemenu.js - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                                    if (a.id == "_default") return 1;
                                        Severity: Major
                                        Found in src/components/treemenu/treemenu.js - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                                      if (a.id == "advanced") return 1;
                                          Severity: Major
                                          Found in src/components/treemenu/treemenu.js - About 30 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                      return (a.name_catalog || a.name) > (b.name_catalog || b.name) ? 1 : -1;
                                            Severity: Major
                                            Found in src/components/treemenu/treemenu.js - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                        if (_this._targetModel.allow.scales[0] == "*") return true;
                                              Severity: Major
                                              Found in src/components/treemenu/treemenu.js - About 30 mins to fix

                                                Function closeAllChildren has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                Open

                                                  closeAllChildren(cb) {
                                                    let callbacks = 0;
                                                    for (let i = 0; i < this.menuItems.length; i++) {
                                                      if (this.menuItems[i].isActive()) {
                                                        ++callbacks;
                                                Severity: Minor
                                                Found in src/components/treemenu/treemenu.js - About 25 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

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                        leafContent.append("span").classed(css.leaf_content_item + " " + css.leaf_content_item_title, true)
                                                          .text(utils.replaceNumberSpacesToNonBreak(d.name) || "");
                                                Severity: Major
                                                Found in src/components/treemenu/treemenu.js and 1 other location - About 1 hr to fix
                                                src/components/treemenu/treemenu.js on lines 428..429

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 60.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                    this.model_expects = [{
                                                      name: "marker",
                                                      type: "marker"
                                                    }, {
                                                      name: "time",
                                                Severity: Major
                                                Found in src/components/treemenu/treemenu.js and 1 other location - About 1 hr to fix
                                                src/components/draggablelist/draggablelist.js on lines 14..26

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 60.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                        leafContent.append("span").classed(css.leaf_content_item + " " + css.leaf_content_item_descr, true)
                                                          .text(utils.replaceNumberSpacesToNonBreak(d.description) || "");
                                                Severity: Major
                                                Found in src/components/treemenu/treemenu.js and 1 other location - About 1 hr to fix
                                                src/components/treemenu/treemenu.js on lines 426..427

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 60.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                  marqueeToggle(toggle) {
                                                    for (let i = 0; i < this.menuItems.length; i++) {
                                                      this.menuItems[i].marqueeToggle(toggle);
                                                    }
                                                  },
                                                Severity: Major
                                                Found in src/components/treemenu/treemenu.js and 1 other location - About 1 hr to fix
                                                src/components/treemenu/treemenu.js on lines 367..371

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 59.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                  marqueeToggleAll(toggle) {
                                                    for (let i = 0; i < this.menuItems.length; i++) {
                                                      this.menuItems[i].marqueeToggleAll(toggle);
                                                    }
                                                  },
                                                Severity: Major
                                                Found in src/components/treemenu/treemenu.js and 1 other location - About 1 hr to fix
                                                src/components/treemenu/treemenu.js on lines 362..366

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 59.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                      } else {
                                                        if (this.menuEntity.direction != MENU_HORIZONTAL) {
                                                          this.menuEntity.setDirection(MENU_HORIZONTAL, true);
                                                          this.OPTIONS.MENU_DIRECTION = MENU_HORIZONTAL;
                                                        }
                                                Severity: Minor
                                                Found in src/components/treemenu/treemenu.js and 1 other location - About 55 mins to fix
                                                src/components/treemenu/treemenu.js on lines 973..978

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 53.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                      if (this.OPTIONS.IS_MOBILE) {
                                                        if (this.menuEntity.direction != MENU_VERTICAL) {
                                                          this.menuEntity.setDirection(MENU_VERTICAL, true);
                                                          this.OPTIONS.MENU_DIRECTION = MENU_VERTICAL;
                                                        }
                                                Severity: Minor
                                                Found in src/components/treemenu/treemenu.js and 1 other location - About 55 mins to fix
                                                src/components/treemenu/treemenu.js on lines 978..983

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 53.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                        _this._selectIndicator({ concept: d.id, key: d.key, dataSource: d.dataSource, use: d.use });
                                                Severity: Minor
                                                Found in src/components/treemenu/treemenu.js and 1 other location - About 40 mins to fix
                                                src/components/treemenu/treemenu.js on lines 1444..1444

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 48.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                            _this._selectIndicator({ concept: d.id, key: d.key, dataSource: d.dataSource, use: d.use });
                                                Severity: Minor
                                                Found in src/components/treemenu/treemenu.js and 1 other location - About 40 mins to fix
                                                src/components/treemenu/treemenu.js on lines 1418..1418

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 48.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                    _this.entity.transition()
                                                      .delay(0)
                                                      .duration(20)
                                                      .style("width", 0 + "px")
                                                      .on("end", () => {
                                                Severity: Minor
                                                Found in src/components/treemenu/treemenu.js and 1 other location - About 35 mins to fix
                                                src/components/treemenu/treemenu.js on lines 343..352

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 46.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                      this.entity.transition()
                                                        .delay(0)
                                                        .duration(duration)
                                                        .style("width", newElementWidth + "px")
                                                        .on("end", () => {
                                                Severity: Minor
                                                Found in src/components/treemenu/treemenu.js and 1 other location - About 35 mins to fix
                                                src/components/treemenu/treemenu.js on lines 225..230

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 46.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                    _this.entity
                                                      .transition()
                                                      .delay(0)
                                                      .duration(100)
                                                      .style("height", 0 + "px")
                                                Severity: Minor
                                                Found in src/components/treemenu/treemenu.js and 1 other location - About 35 mins to fix
                                                src/components/treemenu/treemenu.js on lines 325..339

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 46.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                        this.entity.transition()
                                                          .delay(0)
                                                          .duration(duration)
                                                          .style("width", newElementWidth + "px")
                                                          .on("end", () => {
                                                Severity: Minor
                                                Found in src/components/treemenu/treemenu.js and 1 other location - About 35 mins to fix
                                                src/components/treemenu/treemenu.js on lines 254..260

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 46.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                There are no issues that match your filters.

                                                Category
                                                Status