gopheracademy/gcon

View on GitHub
assets/admin/global/plugins/highstock/js/modules/treemap.src.js

Summary

Maintainability
F
1 mo
Test Coverage

File treemap.src.js has 745 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * @license Highstock JS v2.1.9 (2015-10-07)
 *
 * (c) 2014 Highsoft AS
 * Authors: Jon Arild Nygard / Oystein Moseng
Severity: Major
Found in assets/admin/global/plugins/highstock/js/modules/treemap.src.js - About 1 day to fix

    Function alg_func_calcPoints has 57 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            alg_func_calcPoints: function (directionChange, last, group, childrenArea) {
                var pX,
                    pY,
                    pW,
                    pH,
    Severity: Major
    Found in assets/admin/global/plugins/highstock/js/modules/treemap.src.js - About 2 hrs to fix

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

              alg_func_group: function (h, w, d, p) {
                  this.height = h;
                  this.width = w;
                  this.plot = p;
                  this.direction = d;
      Severity: Minor
      Found in assets/admin/global/plugins/highstock/js/modules/treemap.src.js - About 1 hr to fix

        Function setTreeValues has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                setTreeValues: function (tree) {
                    var series = this,
                        options = series.options,
                        childrenTotal = 0,
                        sorted = [],
        Severity: Minor
        Found in assets/admin/global/plugins/highstock/js/modules/treemap.src.js - About 1 hr to fix

          Function alg_func_fill has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  alg_func_fill: function (directionChange, parent, children) {
                      var childrenArea = [],
                          pTot,
                          direction = parent.direction,
                          x = parent.x,
          Severity: Minor
          Found in assets/admin/global/plugins/highstock/js/modules/treemap.src.js - About 1 hr to fix

            Function showDrillUpButton has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    showDrillUpButton: function (name) {
                        var series = this,
                            backText = (name || '< Back'),
                            buttonOptions = series.options.drillUpButton,
                            attr,
            Severity: Minor
            Found in assets/admin/global/plugins/highstock/js/modules/treemap.src.js - About 1 hr to fix

              Function drawPoints has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      drawPoints: function () {
                          var series = this,
                              points = grep(series.points, function (n) {
                                  return n.node.visible;
                              });
              Severity: Minor
              Found in assets/admin/global/plugins/highstock/js/modules/treemap.src.js - About 1 hr to fix

                Function translate has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        translate: function () {
                            var pointValues,
                                seriesArea,
                                tree,
                                val;
                Severity: Minor
                Found in assets/admin/global/plugins/highstock/js/modules/treemap.src.js - About 1 hr to fix

                  Function getTree has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          getTree: function () {
                              var tree,
                                  series = this,
                                  allIds = map(this.data, function (d) {
                                      return d.id;
                  Severity: Minor
                  Found in assets/admin/global/plugins/highstock/js/modules/treemap.src.js - About 1 hr to fix

                    Function setPointValues has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            setPointValues: function () {
                                var series = this,
                                    xAxis = series.xAxis,
                                    yAxis = series.yAxis;
                                each(series.points, function (point) {
                    Severity: Minor
                    Found in assets/admin/global/plugins/highstock/js/modules/treemap.src.js - About 1 hr to fix

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

                              calculateChildrenAreas: function (parent, area) {
                                  var series = this,
                                      options = series.options,
                                      level = this.levelMap[parent.levelDynamic + 1],
                                      algorithm = pick((series[level && level.layoutAlgorithm] && level.layoutAlgorithm), options.layoutAlgorithm),
                      Severity: Minor
                      Found in assets/admin/global/plugins/highstock/js/modules/treemap.src.js - About 1 hr to fix

                        Function buildNode has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                buildNode: function (id, i, level, list, parent) {
                        Severity: Minor
                        Found in assets/admin/global/plugins/highstock/js/modules/treemap.src.js - About 35 mins to fix

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

                          (function (H) {
                              var seriesTypes = H.seriesTypes,
                                  map = H.map,
                                  merge = H.merge,
                                  extend = H.extend,
                          assets/admin/global/plugins/highcharts/js/modules/treemap.src.js on lines 11..887
                          assets/admin/global/plugins/highmaps/js/modules/treemap.src.js on lines 11..887

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

                          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