QutBioacousticsResearchGroup/bioacoustic-workbench

View on GitHub

Showing 184 of 184 total issues

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

function LoginCtrl($scope, $http, $location, authService, AuthenticationProviders, Authenticator) {
Severity: Minor
Found in app/assets/javascripts/angular/controllers/login.js - About 45 mins 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 setBox has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          methods.setBox = function setBox(id, top, left, height, width, selected) {
      Severity: Minor
      Found in lib/assets/javascripts/jquery.drawabox.js - About 45 mins to fix

        Method download has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def download
        
            project_id = nil
            if params[:project_id]
              project_id = Integer(params[:project_id].to_s, 10)
        Severity: Minor
        Found in app/controllers/audio_events_controller.rb - About 45 mins 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

        Method run_once has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def run_once(script_name, script_version, script_content, script_file, script_settings, audio_full_paths)
        Severity: Minor
        Found in lib/external/analysis_runner.rb - About 45 mins to fix

          Method generate_spectrogram has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            def self.generate_spectrogram(modify_parameters = {})
          
              # first check if a cached spectrogram matches the request
          
              target_file = Cache::cached_spectrogram_file modify_parameters
          Severity: Minor
          Found in lib/modules/file_cacher.rb - About 45 mins 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

          Method create_new_audiorecording has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def create_new_audiorecording(post_params)
                Net::HTTP.start(@host, @port) do |http|
          
                  auth_token = request_login(http)
          
          Severity: Minor
          Found in lib/external/audio_harvester.rb - About 45 mins 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 whenDefaults has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              function whenDefaults(resourceName, singularResourceName, id, controllerMany, controllerOne) {
          Severity: Minor
          Found in app/assets/javascripts/app.js - About 35 mins to fix

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

              def create
                @analysis_script = AnalysisScript.new(params[:analysis_script])
            
                respond_to do |format|
                  if @analysis_script.save
            Severity: Major
            Found in app/controllers/analysis_scripts_controller.rb and 13 other locations - About 35 mins to fix
            app/controllers/analysis_items_controller.rb on lines 39..46
            app/controllers/analysis_jobs_controller.rb on lines 39..46
            app/controllers/audio_events_controller.rb on lines 39..46
            app/controllers/audio_recordings_controller.rb on lines 50..57
            app/controllers/bookmarks_controller.rb on lines 39..46
            app/controllers/permissions_controller.rb on lines 39..46
            app/controllers/photos_controller.rb on lines 42..49
            app/controllers/progresses_controller.rb on lines 39..46
            app/controllers/projects_controller.rb on lines 36..43
            app/controllers/saved_searches_controller.rb on lines 39..46
            app/controllers/sites_controller.rb on lines 39..46
            app/controllers/tags_controller.rb on lines 34..41
            app/controllers/users_controller.rb on lines 39..46

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

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

              def create
                @photo = Photo.new(params[:photo])
            
                respond_to do |format|
                  if @photo.save
            Severity: Major
            Found in app/controllers/photos_controller.rb and 13 other locations - About 35 mins to fix
            app/controllers/analysis_items_controller.rb on lines 39..46
            app/controllers/analysis_jobs_controller.rb on lines 39..46
            app/controllers/analysis_scripts_controller.rb on lines 39..46
            app/controllers/audio_events_controller.rb on lines 39..46
            app/controllers/audio_recordings_controller.rb on lines 50..57
            app/controllers/bookmarks_controller.rb on lines 39..46
            app/controllers/permissions_controller.rb on lines 39..46
            app/controllers/progresses_controller.rb on lines 39..46
            app/controllers/projects_controller.rb on lines 36..43
            app/controllers/saved_searches_controller.rb on lines 39..46
            app/controllers/sites_controller.rb on lines 39..46
            app/controllers/tags_controller.rb on lines 34..41
            app/controllers/users_controller.rb on lines 39..46

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

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

              def create
                @project = Project.new(params[:project])
            
                respond_to do |format|
                  if @project.save
            Severity: Major
            Found in app/controllers/projects_controller.rb and 13 other locations - About 35 mins to fix
            app/controllers/analysis_items_controller.rb on lines 39..46
            app/controllers/analysis_jobs_controller.rb on lines 39..46
            app/controllers/analysis_scripts_controller.rb on lines 39..46
            app/controllers/audio_events_controller.rb on lines 39..46
            app/controllers/audio_recordings_controller.rb on lines 50..57
            app/controllers/bookmarks_controller.rb on lines 39..46
            app/controllers/permissions_controller.rb on lines 39..46
            app/controllers/photos_controller.rb on lines 42..49
            app/controllers/progresses_controller.rb on lines 39..46
            app/controllers/saved_searches_controller.rb on lines 39..46
            app/controllers/sites_controller.rb on lines 39..46
            app/controllers/tags_controller.rb on lines 34..41
            app/controllers/users_controller.rb on lines 39..46

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

            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

            Method record_file_move has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def record_file_move(create_result_params)
                  Net::HTTP.start(@host, @port) do |http|
            
                    auth_token = request_login(http)
            
            Severity: Minor
            Found in lib/external/audio_harvester.rb - About 35 mins 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

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

              def create
                @saved_search = SavedSearch.new(params[:saved_search])
            
                respond_to do |format|
                  if @saved_search.save
            Severity: Major
            Found in app/controllers/saved_searches_controller.rb and 13 other locations - About 35 mins to fix
            app/controllers/analysis_items_controller.rb on lines 39..46
            app/controllers/analysis_jobs_controller.rb on lines 39..46
            app/controllers/analysis_scripts_controller.rb on lines 39..46
            app/controllers/audio_events_controller.rb on lines 39..46
            app/controllers/audio_recordings_controller.rb on lines 50..57
            app/controllers/bookmarks_controller.rb on lines 39..46
            app/controllers/permissions_controller.rb on lines 39..46
            app/controllers/photos_controller.rb on lines 42..49
            app/controllers/progresses_controller.rb on lines 39..46
            app/controllers/projects_controller.rb on lines 36..43
            app/controllers/sites_controller.rb on lines 39..46
            app/controllers/tags_controller.rb on lines 34..41
            app/controllers/users_controller.rb on lines 39..46

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

            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

            Method build_parameters has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

              def self.build_parameters(parameter_names = [], modify_parameters = {})
            
                file_name = ''
                
                parameter_names.each do |param| 
            Severity: Minor
            Found in lib/modules/cache.rb - About 35 mins 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

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

              def create
                @tag = Tag.new(params[:tag])
            
                respond_to do |format|
                  if @tag.save
            Severity: Major
            Found in app/controllers/tags_controller.rb and 13 other locations - About 35 mins to fix
            app/controllers/analysis_items_controller.rb on lines 39..46
            app/controllers/analysis_jobs_controller.rb on lines 39..46
            app/controllers/analysis_scripts_controller.rb on lines 39..46
            app/controllers/audio_events_controller.rb on lines 39..46
            app/controllers/audio_recordings_controller.rb on lines 50..57
            app/controllers/bookmarks_controller.rb on lines 39..46
            app/controllers/permissions_controller.rb on lines 39..46
            app/controllers/photos_controller.rb on lines 42..49
            app/controllers/progresses_controller.rb on lines 39..46
            app/controllers/projects_controller.rb on lines 36..43
            app/controllers/saved_searches_controller.rb on lines 39..46
            app/controllers/sites_controller.rb on lines 39..46
            app/controllers/users_controller.rb on lines 39..46

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

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

              def create
                @bookmark = Bookmark.new(params[:bookmark])
            
                respond_to do |format|
                  if @bookmark.save
            Severity: Major
            Found in app/controllers/bookmarks_controller.rb and 13 other locations - About 35 mins to fix
            app/controllers/analysis_items_controller.rb on lines 39..46
            app/controllers/analysis_jobs_controller.rb on lines 39..46
            app/controllers/analysis_scripts_controller.rb on lines 39..46
            app/controllers/audio_events_controller.rb on lines 39..46
            app/controllers/audio_recordings_controller.rb on lines 50..57
            app/controllers/permissions_controller.rb on lines 39..46
            app/controllers/photos_controller.rb on lines 42..49
            app/controllers/progresses_controller.rb on lines 39..46
            app/controllers/projects_controller.rb on lines 36..43
            app/controllers/saved_searches_controller.rb on lines 39..46
            app/controllers/sites_controller.rb on lines 39..46
            app/controllers/tags_controller.rb on lines 34..41
            app/controllers/users_controller.rb on lines 39..46

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

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

              def create
                @analysis_item = AnalysisItem.new(params[:analysis_item])
            
                respond_to do |format|
                  if @analysis_item.save
            Severity: Major
            Found in app/controllers/analysis_items_controller.rb and 13 other locations - About 35 mins to fix
            app/controllers/analysis_jobs_controller.rb on lines 39..46
            app/controllers/analysis_scripts_controller.rb on lines 39..46
            app/controllers/audio_events_controller.rb on lines 39..46
            app/controllers/audio_recordings_controller.rb on lines 50..57
            app/controllers/bookmarks_controller.rb on lines 39..46
            app/controllers/permissions_controller.rb on lines 39..46
            app/controllers/photos_controller.rb on lines 42..49
            app/controllers/progresses_controller.rb on lines 39..46
            app/controllers/projects_controller.rb on lines 36..43
            app/controllers/saved_searches_controller.rb on lines 39..46
            app/controllers/sites_controller.rb on lines 39..46
            app/controllers/tags_controller.rb on lines 34..41
            app/controllers/users_controller.rb on lines 39..46

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

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

              def create
                @site = Site.new(params[:site])
            
                respond_to do |format|
                  if @site.save
            Severity: Major
            Found in app/controllers/sites_controller.rb and 13 other locations - About 35 mins to fix
            app/controllers/analysis_items_controller.rb on lines 39..46
            app/controllers/analysis_jobs_controller.rb on lines 39..46
            app/controllers/analysis_scripts_controller.rb on lines 39..46
            app/controllers/audio_events_controller.rb on lines 39..46
            app/controllers/audio_recordings_controller.rb on lines 50..57
            app/controllers/bookmarks_controller.rb on lines 39..46
            app/controllers/permissions_controller.rb on lines 39..46
            app/controllers/photos_controller.rb on lines 42..49
            app/controllers/progresses_controller.rb on lines 39..46
            app/controllers/projects_controller.rb on lines 36..43
            app/controllers/saved_searches_controller.rb on lines 39..46
            app/controllers/tags_controller.rb on lines 34..41
            app/controllers/users_controller.rb on lines 39..46

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

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

              def create
                @audio_event = AudioEvent.new(params[:audio_event])
            
                respond_to do |format|
                  if @audio_event.save
            Severity: Major
            Found in app/controllers/audio_events_controller.rb and 13 other locations - About 35 mins to fix
            app/controllers/analysis_items_controller.rb on lines 39..46
            app/controllers/analysis_jobs_controller.rb on lines 39..46
            app/controllers/analysis_scripts_controller.rb on lines 39..46
            app/controllers/audio_recordings_controller.rb on lines 50..57
            app/controllers/bookmarks_controller.rb on lines 39..46
            app/controllers/permissions_controller.rb on lines 39..46
            app/controllers/photos_controller.rb on lines 42..49
            app/controllers/progresses_controller.rb on lines 39..46
            app/controllers/projects_controller.rb on lines 36..43
            app/controllers/saved_searches_controller.rb on lines 39..46
            app/controllers/sites_controller.rb on lines 39..46
            app/controllers/tags_controller.rb on lines 34..41
            app/controllers/users_controller.rb on lines 39..46

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

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

              def create
                @progress = Progress.new(params[:progress])
            
                respond_to do |format|
                  if @progress.save
            Severity: Major
            Found in app/controllers/progresses_controller.rb and 13 other locations - About 35 mins to fix
            app/controllers/analysis_items_controller.rb on lines 39..46
            app/controllers/analysis_jobs_controller.rb on lines 39..46
            app/controllers/analysis_scripts_controller.rb on lines 39..46
            app/controllers/audio_events_controller.rb on lines 39..46
            app/controllers/audio_recordings_controller.rb on lines 50..57
            app/controllers/bookmarks_controller.rb on lines 39..46
            app/controllers/permissions_controller.rb on lines 39..46
            app/controllers/photos_controller.rb on lines 42..49
            app/controllers/projects_controller.rb on lines 36..43
            app/controllers/saved_searches_controller.rb on lines 39..46
            app/controllers/sites_controller.rb on lines 39..46
            app/controllers/tags_controller.rb on lines 34..41
            app/controllers/users_controller.rb on lines 39..46

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

            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

            Severity
            Category
            Status
            Source
            Language