SpeciesFileGroup/taxonworks

View on GitHub
app/controllers/taxon_names_controller.rb

Summary

Maintainability
D
1 day
Test Coverage

Class TaxonNamesController has 31 methods (exceeds 20 allowed). Consider refactoring.
Open

class TaxonNamesController < ApplicationController
  include DataControllerConfiguration::ProjectDataControllerConfiguration

  before_action :set_taxon_name, only: [:show, :edit, :update, :destroy, :browse, :original_combination, :catalog, :api_show]
  after_action -> { set_pagination_headers(:taxon_names) }, only: [:index, :api_index], if: :json_request?
Severity: Minor
Found in app/controllers/taxon_names_controller.rb - About 3 hrs to fix

    File taxon_names_controller.rb has 297 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    class TaxonNamesController < ApplicationController
      include DataControllerConfiguration::ProjectDataControllerConfiguration
    
      before_action :set_taxon_name, only: [:show, :edit, :update, :destroy, :browse, :original_combination, :catalog, :api_show]
      after_action -> { set_pagination_headers(:taxon_names) }, only: [:index, :api_index], if: :json_request?
    Severity: Minor
    Found in app/controllers/taxon_names_controller.rb - About 3 hrs to fix

      Method has too many lines. [35/25]
      Open

        def filter_params
          params.permit(
            :ancestors,
            :author,
            :authors,

      This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

      Method has too many lines. [29/25]
      Open

        def api_params
          params.permit(
            :ancestors,
            :author,
            :authors,

      This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

      Method filter_params has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def filter_params
          params.permit(
            :ancestors,
            :author,
            :authors,
      Severity: Minor
      Found in app/controllers/taxon_names_controller.rb - About 1 hr to fix

        Method api_params has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def api_params
            params.permit(
              :ancestors,
              :author,
              :authors,
        Severity: Minor
        Found in app/controllers/taxon_names_controller.rb - About 1 hr to fix

          Method create_simple_batch_load has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

            def create_simple_batch_load
              if params[:file] && digested_cookie_exists?(params[:file].tempfile, :simple_taxon_names_md5)
                @result =  BatchLoad::Import::TaxonifiToTaxonworks.new(**batch_params)
                if @result.create
                  flash[:notice] = "Successfully proccessed file, #{@result.total_records_created} taxon names were created."
          Severity: Minor
          Found in app/controllers/taxon_names_controller.rb - About 25 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_castor_batch_load has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

            def create_castor_batch_load
              if params[:file] && digested_cookie_exists?(params[:file].tempfile, :Castor_taxon_names_md5)
                @result = BatchLoad::Import::TaxonNames::CastorInterpreter.new(**batch_params)
                if @result.create
                  flash[:notice] = "Successfully proccessed file, #{@result.total_records_created} items were created."
          Severity: Minor
          Found in app/controllers/taxon_names_controller.rb - About 25 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

          browse, catalog are not explicitly defined on the class.
          Open

            before_action :set_taxon_name, only: [:show, :edit, :update, :destroy, :browse, :original_combination, :catalog, :api_show]

          This cop checks that methods specified in the filter's only or except options are defined within the same class or module.

          You can technically specify methods of superclass or methods added by mixins on the filter, but these can confuse developers. If you specify methods that are defined in other classes or modules, you should define the filter in that class or module.

          If you rely on behaviour defined in the superclass actions, you must remember to invoke super in the subclass actions.

          Example:

          # bad
          class LoginController < ApplicationController
            before_action :require_login, only: %i[index settings logout]
          
            def index
            end
          end
          
          # good
          class LoginController < ApplicationController
            before_action :require_login, only: %i[index settings logout]
          
            def index
            end
          
            def settings
            end
          
            def logout
            end
          end

          Example:

          # bad
          module FooMixin
            extend ActiveSupport::Concern
          
            included do
              before_action proc { authenticate }, only: :foo
            end
          end
          
          # good
          module FooMixin
            extend ActiveSupport::Concern
          
            included do
              before_action proc { authenticate }, only: :foo
            end
          
            def foo
              # something
            end
          end

          Example:

          class ContentController < ApplicationController
            def update
              @content.update(content_attributes)
            end
          end
          
          class ArticlesController < ContentController
            before_action :load_article, only: [:update]
          
            # the cop requires this method, but it relies on behaviour defined
            # in the superclass, so needs to invoke `super`
            def update
              super
            end
          
            private
          
            def load_article
              @content = Article.find(params[:article_id])
            end
          end

          create returns a model which is always truthy.
          Open

                if @result.create

          This cop identifies possible cases where Active Record save! or related should be used instead of save because the model might have failed to save and an exception is better than unhandled failure.

          This will allow: - update or save calls, assigned to a variable, or used as a condition in an if/unless/case statement. - create calls, assigned to a variable that then has a call to persisted?. - calls if the result is explicitly returned from methods and blocks, or provided as arguments. - calls whose signature doesn't look like an ActiveRecord persistence method.

          By default it will also allow implicit returns from methods and blocks. that behavior can be turned off with AllowImplicitReturn: false.

          You can permit receivers that are giving false positives with AllowedReceivers: []

          Example:

          # bad
          user.save
          user.update(name: 'Joe')
          user.find_or_create_by(name: 'Joe')
          user.destroy
          
          # good
          unless user.save
            # ...
          end
          user.save!
          user.update!(name: 'Joe')
          user.find_or_create_by!(name: 'Joe')
          user.destroy!
          
          user = User.find_or_create_by(name: 'Joe')
          unless user.persisted?
            # ...
          end
          
          def save_user
            return user.save
          end

          Example: AllowImplicitReturn: true (default)

          # good
          users.each { |u| u.save }
          
          def save_user
            user.save
          end

          Example: AllowImplicitReturn: false

          # bad
          users.each { |u| u.save }
          def save_user
            user.save
          end
          
          # good
          users.each { |u| u.save! }
          
          def save_user
            user.save!
          end
          
          def save_user
            return user.save
          end

          Example: AllowedReceivers: ['merchant.customers', 'Service::Mailer']

          # bad
          merchant.create
          customers.builder.save
          Mailer.create
          
          module Service::Mailer
            self.create
          end
          
          # good
          merchant.customers.create
          MerchantService.merchant.customers.destroy
          Service::Mailer.update(message: 'Message')
          ::Service::Mailer.update
          Services::Service::Mailer.update(message: 'Message')
          Service::Mailer::update

          Use destroy! instead of destroy if the return value is not checked.
          Open

              @taxon_name.destroy

          This cop identifies possible cases where Active Record save! or related should be used instead of save because the model might have failed to save and an exception is better than unhandled failure.

          This will allow: - update or save calls, assigned to a variable, or used as a condition in an if/unless/case statement. - create calls, assigned to a variable that then has a call to persisted?. - calls if the result is explicitly returned from methods and blocks, or provided as arguments. - calls whose signature doesn't look like an ActiveRecord persistence method.

          By default it will also allow implicit returns from methods and blocks. that behavior can be turned off with AllowImplicitReturn: false.

          You can permit receivers that are giving false positives with AllowedReceivers: []

          Example:

          # bad
          user.save
          user.update(name: 'Joe')
          user.find_or_create_by(name: 'Joe')
          user.destroy
          
          # good
          unless user.save
            # ...
          end
          user.save!
          user.update!(name: 'Joe')
          user.find_or_create_by!(name: 'Joe')
          user.destroy!
          
          user = User.find_or_create_by(name: 'Joe')
          unless user.persisted?
            # ...
          end
          
          def save_user
            return user.save
          end

          Example: AllowImplicitReturn: true (default)

          # good
          users.each { |u| u.save }
          
          def save_user
            user.save
          end

          Example: AllowImplicitReturn: false

          # bad
          users.each { |u| u.save }
          def save_user
            user.save
          end
          
          # good
          users.each { |u| u.save! }
          
          def save_user
            user.save!
          end
          
          def save_user
            return user.save
          end

          Example: AllowedReceivers: ['merchant.customers', 'Service::Mailer']

          # bad
          merchant.create
          customers.builder.save
          Mailer.create
          
          module Service::Mailer
            self.create
          end
          
          # good
          merchant.customers.create
          MerchantService.merchant.customers.destroy
          Service::Mailer.update(message: 'Message')
          ::Service::Mailer.update
          Services::Service::Mailer.update(message: 'Message')
          Service::Mailer::update

          create returns a model which is always truthy.
          Open

                if @result.create

          This cop identifies possible cases where Active Record save! or related should be used instead of save because the model might have failed to save and an exception is better than unhandled failure.

          This will allow: - update or save calls, assigned to a variable, or used as a condition in an if/unless/case statement. - create calls, assigned to a variable that then has a call to persisted?. - calls if the result is explicitly returned from methods and blocks, or provided as arguments. - calls whose signature doesn't look like an ActiveRecord persistence method.

          By default it will also allow implicit returns from methods and blocks. that behavior can be turned off with AllowImplicitReturn: false.

          You can permit receivers that are giving false positives with AllowedReceivers: []

          Example:

          # bad
          user.save
          user.update(name: 'Joe')
          user.find_or_create_by(name: 'Joe')
          user.destroy
          
          # good
          unless user.save
            # ...
          end
          user.save!
          user.update!(name: 'Joe')
          user.find_or_create_by!(name: 'Joe')
          user.destroy!
          
          user = User.find_or_create_by(name: 'Joe')
          unless user.persisted?
            # ...
          end
          
          def save_user
            return user.save
          end

          Example: AllowImplicitReturn: true (default)

          # good
          users.each { |u| u.save }
          
          def save_user
            user.save
          end

          Example: AllowImplicitReturn: false

          # bad
          users.each { |u| u.save }
          def save_user
            user.save
          end
          
          # good
          users.each { |u| u.save! }
          
          def save_user
            user.save!
          end
          
          def save_user
            return user.save
          end

          Example: AllowedReceivers: ['merchant.customers', 'Service::Mailer']

          # bad
          merchant.create
          customers.builder.save
          Mailer.create
          
          module Service::Mailer
            self.create
          end
          
          # good
          merchant.customers.create
          MerchantService.merchant.customers.destroy
          Service::Mailer.update(message: 'Message')
          ::Service::Mailer.update
          Services::Service::Mailer.update(message: 'Message')
          Service::Mailer::update

          TODO found
          Open

          #     :page, # TODO: yes or no?

          TODO found
          Open

              # TODO: see config in collection objects controller

          TODO found
          Open

                code: :iczn # !! TODO:

          TODO found
          Open

              @combination = Combination.where(project_id: sessions_current_project_id).find(params[:combination_id]) if params[:combination_id] # TODO: this may have to change to taxon_name_id

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

            def create_castor_batch_load
              if params[:file] && digested_cookie_exists?(params[:file].tempfile, :Castor_taxon_names_md5)
                @result = BatchLoad::Import::TaxonNames::CastorInterpreter.new(**batch_params)
                if @result.create
                  flash[:notice] = "Successfully proccessed file, #{@result.total_records_created} items were created."
          Severity: Major
          Found in app/controllers/taxon_names_controller.rb and 8 other locations - About 1 hr to fix
          app/controllers/collecting_events_controller.rb on lines 192..205
          app/controllers/collecting_events_controller.rb on lines 219..232
          app/controllers/collection_objects_controller.rb on lines 261..274
          app/controllers/collection_objects_controller.rb on lines 287..300
          app/controllers/namespaces_controller.rb on lines 107..120
          app/controllers/otus_controller.rb on lines 215..228
          app/controllers/sequences_controller.rb on lines 136..149
          app/controllers/sequences_controller.rb on lines 162..175

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

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

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

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

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

          Refactorings

          Further Reading

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

            def destroy
              @taxon_name.destroy
              respond_to do |format|
                if @taxon_name.destroyed?
                  format.html { destroy_redirect @taxon_name, notice: 'TaxonName was successfully destroyed.' }
          Severity: Major
          Found in app/controllers/taxon_names_controller.rb and 4 other locations - About 1 hr to fix
          app/controllers/citations_controller.rb on lines 73..81
          app/controllers/collecting_events_controller.rb on lines 80..88
          app/controllers/containers_controller.rb on lines 71..79
          app/controllers/otus_controller.rb on lines 92..100

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

          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

            def create_simple_batch_load
              if params[:file] && digested_cookie_exists?(params[:file].tempfile, :simple_taxon_names_md5)
                @result =  BatchLoad::Import::TaxonifiToTaxonworks.new(**batch_params)
                if @result.create
                  flash[:notice] = "Successfully proccessed file, #{@result.total_records_created} taxon names were created."
          Severity: Major
          Found in app/controllers/taxon_names_controller.rb and 2 other locations - About 1 hr to fix
          app/controllers/asserted_distributions_controller.rb on lines 123..136
          app/controllers/collecting_events_controller.rb on lines 166..179

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 48.

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

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

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

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

          Refactorings

          Further Reading

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

            def index
              respond_to do |format|
                format.html do
                  @recent_objects = TaxonName.recent_from_project_id(sessions_current_project_id).order(updated_at: :desc).limit(10)
                  render '/shared/data/all/index'
          Severity: Minor
          Found in app/controllers/taxon_names_controller.rb and 1 other location - About 50 mins to fix
          app/controllers/taxon_name_relationships_controller.rb on lines 9..17

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

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

            def preview_castor_batch_load
              if params[:file]
                @result = BatchLoad::Import::TaxonNames::CastorInterpreter.new(**batch_params)
                digest_cookie(params[:file].tempfile, :Castor_taxon_names_md5)
                render 'taxon_names/batch_load/castor/preview'
          Severity: Major
          Found in app/controllers/taxon_names_controller.rb and 11 other locations - About 30 mins to fix
          app/controllers/collecting_events_controller.rb on lines 181..189
          app/controllers/collecting_events_controller.rb on lines 207..216
          app/controllers/collection_objects_controller.rb on lines 250..258
          app/controllers/collection_objects_controller.rb on lines 276..284
          app/controllers/descriptors_controller.rb on lines 107..115
          app/controllers/namespaces_controller.rb on lines 96..104
          app/controllers/otus_controller.rb on lines 151..159
          app/controllers/otus_controller.rb on lines 203..211
          app/controllers/sequence_relationships_controller.rb on lines 87..95
          app/controllers/sequences_controller.rb on lines 125..133
          app/controllers/sequences_controller.rb on lines 151..159

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 33.

          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

            def preview_simple_batch_load
              if params[:file]
                @result = BatchLoad::Import::TaxonifiToTaxonworks.new(**batch_params)
                digest_cookie(params[:file].tempfile, :simple_taxon_names_md5)
                render 'taxon_names/batch_load/simple/preview'
          Severity: Minor
          Found in app/controllers/taxon_names_controller.rb and 2 other locations - About 30 mins to fix
          app/controllers/asserted_distributions_controller.rb on lines 112..120
          app/controllers/collecting_events_controller.rb on lines 155..163

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 32.

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

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

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

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

          Refactorings

          Further Reading

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

            def api_index
              @taxon_names = Queries::TaxonName::Filter.new(api_params).all
                .where(project_id: sessions_current_project_id)
                .order('taxon_names.id')
                .page(params[:page]).per(params[:per])
          Severity: Minor
          Found in app/controllers/taxon_names_controller.rb and 4 other locations - About 15 mins to fix
          app/controllers/biological_associations_controller.rb on lines 94..100
          app/controllers/collecting_events_controller.rb on lines 239..244
          app/controllers/collection_objects_controller.rb on lines 314..318
          app/controllers/otus_controller.rb on lines 249..254

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

          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

            def autocomplete
              render json: {} and return if params[:term].blank?
          
              @taxon_names = Queries::TaxonName::Autocomplete.new(
                params[:term],
          Severity: Minor
          Found in app/controllers/taxon_names_controller.rb and 1 other location - About 15 mins to fix
          app/controllers/serials_controller.rb on lines 96..102

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

          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