MiraitSystems/enju_trunk

View on GitHub

Showing 1,155 of 1,155 total issues

Method update_manifestation_languages has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def update_manifestation_languages(sheet, datas, field, manifestation, error_msgs)
      if Manifestation.separate_output_columns?
        records = build_associated_records(sheet, datas, manifestation, :work_has_languages, {
          language_id: ["#{field}.language", Language, :name],
          language_type: ["#{field}.language_type", LanguageType, :name, allow_blank: true],
Severity: Minor
Found in lib/enju_trunk/resourceadapter/import_book.rb - About 1 hr to fix

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

      def update
        respond_to do |format|
          if @user_reserve_stat.update_attributes(params[:user_reserve_stat])
            flash[:notice] = t('controller.successfully_updated', :model => t('activerecord.models.user_reserve_stat'))
            format.html { redirect_to(@user_reserve_stat) }
    Severity: Major
    Found in app/controllers/user_reserve_stats_controller.rb and 10 other locations - About 1 hr to fix
    app/controllers/agent_merges_controller.rb on lines 65..73
    app/controllers/checkout_stat_has_manifestations_controller.rb on lines 58..66
    app/controllers/checkout_stat_has_users_controller.rb on lines 58..66
    app/controllers/event_import_files_controller.rb on lines 73..81
    app/controllers/manifestation_checkout_stats_controller.rb on lines 65..73
    app/controllers/manifestation_reserve_stats_controller.rb on lines 64..72
    app/controllers/reserve_stat_has_manifestations_controller.rb on lines 58..66
    app/controllers/reserve_stat_has_users_controller.rb on lines 58..66
    app/controllers/series_statement_merges_controller.rb on lines 67..75
    app/controllers/user_checkout_stats_controller.rb on lines 64..72

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

      def update
        respond_to do |format|
          if @checkout_stat_has_user.update_attributes(params[:checkout_stat_has_user])
            flash[:notice] = t('controller.successfully_updated', :model => t('activerecord.models.checkout_stat_has_user'))
            format.html { redirect_to(@checkout_stat_has_user) }
    Severity: Major
    Found in app/controllers/checkout_stat_has_users_controller.rb and 10 other locations - About 1 hr to fix
    app/controllers/agent_merges_controller.rb on lines 65..73
    app/controllers/checkout_stat_has_manifestations_controller.rb on lines 58..66
    app/controllers/event_import_files_controller.rb on lines 73..81
    app/controllers/manifestation_checkout_stats_controller.rb on lines 65..73
    app/controllers/manifestation_reserve_stats_controller.rb on lines 64..72
    app/controllers/reserve_stat_has_manifestations_controller.rb on lines 58..66
    app/controllers/reserve_stat_has_users_controller.rb on lines 58..66
    app/controllers/series_statement_merges_controller.rb on lines 67..75
    app/controllers/user_checkout_stats_controller.rb on lines 64..72
    app/controllers/user_reserve_stats_controller.rb on lines 64..72

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

      def update
        respond_to do |format|
          if @series_statement_merge.update_attributes(params[:series_statement_merge])
            flash[:notice] = t('controller.successfully_updated', :model => t('activerecord.models.series_statement_merge'))
            format.html { redirect_to(@series_statement_merge) }
    Severity: Major
    Found in app/controllers/series_statement_merges_controller.rb and 10 other locations - About 1 hr to fix
    app/controllers/agent_merges_controller.rb on lines 65..73
    app/controllers/checkout_stat_has_manifestations_controller.rb on lines 58..66
    app/controllers/checkout_stat_has_users_controller.rb on lines 58..66
    app/controllers/event_import_files_controller.rb on lines 73..81
    app/controllers/manifestation_checkout_stats_controller.rb on lines 65..73
    app/controllers/manifestation_reserve_stats_controller.rb on lines 64..72
    app/controllers/reserve_stat_has_manifestations_controller.rb on lines 58..66
    app/controllers/reserve_stat_has_users_controller.rb on lines 58..66
    app/controllers/user_checkout_stats_controller.rb on lines 64..72
    app/controllers/user_reserve_stats_controller.rb on lines 64..72

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

                function prevMonth() {
                    var date = new Date(cal.date);
                    date.setDate(date.getDate() - step);
                    cal.setDate(date);
                };
    Severity: Major
    Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 1 hr to fix
    app/assets/javascripts/jquery.simplecalendarjp.js on lines 1078..1082

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

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

      def update
        respond_to do |format|
          if @manifestation_reserve_stat.update_attributes(params[:manifestation_reserve_stat])
            flash[:notice] = t('controller.successfully_created', :model => t('activerecord.models.manifestation_reserve_stat'))
            format.html { redirect_to(@manifestation_reserve_stat) }
    Severity: Major
    Found in app/controllers/manifestation_reserve_stats_controller.rb and 10 other locations - About 1 hr to fix
    app/controllers/agent_merges_controller.rb on lines 65..73
    app/controllers/checkout_stat_has_manifestations_controller.rb on lines 58..66
    app/controllers/checkout_stat_has_users_controller.rb on lines 58..66
    app/controllers/event_import_files_controller.rb on lines 73..81
    app/controllers/manifestation_checkout_stats_controller.rb on lines 65..73
    app/controllers/reserve_stat_has_manifestations_controller.rb on lines 58..66
    app/controllers/reserve_stat_has_users_controller.rb on lines 58..66
    app/controllers/series_statement_merges_controller.rb on lines 67..75
    app/controllers/user_checkout_stats_controller.rb on lines 64..72
    app/controllers/user_reserve_stats_controller.rb on lines 64..72

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

      def update
        respond_to do |format|
          if @checkout_stat_has_manifestation.update_attributes(params[:checkout_stat_has_manifestation])
            flash[:notice] = t('controller.successfully_updated', :model => t('activerecord.models.checkout_stat_has_manifestation'))
            format.html { redirect_to(@checkout_stat_has_manifestation) }
    app/controllers/agent_merges_controller.rb on lines 65..73
    app/controllers/checkout_stat_has_users_controller.rb on lines 58..66
    app/controllers/event_import_files_controller.rb on lines 73..81
    app/controllers/manifestation_checkout_stats_controller.rb on lines 65..73
    app/controllers/manifestation_reserve_stats_controller.rb on lines 64..72
    app/controllers/reserve_stat_has_manifestations_controller.rb on lines 58..66
    app/controllers/reserve_stat_has_users_controller.rb on lines 58..66
    app/controllers/series_statement_merges_controller.rb on lines 67..75
    app/controllers/user_checkout_stats_controller.rb on lines 64..72
    app/controllers/user_reserve_stats_controller.rb on lines 64..72

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

      def update
        respond_to do |format|
          if @user_checkout_stat.update_attributes(params[:user_checkout_stat])
            flash[:notice] = t('controller.successfully_updated', :model => t('activerecord.models.user_checkout_stat'))
            format.html { redirect_to(@user_checkout_stat) }
    Severity: Major
    Found in app/controllers/user_checkout_stats_controller.rb and 10 other locations - About 1 hr to fix
    app/controllers/agent_merges_controller.rb on lines 65..73
    app/controllers/checkout_stat_has_manifestations_controller.rb on lines 58..66
    app/controllers/checkout_stat_has_users_controller.rb on lines 58..66
    app/controllers/event_import_files_controller.rb on lines 73..81
    app/controllers/manifestation_checkout_stats_controller.rb on lines 65..73
    app/controllers/manifestation_reserve_stats_controller.rb on lines 64..72
    app/controllers/reserve_stat_has_manifestations_controller.rb on lines 58..66
    app/controllers/reserve_stat_has_users_controller.rb on lines 58..66
    app/controllers/series_statement_merges_controller.rb on lines 67..75
    app/controllers/user_reserve_stats_controller.rb on lines 64..72

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

      def update
        respond_to do |format|
          if @reserve_stat_has_manifestation.update_attributes(params[:reserve_stat_has_manifestation])
            flash[:notice] = t('controller.successfully_updated', :model => t('activerecord.models.reserve_stat_has_manifestation'))
            format.html { redirect_to(@reserve_stat_has_manifestation) }
    app/controllers/agent_merges_controller.rb on lines 65..73
    app/controllers/checkout_stat_has_manifestations_controller.rb on lines 58..66
    app/controllers/checkout_stat_has_users_controller.rb on lines 58..66
    app/controllers/event_import_files_controller.rb on lines 73..81
    app/controllers/manifestation_checkout_stats_controller.rb on lines 65..73
    app/controllers/manifestation_reserve_stats_controller.rb on lines 64..72
    app/controllers/reserve_stat_has_users_controller.rb on lines 58..66
    app/controllers/series_statement_merges_controller.rb on lines 67..75
    app/controllers/user_checkout_stats_controller.rb on lines 64..72
    app/controllers/user_reserve_stats_controller.rb on lines 64..72

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

      def update
        respond_to do |format|
          if @manifestation_checkout_stat.update_attributes(params[:manifestation_checkout_stat])
            flash[:notice] = t('controller.successfully_updated', :model => t('activerecord.models.manifestation_checkout_stat'))
            format.html { redirect_to(@manifestation_checkout_stat) }
    app/controllers/agent_merges_controller.rb on lines 65..73
    app/controllers/checkout_stat_has_manifestations_controller.rb on lines 58..66
    app/controllers/checkout_stat_has_users_controller.rb on lines 58..66
    app/controllers/event_import_files_controller.rb on lines 73..81
    app/controllers/manifestation_reserve_stats_controller.rb on lines 64..72
    app/controllers/reserve_stat_has_manifestations_controller.rb on lines 58..66
    app/controllers/reserve_stat_has_users_controller.rb on lines 58..66
    app/controllers/series_statement_merges_controller.rb on lines 67..75
    app/controllers/user_checkout_stats_controller.rb on lines 64..72
    app/controllers/user_reserve_stats_controller.rb on lines 64..72

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

      def update
        respond_to do |format|
          if @reserve_stat_has_user.update_attributes(params[:reserve_stat_has_user])
            flash[:notice] = t('controller.successfully_updated', :model => t('activerecord.models.reserve_stat_has_user'))
            format.html { redirect_to(@reserve_stat_has_user) }
    Severity: Major
    Found in app/controllers/reserve_stat_has_users_controller.rb and 10 other locations - About 1 hr to fix
    app/controllers/agent_merges_controller.rb on lines 65..73
    app/controllers/checkout_stat_has_manifestations_controller.rb on lines 58..66
    app/controllers/checkout_stat_has_users_controller.rb on lines 58..66
    app/controllers/event_import_files_controller.rb on lines 73..81
    app/controllers/manifestation_checkout_stats_controller.rb on lines 65..73
    app/controllers/manifestation_reserve_stats_controller.rb on lines 64..72
    app/controllers/reserve_stat_has_manifestations_controller.rb on lines 58..66
    app/controllers/series_statement_merges_controller.rb on lines 67..75
    app/controllers/user_checkout_stats_controller.rb on lines 64..72
    app/controllers/user_reserve_stats_controller.rb on lines 64..72

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

      def update
        respond_to do |format|
          if @event_import_file.update_attributes(params[:event_import_file])
            flash[:notice] = t('controller.successfully_updated', :model => t('activerecord.models.event_import_file'))
            format.html { redirect_to(@event_import_file) }
    Severity: Major
    Found in app/controllers/event_import_files_controller.rb and 10 other locations - About 1 hr to fix
    app/controllers/agent_merges_controller.rb on lines 65..73
    app/controllers/checkout_stat_has_manifestations_controller.rb on lines 58..66
    app/controllers/checkout_stat_has_users_controller.rb on lines 58..66
    app/controllers/manifestation_checkout_stats_controller.rb on lines 65..73
    app/controllers/manifestation_reserve_stats_controller.rb on lines 64..72
    app/controllers/reserve_stat_has_manifestations_controller.rb on lines 58..66
    app/controllers/reserve_stat_has_users_controller.rb on lines 58..66
    app/controllers/series_statement_merges_controller.rb on lines 67..75
    app/controllers/user_checkout_stats_controller.rb on lines 64..72
    app/controllers/user_reserve_stats_controller.rb on lines 64..72

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

      def update
        respond_to do |format|
          if @agent_merge.update_attributes(params[:agent_merge])
            flash[:notice] = t('controller.successfully_updated', :model => t('activerecord.models.agent_merge'))
            format.html { redirect_to(@agent_merge) }
    Severity: Major
    Found in app/controllers/agent_merges_controller.rb and 10 other locations - About 1 hr to fix
    app/controllers/checkout_stat_has_manifestations_controller.rb on lines 58..66
    app/controllers/checkout_stat_has_users_controller.rb on lines 58..66
    app/controllers/event_import_files_controller.rb on lines 73..81
    app/controllers/manifestation_checkout_stats_controller.rb on lines 65..73
    app/controllers/manifestation_reserve_stats_controller.rb on lines 64..72
    app/controllers/reserve_stat_has_manifestations_controller.rb on lines 58..66
    app/controllers/reserve_stat_has_users_controller.rb on lines 58..66
    app/controllers/series_statement_merges_controller.rb on lines 67..75
    app/controllers/user_checkout_stats_controller.rb on lines 64..72
    app/controllers/user_reserve_stats_controller.rb on lines 64..72

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

                function nextMonth() {
                    var date = new Date(cal.date);
                    date.setDate(date.getDate() + step);
                    cal.setDate(date);
                };
    Severity: Major
    Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 1 hr to fix
    app/assets/javascripts/jquery.simplecalendarjp.js on lines 1073..1077

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

    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

    Function param has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function param(data) {
            if ($.isArray(data)) {
                return data;
            }
            var params = [];
    Severity: Minor
    Found in app/assets/javascripts/jquery.upload-1.0.2.js - About 1 hr to fix

      Method get_abbreviation has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def self.get_abbreviation(bookname)
          # 当モデルのチェックメソッドを使用するため、レシーバのインスタンスを生成する
          abbreviation_res = Abbreviation.new
      
          merge_v = ""
      Severity: Minor
      Found in app/models/abbreviation.rb - About 1 hr to fix

        Method output_reminder_letter has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def self.output_reminder_letter(file, reminder_lists, user, current_user)
            logger.info "create_file=> #{file}"
        
            report = EnjuTrunk.new_report('reminder_letter.tlf')
            report.layout.config.list(:list) do
        Severity: Minor
        Found in app/models/reminder_list.rb - About 1 hr to fix

          Method output_reminder_list_pdf has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def self.output_reminder_list_pdf(reminder_lists)
              report = EnjuTrunk.new_report('reminder_list.tlf')
          
              # set page_num
              report.events.on :page_create do |e|
          Severity: Minor
          Found in app/models/reminder_list.rb - About 1 hr to fix

            Method make_audio_list_pdf has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def self.make_audio_list_pdf(pdf_file, items)
                filename = I18n.t('item_register.audio_list')
                report = EnjuTrunk.new_item_list('item_list')
            
                report.events.on :page_create do |e|
            Severity: Minor
            Found in app/models/item.rb - About 1 hr to fix

              Method create has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def create
                  unless can_use_purchase_request?
                    access_denied; return
                  end
              
              
              Severity: Minor
              Found in app/controllers/purchase_requests_controller.rb - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language