MiraitSystems/enju_trunk

View on GitHub

Showing 1,155 of 1,155 total issues

Avoid too many return statements within this method.
Open

      return t('page.exstatistics.invalid_input_date') if date_format_check(end_d) == nil
Severity: Major
Found in lib/enju_trunk/enju_trunk_helper.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

          return t('page.exstatistics.over_end_date') if end_d.gsub(/\D/, '') < start_d.gsub(/\D/, '')
    Severity: Major
    Found in lib/enju_trunk/enju_trunk_helper.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                return nil
      Severity: Major
      Found in lib/enju_trunk/resourceadapter/import_book.rb - About 30 mins to fix

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

                this._disabledFields = $.map(this._disabledFields,
                    function(value) { return (value == target ? null : value); }); // delete entry
        Severity: Minor
        Found in app/assets/javascripts/jquery.keypad.js and 1 other location - About 30 mins to fix
        app/assets/javascripts/jquery.keypad.js on lines 301..302

        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

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

                this._disabledFields = $.map(this._disabledFields,
                    function(value) { return (value == target ? null : value); }); // delete entry
        Severity: Minor
        Found in app/assets/javascripts/jquery.keypad.js and 1 other location - About 30 mins to fix
        app/assets/javascripts/jquery.keypad.js on lines 265..266

        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

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

          def reject
            check_can_access_purchase_request
        
            if @purchase_request.sm_reject
              @purchase_request.send_message(@purchase_request.state)
        Severity: Minor
        Found in app/controllers/purchase_requests_controller.rb and 1 other location - About 30 mins to fix
        app/controllers/purchase_requests_controller.rb on lines 193..206

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

          def accept
            check_can_access_purchase_request
        
            if @purchase_request.sm_accept
              @purchase_request.send_message(@purchase_request.state)
        Severity: Minor
        Found in app/controllers/purchase_requests_controller.rb and 1 other location - About 30 mins to fix
        app/controllers/purchase_requests_controller.rb on lines 210..223

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

          rescue Exception => e
            logger.error "Failed to create: #{e}"
            prepare_options
            respond_to do |format|
              format.html { render :action => "new" }
        Severity: Minor
        Found in app/controllers/series_statements_controller.rb and 1 other location - About 30 mins to fix
        app/controllers/series_statements_controller.rb on lines 154..161

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

          rescue Exception => e
            logger.error "Failed to update: #{e}"
            prepare_options
            respond_to do |format|
              format.html { render :action => "edit" }
        Severity: Minor
        Found in app/controllers/series_statements_controller.rb and 1 other location - About 30 mins to fix
        app/controllers/series_statements_controller.rb on lines 120..127

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

            report.events.on :generate do |e|
              e.pages.each do |page|
                page.item(:list_title).value(I18n.t('page.listing', :model => I18n.t('activerecord.models.unablelist')))
                page.item(:total).value(e.report.page_count)
        Severity: Minor
        Found in app/models/unablelist.rb and 1 other location - About 25 mins to fix
        app/models/user.rb on lines 713..716

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

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

            if row[extelephone_number_1]
              agent.extelephone_number_1 = row[extelephone_number_1]
              type_id = row[extelephone_number_1_type_id].to_i rescue 0
              agent.extelephone_number_1_type_id = ((0 < type_id and type_id < 6) ? type_id : 1)
        Severity: Major
        Found in app/models/agent_import_file.rb and 5 other locations - About 25 mins to fix
        app/models/agent_import_file.rb on lines 275..278
        app/models/agent_import_file.rb on lines 280..283
        app/models/agent_import_file.rb on lines 290..293
        app/models/agent_import_file.rb on lines 295..298
        app/models/agent_import_file.rb on lines 300..303

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

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

            if row[fax_number_2]
              agent.fax_number_2 = row[fax_number_2]
              type_id = row[fax_number_2_type_id].to_i rescue 0
              agent.fax_number_2_type_id = ((0 < type_id and type_id < 6) ? type_id : 1)
        Severity: Major
        Found in app/models/agent_import_file.rb and 5 other locations - About 25 mins to fix
        app/models/agent_import_file.rb on lines 275..278
        app/models/agent_import_file.rb on lines 280..283
        app/models/agent_import_file.rb on lines 285..288
        app/models/agent_import_file.rb on lines 290..293
        app/models/agent_import_file.rb on lines 295..298

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

        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

            respond_to do |format|
              if @function_class.update_attributes(params[:function_class])
                flash[:notice] =  t('controller.successfully_updated', :model => t('activerecord.models.function_class'))
                format.html { redirect_to function_classes_url }
              else
        Severity: Minor
        Found in app/controllers/function_classes_controller.rb and 1 other location - About 25 mins to fix
        app/controllers/output_column_lists_controller.rb on lines 24..29

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

        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

              cols.each_with_index do |col, i|
                from = start_col + (step_col * i)
                to = start_col + step_col + (step_col * i) - 1
                sheet.merge_cells sheet.rows.last.cells[from..to]
        Severity: Minor
        Found in app/models/item_statistics.rb and 1 other location - About 25 mins to fix
        app/models/item_statistics.rb on lines 499..502

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

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

            if row[telephone_number_1]
              agent.telephone_number_1 = row[telephone_number_1]
              type_id = row[telephone_number_1_type_id].to_i rescue 0
              agent.telephone_number_1_type_id = ((0 < type_id and type_id < 6) ? type_id : 1)
        Severity: Major
        Found in app/models/agent_import_file.rb and 5 other locations - About 25 mins to fix
        app/models/agent_import_file.rb on lines 280..283
        app/models/agent_import_file.rb on lines 285..288
        app/models/agent_import_file.rb on lines 290..293
        app/models/agent_import_file.rb on lines 295..298
        app/models/agent_import_file.rb on lines 300..303

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

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

            if row[telephone_number_2]
              agent.telephone_number_2 = row[telephone_number_2]
              type_id = row[telephone_number_2_type_id].to_i rescue 0
              agent.telephone_number_2_type_id = ((0 < type_id and type_id < 6) ? type_id : 1)
        Severity: Major
        Found in app/models/agent_import_file.rb and 5 other locations - About 25 mins to fix
        app/models/agent_import_file.rb on lines 275..278
        app/models/agent_import_file.rb on lines 285..288
        app/models/agent_import_file.rb on lines 290..293
        app/models/agent_import_file.rb on lines 295..298
        app/models/agent_import_file.rb on lines 300..303

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

        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

              cols.each_with_index do |col, i|
                from = start_col + (step_col * i)
                to = start_col + step_col + (step_col * i) - 1
                sheet.merge_cells sheet.rows.last.cells[from..to]
        Severity: Minor
        Found in app/models/item_statistics.rb and 1 other location - About 25 mins to fix
        app/models/item_statistics.rb on lines 513..516

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

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

            if row[extelephone_number_2]
              agent.extelephone_number_2 = row[extelephone_number_2]
              type_id = row[extelephone_number_2_type_id].to_i rescue 0
              agent.extelephone_number_2_type_id = ((0 < type_id and type_id < 6) ? type_id : 1)
        Severity: Major
        Found in app/models/agent_import_file.rb and 5 other locations - About 25 mins to fix
        app/models/agent_import_file.rb on lines 275..278
        app/models/agent_import_file.rb on lines 280..283
        app/models/agent_import_file.rb on lines 285..288
        app/models/agent_import_file.rb on lines 295..298
        app/models/agent_import_file.rb on lines 300..303

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

        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

          def get_classification_values(manifestation)
            classifications = []
            manifestation_has_classifications = manifestation.manifestation_has_classifications.order(:position)
            if manifestation_has_classifications.present?
              manifestation_has_classifications.each do |manifestation_has_classification|
        Severity: Minor
        Found in app/controllers/manifestations_controller.rb and 1 other location - About 25 mins to fix
        app/controllers/series_statements_controller.rb on lines 263..274

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

        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

            report.events.on :generate do |e|
              e.pages.each do |page|
                page.item(:list_title).value(I18n.t('page.listing', :model => I18n.t('activerecord.models.user')))
                page.item(:total).value(e.report.page_count)
        Severity: Minor
        Found in app/models/user.rb and 1 other location - About 25 mins to fix
        app/models/unablelist.rb on lines 11..14

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

        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