QutBioacousticsResearchGroup/bioacoustic-workbench

View on GitHub
app/assets/javascripts/angular/controllers/experiments.js

Summary

Maintainability
F
1 wk
Test Coverage

Function VirtualBirdTourCtrl has 531 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function VirtualBirdTourCtrl($scope, $resource, $routeParams, $route, $http, Media, AudioEvent, Tag) {

            /*
             * TO DO:
             *  - choose more species
Severity: Major
Found in app/assets/javascripts/angular/controllers/experiments.js - About 2 days to fix

    File experiments.js has 968 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    "use strict";
    
    ;
    (function (undefined) {
        var app = angular.module('bawApp.controllers');
    Severity: Major
    Found in app/assets/javascripts/angular/controllers/experiments.js - About 2 days to fix

      Function RapidScanCtrl has 274 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function RapidScanCtrl($scope, $resource, $routeParams, $route, $http, $timeout, Media, AudioEvent, Tag) {
                  function ts() {
                      return (new Date()).toISOString();
                  }
      
      
      Severity: Major
      Found in app/assets/javascripts/angular/controllers/experiments.js - About 1 day to fix

        Function ExperimentsCtrl has 149 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    function ExperimentsCtrl($scope, $resource, $routeParams, $route, $http, Media, AudioEvent, Tag) {
        
                    $scope.PREFACE_STAGE = "Welcome";
                    $scope.EXPERIMENT_STAGE = "Activity";
                    $scope.FINAL_STAGE = "Conclusion";
        Severity: Major
        Found in app/assets/javascripts/angular/controllers/experiments.js - About 5 hrs to fix

          Function verifyPreface has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      $scope.verifyPreface = function verifyPreface() {
                          $scope.errors.length = 0;
          
                          if ($scope.results.consented !== true) {
                              $scope.errors.push("You must consent to participate in this experiment.");
          Severity: Minor
          Found in app/assets/javascripts/angular/controllers/experiments.js - About 1 hr to fix

            Function getLowestCountItem has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        $scope.getLowestCountItem = function (containingObject) {
                            console.log('called $scope.getLowestCountItem', containingObject);
                            // find minimum
                            var minCount = null;
                            angular.forEach(containingObject, function (value, key) {
            Severity: Minor
            Found in app/assets/javascripts/angular/controllers/experiments.js - About 1 hr to fix

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

                          function calculateFlashes() {
              
                              // work out the scale of flash cards that need to be shown
                              var adjustedPPS = PPS * $scope.stepResults.compression,
                                  segmentDuration = $scope.SPECTROGRAM_WIDTH / adjustedPPS;
              Severity: Minor
              Found in app/assets/javascripts/angular/controllers/experiments.js - About 1 hr to fix

                Function ensureMapDisplayedCorrectlyNoTimeout has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                            $scope.ensureMapDisplayedCorrectlyNoTimeout = function (map, latLng, zoom, marker, markerContent, markerTitle) {
                Severity: Minor
                Found in app/assets/javascripts/angular/controllers/experiments.js - About 45 mins to fix

                  Function ensureMapDisplayedCorrectly has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                              $scope.ensureMapDisplayedCorrectly = function (map, latLng, zoom, marker, markerContent, markerTitle) {
                  Severity: Minor
                  Found in app/assets/javascripts/angular/controllers/experiments.js - About 45 mins to fix

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

                                    if (value.stepType == STEP_TYPE_TRANSITION) {
                                        $scope.bigScope.results.order.push({
                                            index: index,
                                            fromLocationName: value.fromLocation ? value.fromLocation.name : null,
                                            fromLocationOrderIdentifier: value.fromLocation ? value.fromLocation.locationOrderIdentifier : null,
                    Severity: Major
                    Found in app/assets/javascripts/angular/controllers/experiments.js and 1 other location - About 4 hrs to fix
                    app/assets/javascripts/angular/controllers/experiments.js on lines 1247..1257

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

                    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

                                    } else if (value.stepType == STEP_TYPE_ACTIVITY) {
                                        $scope.bigScope.results.order.push({
                                            index: index,
                                            locationName: value.location ? value.location.name : null,
                                            locationOrderIdentifier: value.location ? value.location.locationOrderIdentifier : null,
                    Severity: Major
                    Found in app/assets/javascripts/angular/controllers/experiments.js and 1 other location - About 4 hrs to fix
                    app/assets/javascripts/angular/controllers/experiments.js on lines 1239..1257

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

                    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

                                    for (var verifyAnnotationIndex = 0; verifyAnnotationIndex < annotations.length; verifyAnnotationIndex++) {
                                        $scope.currentStepResults.annotationVerifyOrder.push({
                                            'index': verifyAnnotationIndex,
                                            'step': $scope.step,
                                            'annotationId': annotations[verifyAnnotationIndex].id,
                    Severity: Major
                    Found in app/assets/javascripts/angular/controllers/experiments.js and 1 other location - About 3 hrs to fix
                    app/assets/javascripts/angular/controllers/experiments.js on lines 892..900

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

                    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

                                    for (var exampleAnnotationIndex = 0; exampleAnnotationIndex < annotations.length; exampleAnnotationIndex++) {
                                        $scope.currentStepResults.annotationExampleOrder.push({
                                            'index': exampleAnnotationIndex,
                                            'step': $scope.step,
                                            'annotationId': annotations[exampleAnnotationIndex].id,
                    Severity: Major
                    Found in app/assets/javascripts/angular/controllers/experiments.js and 1 other location - About 3 hrs to fix
                    app/assets/javascripts/angular/controllers/experiments.js on lines 921..929

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

                    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

                                $scope.getTransitionMarkerDetails = function (locationName) {
                                    var found = $scope.transitionMarkers.filter(function (element, index, array) {
                                        return (element.locationName == locationName);
                                    });
                                    if (found.length == 1) {
                    Severity: Major
                    Found in app/assets/javascripts/angular/controllers/experiments.js and 3 other locations - About 2 hrs to fix
                    app/assets/javascripts/angular/controllers/experiments.js on lines 1002..1010
                    app/assets/javascripts/angular/controllers/experiments.js on lines 1026..1034
                    app/assets/javascripts/angular/controllers/experiments.js on lines 1036..1044

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

                    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

                                $scope.getLocationByOrderIdentifier = function (orderId) {
                                    var found = $scope.locations.filter(function (element, index, array) {
                                        return (element.locationOrderIdentifier == orderId);
                                    });
                                    if (found.length == 1) {
                    Severity: Major
                    Found in app/assets/javascripts/angular/controllers/experiments.js and 3 other locations - About 2 hrs to fix
                    app/assets/javascripts/angular/controllers/experiments.js on lines 1002..1010
                    app/assets/javascripts/angular/controllers/experiments.js on lines 1026..1034
                    app/assets/javascripts/angular/controllers/experiments.js on lines 1058..1066

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

                    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

                                $scope.getLocation = function (name) {
                                    var found = $scope.locations.filter(function (element, index, array) {
                                        return (element.name == name);
                                    });
                                    if (found.length == 1) {
                    Severity: Major
                    Found in app/assets/javascripts/angular/controllers/experiments.js and 3 other locations - About 2 hrs to fix
                    app/assets/javascripts/angular/controllers/experiments.js on lines 1026..1034
                    app/assets/javascripts/angular/controllers/experiments.js on lines 1036..1044
                    app/assets/javascripts/angular/controllers/experiments.js on lines 1058..1066

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

                    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

                                $scope.getSpeciesInfo = function (speciesCommonName) {
                                    var found = $scope.species.filter(function (element, index, array) {
                                        return (element.commonName == speciesCommonName);
                                    });
                                    if (found.length == 1) {
                    Severity: Major
                    Found in app/assets/javascripts/angular/controllers/experiments.js and 3 other locations - About 2 hrs to fix
                    app/assets/javascripts/angular/controllers/experiments.js on lines 1002..1010
                    app/assets/javascripts/angular/controllers/experiments.js on lines 1036..1044
                    app/assets/javascripts/angular/controllers/experiments.js on lines 1058..1066

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

                    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 dataSet = angular.copy(
                                        $scope.bigScope.spec.experimentSteps.filter(function (value) {
                                            return value.id === dsId;
                                        })[0]
                                    );
                    Severity: Major
                    Found in app/assets/javascripts/angular/controllers/experiments.js and 1 other location - About 1 hr to fix
                    app/assets/javascripts/angular/controllers/experiments.js on lines 322..326

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

                    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 speed = angular.copy(
                                        $scope.bigScope.spec.speeds.filter(function (value) {
                                            return value.speed === sId;
                                        })[0]
                                    );
                    Severity: Major
                    Found in app/assets/javascripts/angular/controllers/experiments.js and 1 other location - About 1 hr to fix
                    app/assets/javascripts/angular/controllers/experiments.js on lines 314..318

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

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

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

                                    if ($scope.results.email
                                        && $scope.results.email.length > 0
                                        && $scope.detailsForm.email.$valid
                                        ) {
                    
                    
                    Severity: Minor
                    Found in app/assets/javascripts/angular/controllers/experiments.js and 1 other location - About 35 mins to fix
                    app/assets/javascripts/angular/controllers/experiments.js on lines 135..143

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

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

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

                                    if ($scope.results.name
                                        && $scope.results.name.length > 0
                                        && $scope.detailsForm.fullName.$valid
                                        ) {
                    
                    
                    Severity: Minor
                    Found in app/assets/javascripts/angular/controllers/experiments.js and 1 other location - About 35 mins to fix
                    app/assets/javascripts/angular/controllers/experiments.js on lines 145..153

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

                    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

                                angular.forEach($scope.bigScope.spec.additionalResources.experimentCombinationCounts, function (value, key) {
                                    var c = value.count;
                                    if (minCount === null || c < minCount) {
                                        minCount = c;
                                    }
                    Severity: Minor
                    Found in app/assets/javascripts/angular/controllers/experiments.js and 1 other location - About 30 mins to fix
                    app/assets/javascripts/angular/controllers/experiments.js on lines 839..844

                    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

                                    angular.forEach(containingObject, function (value, key) {
                                        var c = value.count;
                                        if (minCount === null || c < minCount) {
                                            minCount = c;
                                        }
                    Severity: Minor
                    Found in app/assets/javascripts/angular/controllers/experiments.js and 1 other location - About 30 mins to fix
                    app/assets/javascripts/angular/controllers/experiments.js on lines 264..269

                    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