Gapminder/vizabi

View on GitHub

Showing 540 of 540 total issues

Avoid too many return statements within this function.
Open

    return true;
Severity: Major
Found in src/base/utils.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

      if (next === 0) return items[0][which];
    Severity: Major
    Found in src/base/utils.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return "entities_" + dim;
      Severity: Major
      Found in src/base/dimensionmanager.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return true;
        Severity: Major
        Found in src/base/events.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

                Avoid too many return statements within this function.
                Open

                  return true;
                Severity: Major
                Found in src/base/utils.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      } else if (a[i] !== b[i]) return false;
                  Severity: Major
                  Found in src/base/utils.js - About 30 mins to fix

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

                        this.KEYS = utils.unique(this.model.state.marker._getAllDimensions({ exceptType: "time" }));
                    Severity: Minor
                    Found in src/components/dialogs/find/show.js and 1 other location - About 30 mins to fix
                    src/components/dialogs/find/show.js on lines 69..69

                    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 45.

                    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

                            comps.push({
                              component: dlg_config.dialog,
                              placeholder: '.vzb-dialogs-dialog[data-dlg="' + dlg + '"]',
                              model: ["state", "ui", "locale"]
                            });
                    Severity: Minor
                    Found in src/components/dialogs/moreoptions/moreoptions.js and 1 other location - About 30 mins to fix
                    src/components/dialogs/dialogs.js on lines 188..192

                    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 45.

                    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

                      preloadData() {
                        this.dataSource = this.getClosestModel(this.data || "data");
                        return this._super();
                      },
                    Severity: Minor
                    Found in src/models/time.js and 1 other location - About 30 mins to fix
                    src/models/entities.js on lines 41..44

                    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 45.

                    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 (hook._type === "label" && hook.getEntity().dim === key) {
                              names.label = name;
                            }
                    Severity: Minor
                    Found in src/models/marker.js and 1 other location - About 30 mins to fix
                    src/models/marker.js on lines 376..378

                    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 45.

                    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.titleEl = this.svgEl.append("text").attr("class", "title").style({ "font-size": "2em" });
                    Severity: Minor
                    Found in src/tools/donutchart/donutchart-component.js and 1 other location - About 30 mins to fix
                    src/tools/donutchart/donutchart-component.js on lines 58..58

                    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 45.

                    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

                      preloadData() {
                        this.dataSource = this.getClosestModel(this.data || "data");
                        return this._super();
                      },
                    Severity: Minor
                    Found in src/models/entities.js and 1 other location - About 30 mins to fix
                    src/models/time.js on lines 132..135

                    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 45.

                    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

                        toolData.build = versionInfo ? d3.time.format("%Y-%m-%d at %H:%M")(new Date(parseInt(versionInfo.build))) : "N/A";
                    Severity: Minor
                    Found in src/components/dialogs/about/about.js and 1 other location - About 30 mins to fix
                    src/components/dialogs/about/about.js on lines 64..64

                    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 45.

                    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

                        dots.attr("cx", d => _this.xScale(d))
                          .attr("cy", d => _this.yScale(d));
                    Severity: Minor
                    Found in src/tools/axislabeler/axislabeler-component.js and 1 other location - About 30 mins to fix
                    src/tools/axislabeler/axislabeler-component.js on lines 179..180

                    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 45.

                    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

                    Avoid too many return statements within this function.
                    Open

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

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

                          dotsInvert.attr("cx", d => _this.xInvert(d))
                            .attr("cy", d => _this.yInvert(d));
                      Severity: Minor
                      Found in src/tools/axislabeler/axislabeler-component.js and 1 other location - About 30 mins to fix
                      src/tools/axislabeler/axislabeler-component.js on lines 168..169

                      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 45.

                      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.yearEl = this.svgEl.append("text").attr("class", "year").style({ "font-size": "4em" });
                      Severity: Minor
                      Found in src/tools/donutchart/donutchart-component.js and 1 other location - About 30 mins to fix
                      src/tools/donutchart/donutchart-component.js on lines 59..59

                      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 45.

                      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

                      Severity
                      Category
                      Status
                      Source
                      Language