freakimkaefig/Music-XML-Analyzer

View on GitHub
public/js/views/DashboardView.js

Summary

Maintainability
F
1 wk
Test Coverage

Function DashboardView has 387 lines of code (exceeds 25 allowed). Consider refactoring.
Open

MusicXMLAnalyzer.DashboardView = function(){

    var that = {},

    $logMessages = null,
Severity: Major
Found in public/js/views/DashboardView.js - About 1 day to fix

    File DashboardView.js has 389 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /** @constructor */
    MusicXMLAnalyzer.DashboardView = function(){
    
        var that = {},
    
    
    Severity: Minor
    Found in public/js/views/DashboardView.js - About 5 hrs to fix

      Function initIntervalDistribution has 65 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          initIntervalDistribution = function(data) {
              $('#bar_intervalDistribution').empty();
              var containerWidth = $('#bar_intervalDistribution').width() - 30;
              var margin ={ top:20, right:30, bottom:130, left: 40 },
                  width = containerWidth - margin.left - margin.right,
      Severity: Major
      Found in public/js/views/DashboardView.js - About 2 hrs to fix

        Function initNoteDistribution has 62 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            initNoteDistribution = function(data) {
                $('#bar_noteDistribution').empty();
                var containerWidth = $('#bar_noteDistribution').width() - 30;
                var margin ={ top:20, right:30, bottom:50, left: 40 },
                    width = containerWidth - margin.left - margin.right,
        Severity: Major
        Found in public/js/views/DashboardView.js - About 2 hrs to fix

          Function DashboardView has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

          MusicXMLAnalyzer.DashboardView = function(){
          
              var that = {},
          
              $logMessages = null,
          Severity: Minor
          Found in public/js/views/DashboardView.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 initMeterDistribution has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              initMeterDistribution = function(data) {
                  var data2;
                  if(typeof(data) == 'string'){
                      data2 = [{label: data, value: 1}];
                  }else{
          Severity: Minor
          Found in public/js/views/DashboardView.js - About 1 hr to fix

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

                initKeyDistribution = function(data) {
                    if (keyDistribution) {
                        keyDistribution.destroy();
                    }
                    keyDistribution = new d3pie("pie_keyDistribution", {
            Severity: Minor
            Found in public/js/views/DashboardView.js - About 1 hr to fix

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

                  initNoteTypeDistribution = function(data) {
                      if (noteTypeDistribution) {
                          noteTypeDistribution.destroy();
                      }
                      noteTypeDistribution = new d3pie("pie_noteTypeDistribution", {
              Severity: Minor
              Found in public/js/views/DashboardView.js - About 1 hr to fix

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

                    initKeyDistribution = function(data) {
                        if (keyDistribution) {
                            keyDistribution.destroy();
                        }
                        keyDistribution = new d3pie("pie_keyDistribution", {
                Severity: Major
                Found in public/js/views/DashboardView.js and 1 other location - About 6 hrs to fix
                public/js/views/DashboardView.js on lines 461..490

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

                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

                    initNoteTypeDistribution = function(data) {
                        if (noteTypeDistribution) {
                            noteTypeDistribution.destroy();
                        }
                        noteTypeDistribution = new d3pie("pie_noteTypeDistribution", {
                Severity: Major
                Found in public/js/views/DashboardView.js and 1 other location - About 6 hrs to fix
                public/js/views/DashboardView.js on lines 423..452

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

                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

                        svg.selectAll(".bar")
                           .data(data)
                           .enter()
                           .append("rect")
                           .attr("class", "bar")
                Severity: Major
                Found in public/js/views/DashboardView.js and 1 other location - About 5 hrs to fix
                public/js/views/DashboardView.js on lines 299..307

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

                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

                        svg.selectAll(".bar")
                           .data(data)
                           .enter()
                           .append("rect")
                           .attr("class", "bar")
                Severity: Major
                Found in public/js/views/DashboardView.js and 1 other location - About 5 hrs to fix
                public/js/views/DashboardView.js on lines 394..402

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

                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

                           svg.selectAll("text.bar")
                            .data(data)
                            .enter()
                            .append("text")
                            .attr("class", "bar-value")
                Severity: Major
                Found in public/js/views/DashboardView.js and 1 other location - About 4 hrs to fix
                public/js/views/DashboardView.js on lines 310..319

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

                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

                           svg.selectAll("text.bar")
                            .data(data)
                            .enter()
                            .append("text")
                            .attr("class", "bar-value")
                Severity: Major
                Found in public/js/views/DashboardView.js and 1 other location - About 4 hrs to fix
                public/js/views/DashboardView.js on lines 404..413

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

                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

                    addLogMessage = function(msg) {
                        $('#log' + (dashboardMessageCounter - 3)).animate({
                            "marginTop": "-30px"
                        }, 200);
                        $logMessages.append('<div id="log' + dashboardMessageCounter + '"></div>');
                Severity: Major
                Found in public/js/views/DashboardView.js and 2 other locations - About 4 hrs to fix
                public/js/views/PatternView.js on lines 450..463
                public/js/views/ResultView.js on lines 863..876

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

                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 svg = d3.select("#bar_noteDistribution")
                                      .append("svg")  //append svg element inside #bar_noteDistribution
                                      .attr("width", width+(2*margin.left)+margin.right)    //set width
                                      .attr("height", height+margin.top+margin.bottom)  //set height
                                      .append("g")
                Severity: Major
                Found in public/js/views/DashboardView.js and 1 other location - About 4 hrs to fix
                public/js/views/DashboardView.js on lines 354..359

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

                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 svg = d3.select("#bar_intervalDistribution")
                                      .append("svg")  //append svg element inside #bar_intervalDistribution
                                      .attr("width", width+(2*margin.left)+margin.right)    //set width
                                      .attr("height", height+margin.top+margin.bottom)  //set height
                                      .append("g")
                Severity: Major
                Found in public/js/views/DashboardView.js and 1 other location - About 4 hrs to fix
                public/js/views/DashboardView.js on lines 263..268

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

                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

                        svg.append("text")
                            .attr("x", (width / 2))
                            .attr("y", 0 - (margin.top / 2) - 20)
                            .attr("text-anchor", "middle")
                            .style("font-size", "23px")
                Severity: Major
                Found in public/js/views/DashboardView.js and 1 other location - About 3 hrs to fix
                public/js/views/DashboardView.js on lines 290..297

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

                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

                        svg.append("text")
                            .attr("x", (width / 2))
                            .attr("y", 0 - (margin.top / 2) -20)
                            .attr("text-anchor", "middle")
                            .style("font-size", "23px")
                Severity: Major
                Found in public/js/views/DashboardView.js and 1 other location - About 3 hrs to fix
                public/js/views/DashboardView.js on lines 385..392

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

                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

                        svg.append("g")
                             .attr("class", "y axis")
                             .attr("transform", "translate(0,0)")
                             .call(yAxis)
                             .append("text")
                Severity: Major
                Found in public/js/views/DashboardView.js and 1 other location - About 2 hrs to fix
                public/js/views/DashboardView.js on lines 374..383

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

                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

                        svg.append("g")
                             .attr("class", "y axis")
                             .attr("transform", "translate(0,0)")
                             .call(yAxis)
                             .append("text")
                Severity: Major
                Found in public/js/views/DashboardView.js and 1 other location - About 2 hrs to fix
                public/js/views/DashboardView.js on lines 279..288

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

                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 margin ={ top:20, right:30, bottom:50, left: 40 },
                            width = containerWidth - margin.left - margin.right,
                            height= 300 - margin.top - margin.bottom +30;
                Severity: Major
                Found in public/js/views/DashboardView.js and 1 other location - About 2 hrs to fix
                public/js/views/DashboardView.js on lines 333..335

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

                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 margin ={ top:20, right:30, bottom:130, left: 40 },
                            width = containerWidth - margin.left - margin.right,
                            height= 300 - margin.top - margin.bottom+80;
                Severity: Major
                Found in public/js/views/DashboardView.js and 1 other location - About 2 hrs to fix
                public/js/views/DashboardView.js on lines 242..244

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

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

                    disposeLogMessages = function() {
                        window.setTimeout(function() {
                            $logMessages.animate({
                                height: 0
                            },
                Severity: Major
                Found in public/js/views/DashboardView.js and 3 other locations - About 1 hr to fix
                public/js/views/PatternView.js on lines 430..441
                public/js/views/ResultView.js on lines 842..853
                public/js/views/UploadView.js on lines 185..196

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

                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