levent/agileista

View on GitHub
app/assets/javascripts/agileista_graphs.js

Summary

Maintainability
F
5 days
Test Coverage

Function AgileistaGraphs has 202 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var AgileistaGraphs = (function(){
  "use strict";

  var self = this ,

Severity: Major
Found in app/assets/javascripts/agileista_graphs.js - About 1 day to fix

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

        drawBurndown = function(startDate, endDate, spRemaining, spComplete, spHours) {
          $('#chart').html('');
          var margin = {top: 20, right: 50, bottom: 30, left: 50},
              width = 900 - margin.left - margin.right,
              height = 350 - margin.top - margin.bottom,
    Severity: Major
    Found in app/assets/javascripts/agileista_graphs.js - About 3 hrs to fix

      Function drawVelocity has 58 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          drawVelocity = function(data, average) {
            var margin = {top: 20, right: 20, bottom: 30, left: 50},
                width = 1200 - margin.left - margin.right,
                height = 300 - margin.top - margin.bottom;
      
      
      Severity: Major
      Found in app/assets/javascripts/agileista_graphs.js - About 2 hrs to fix

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

            init = function() {
        
              $(".close-bar").click(function() {
                $($(this).attr('data-target')).hide();
              });
        Severity: Minor
        Found in app/assets/javascripts/agileista_graphs.js - About 1 hr to fix

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

              drawBurndown = function(startDate, endDate, spRemaining, spComplete, spHours) {
          Severity: Minor
          Found in app/assets/javascripts/agileista_graphs.js - About 35 mins to fix

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

                init = function() {
            
                  $(".close-bar").click(function() {
                    $($(this).attr('data-target')).hide();
                  });
            Severity: Major
            Found in app/assets/javascripts/agileista_graphs.js and 1 other location - About 2 days to fix
            app/assets/javascripts/agileista.js on lines 46..86

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

            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

                  var line2 = d3.svg.line()
                              .x(function(d) { return x(d.date); })
                              .y(function(d) { return y2(d.hours_left); });
            Severity: Major
            Found in app/assets/javascripts/agileista_graphs.js and 2 other locations - About 1 hr to fix
            app/assets/javascripts/agileista_graphs.js on lines 64..66
            app/assets/javascripts/agileista_graphs.js on lines 161..163

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

            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

                  var line = d3.svg.line()
                              .x(function(d) { return x(d.end_at); })
                              .y(function(d) { return y(d.velocity); });
            Severity: Major
            Found in app/assets/javascripts/agileista_graphs.js and 2 other locations - About 1 hr to fix
            app/assets/javascripts/agileista_graphs.js on lines 64..66
            app/assets/javascripts/agileista_graphs.js on lines 67..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 68.

            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

                  var line = d3.svg.line()
                              .x(function(d) { return x(d.date); })
                              .y(function(d) { return y(d.story_points); });
            Severity: Major
            Found in app/assets/javascripts/agileista_graphs.js and 2 other locations - About 1 hr to fix
            app/assets/javascripts/agileista_graphs.js on lines 67..69
            app/assets/javascripts/agileista_graphs.js on lines 161..163

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

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

                  data.forEach(function(d) {
                    d.end_at = parseDate(d.end_at);
                    d.velocity = +d.velocity;
                  });
            Severity: Major
            Found in app/assets/javascripts/agileista_graphs.js and 4 other locations - About 55 mins to fix
            app/assets/javascripts/agileista_graphs.js on lines 49..52
            app/assets/javascripts/agileista_graphs.js on lines 54..57
            app/assets/javascripts/agileista_graphs.js on lines 59..62
            app/assets/javascripts/agileista_graphs.js on lines 156..159

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

                  spComplete.forEach(function(d) {
                    d.date = parseDate(d.date);
                    d.story_points = +d.story_points;
                  });
            Severity: Major
            Found in app/assets/javascripts/agileista_graphs.js and 4 other locations - About 55 mins to fix
            app/assets/javascripts/agileista_graphs.js on lines 54..57
            app/assets/javascripts/agileista_graphs.js on lines 59..62
            app/assets/javascripts/agileista_graphs.js on lines 152..155
            app/assets/javascripts/agileista_graphs.js on lines 156..159

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

                  spRemaining.forEach(function(d) {
                    d.date = parseDate(d.date);
                    d.story_points = +d.story_points;
                  });
            Severity: Major
            Found in app/assets/javascripts/agileista_graphs.js and 4 other locations - About 55 mins to fix
            app/assets/javascripts/agileista_graphs.js on lines 49..52
            app/assets/javascripts/agileista_graphs.js on lines 59..62
            app/assets/javascripts/agileista_graphs.js on lines 152..155
            app/assets/javascripts/agileista_graphs.js on lines 156..159

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

                  spHours.forEach(function(d) {
                    d.date = parseDate(d.date);
                    d.hours_left = +d.hours_left;
                  });
            Severity: Major
            Found in app/assets/javascripts/agileista_graphs.js and 4 other locations - About 55 mins to fix
            app/assets/javascripts/agileista_graphs.js on lines 49..52
            app/assets/javascripts/agileista_graphs.js on lines 54..57
            app/assets/javascripts/agileista_graphs.js on lines 152..155
            app/assets/javascripts/agileista_graphs.js on lines 156..159

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

                  average.forEach(function(d) {
                    d.end_at = parseDate(d.end_at);
                    d.velocity = +d.velocity;
                  });
            Severity: Major
            Found in app/assets/javascripts/agileista_graphs.js and 4 other locations - About 55 mins to fix
            app/assets/javascripts/agileista_graphs.js on lines 49..52
            app/assets/javascripts/agileista_graphs.js on lines 54..57
            app/assets/javascripts/agileista_graphs.js on lines 59..62
            app/assets/javascripts/agileista_graphs.js on lines 152..155

            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

                  mySVG.append("g")
                      .attr("class", "y axis")
                      .call(yAxis)
                    .append("text")
                      .attr("transform", "rotate(-90)")
            Severity: Minor
            Found in app/assets/javascripts/agileista_graphs.js and 1 other location - About 40 mins to fix
            app/assets/javascripts/agileista_graphs.js on lines 90..95

            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

                  mySVG.append("g")
                      .attr("class", "y axis")
                      .call(yAxis)
                    .append("text")
                      .attr("transform", "rotate(-90)")
            Severity: Minor
            Found in app/assets/javascripts/agileista_graphs.js and 1 other location - About 40 mins to fix
            app/assets/javascripts/agileista_graphs.js on lines 184..189

            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

                  mySVG.append("g")
                      .attr("class", "x axis")
                      .attr("transform", "translate(0," + height + ")")
                      .call(xAxis);
            Severity: Minor
            Found in app/assets/javascripts/agileista_graphs.js and 1 other location - About 30 mins to fix
            app/assets/javascripts/agileista_graphs.js on lines 179..182

            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

                  mySVG.append("g")
                      .attr("class", "x axis")
                      .attr("transform", "translate(0," + height + ")")
                      .call(xAxis);
            Severity: Minor
            Found in app/assets/javascripts/agileista_graphs.js and 1 other location - About 30 mins to fix
            app/assets/javascripts/agileista_graphs.js on lines 85..88

            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

            There are no issues that match your filters.

            Category
            Status