ethanhann/Diagrammatica

View on GitHub

Showing 69 of 69 total issues

Function LineBase has 433 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function LineBase(selection, data) {
    var self = this;
    self.data = data;
    selection = this.selection = isD3Selection(selection) ? selection : d3.select(selection);
    var chart = this.chart = new ChartBase(selection, 'line');
Severity: Major
Found in src/js/line.js - About 2 days to fix

    File line.js has 669 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    'use strict';
    /* global d3: false, ChartBase, tooltip, isD3Selection: false, Preview */
    /* exported line */
    
    function LineBase(selection, data) {
    Severity: Major
    Found in src/js/line.js - About 1 day to fix

      Function line has 191 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var line = function (selection, data) {
          var lineBase = new LineBase(selection, data);
          var chart = lineBase.chart;
          var config = chart.config;
          var preview = lineBase.preview;
      Severity: Major
      Found in src/js/line.js - About 7 hrs to fix

        Function LineBase has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
        Open

        function LineBase(selection, data) {
            var self = this;
            self.data = data;
            selection = this.selection = isD3Selection(selection) ? selection : d3.select(selection);
            var chart = this.chart = new ChartBase(selection, 'line');
        Severity: Minor
        Found in src/js/line.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 exports has 131 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function (grunt) {
            require('load-grunt-tasks')(grunt);
            require('time-grunt')(grunt);
        
            grunt.initConfig({
        Severity: Major
        Found in Gruntfile.js - About 5 hrs to fix

          Function update has 128 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function update(newData) {
                  data = !check.undefined(newData) ? newData : data;
                  // Rescale
                  chart.xScale.domain([
                      d3.min(data, function (series) {
          Severity: Major
          Found in src/js/line.js - About 5 hrs to fix

            Function renderTooltip has 89 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                var renderTooltip = this.renderTooltip = function (data) {
                    hoverLine.attr('y2', config.paddedHeight());
                    tooltipRectangleGroup.selectAll('.tooltip-rect').remove();
                    var xValueSet = d3.set(data.map(function (d) {
                        return d.data;
            Severity: Major
            Found in src/js/line.js - About 3 hrs to fix

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

                  chart.yScale.domain([
                      d3.min(data, function (series) {
                          return d3.min(series.data, function (d) {
                              return d.y;
                          });
              Severity: Major
              Found in src/js/line.js and 2 other locations - About 3 hrs to fix
              src/js/line.js on lines 44..55
              src/js/line.js on lines 351..362

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

              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 3 locations. Consider refactoring.
              Open

                  chart.xScale.domain([
                      d3.min(data, function (series) {
                          return d3.min(series.data, function (d) {
                              return d.x;
                          });
              Severity: Major
              Found in src/js/line.js and 2 other locations - About 3 hrs to fix
              src/js/line.js on lines 56..67
              src/js/line.js on lines 351..362

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

              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 3 locations. Consider refactoring.
              Open

                      chart.yScale.domain([
                          d3.min(selectedSeries, function (series) {
                              return d3.min(series.data, function (t) {
                                  return t.y;
                              });
              Severity: Major
              Found in src/js/line.js and 2 other locations - About 3 hrs to fix
              src/js/line.js on lines 44..55
              src/js/line.js on lines 56..67

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

              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

              Function pie has 83 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              var pie = function (selection, data) {
                  selection = this.selection = isD3Selection(selection) ? selection : d3.select(selection);
                  var chart = new ChartBase(selection, 'pie');
                  var config = chart.config;
                  chart.updateDimensions = function () {
              Severity: Major
              Found in src/js/pie.js - About 3 hrs to fix

                File heat-map.js has 294 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                'use strict';
                /* global d3: false, check: false, ChartBase, isD3Selection: false, moment: false */
                /* exported heatMap */
                var HeatMapBase = function (selection, data) {
                    this.data = data;
                Severity: Minor
                Found in src/js/heat-map.js - About 3 hrs to fix

                  Function renderRectangles has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  HeatMapBase.prototype.renderRectangles = function () {
                      var chart = this.chart;
                      var cellHeight = this.cellHeight;
                      var cellWidth = this.cellWidth;
                      var categories = this.categories;
                  Severity: Major
                  Found in src/js/heat-map.js - About 2 hrs to fix

                    Function renderLegend has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        var renderLegend = this.renderLegend = function (data) {
                            var newdata = data;
                            var legendItems = legendGroup.selectAll('g')
                                .data(data)
                                .enter()
                    Severity: Major
                    Found in src/js/line.js - About 2 hrs to fix

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

                              barTransition
                                  .attr('y', function (d) {
                                      return chart.xScale(d.name);
                                  })
                                  .attr('width', function (d) {
                      Severity: Major
                      Found in src/js/bar.js and 1 other location - About 2 hrs to fix
                      src/js/bar.js on lines 166..173

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

                      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

                              barTransition
                                  .attr('x', function (d) {
                                      return chart.xScale(d.name);
                                  })
                                  .attr('y', function (d) {
                      Severity: Major
                      Found in src/js/bar.js and 1 other location - About 2 hrs to fix
                      src/js/bar.js on lines 157..164

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

                      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

                      Function heatMap has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      var heatMap = function (selection, data) {
                          var heatMapBase = new HeatMapBase(selection, data).render();
                          var chart = heatMapBase.chart;
                          var update = heatMapBase.chart.update = function (newData) {
                              data = heatMapBase.data = !check.undefined(newData) ? newData : heatMapBase.data;
                      Severity: Major
                      Found in src/js/heat-map.js - About 2 hrs to fix

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

                                series.selectAll('.dots')
                                    .data(function (d) {
                                        d.data.map(function (p) {
                                            p.name = d.name;
                                        });
                        Severity: Major
                        Found in src/js/line.js and 1 other location - About 2 hrs to fix
                        src/js/line.js on lines 170..177

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

                        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

                            var dots = series.selectAll('dots')
                                .data(function (d) {
                                    d.data.map(function (p) {
                                        p.name = d.name;
                                    });
                        Severity: Major
                        Found in src/js/line.js and 1 other location - About 2 hrs to fix
                        src/js/line.js on lines 603..611

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

                        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

                        Function bar has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        var bar = function (selection, data, orientation) {
                            var barBase = new BarBase(selection, data, orientation).render();
                            var chart = barBase.chart;
                            var config = barBase.config;
                            var updateX = barBase.updateX;
                        Severity: Major
                        Found in src/js/bar.js - About 2 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language