MiraitSystems/enju_trunk

View on GitHub

Showing 1,155 of 1,155 total issues

Method generate_manifestation_list has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def self.generate_manifestation_list(solr_search, output_type, current_user, search_condition_summary, cols=[], threshold = nil, &block)
Severity: Major
Found in app/models/manifestation.rb - About 50 mins to fix

    Method initialize has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def initialize(job_name, file_name, file_type, method, dumped_query, args, user)
    Severity: Major
    Found in app/models/item.rb - About 50 mins to fix

      Method construct_list_query has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def construct_list_query(list_type, library_ids, carrier_type_ids, bookstore_ids, ndcs, acquired_at, apply_order)
      Severity: Major
      Found in app/controllers/export_item_lists_controller.rb - About 50 mins to fix

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

                        y = keepWithin(slider.height() - (hsb.b * (slider.height() / 100)), 0, slider.height());
        Severity: Minor
        Found in app/assets/javascripts/jquery.minicolors.js and 1 other location - About 50 mins to fix
        app/assets/javascripts/jquery.minicolors.js on lines 542..542

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

        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

            unless params[:status].blank?
              if params[:status].include?("notset")
                ids = params[:status].reject{|e| e == "notset"}
                if ids.blank?
                  approvals = approvals.where("status IS NULL")
        Severity: Minor
        Found in app/controllers/approvals_controller.rb and 1 other location - About 50 mins to fix
        app/controllers/approvals_controller.rb on lines 248..257

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

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

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

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

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

        Refactorings

        Further Reading

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

            if params[:item_statistics].present?
              @item_statistics = ItemStatistics.new(params[:item_statistics])
              if @item_statistics.invalid?
                @statistical_table_types = I18n.t('statistical_table.statistical_table_types').map{|k,v|[v,k]}
                @statistical_table_type = 'item_statistics'
        Severity: Minor
        Found in app/controllers/statistical_table_controller.rb and 1 other location - About 50 mins to fix
        app/controllers/statistical_table_controller.rb on lines 41..50

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

        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

            unless params[:approval_result].blank?
              if params[:approval_result].include?("notset")
                ids = params[:approval_result].reject{|e| e == "notset"}
                if ids.blank?
                  approvals = approvals.where("approval_result IS NULL")
        Severity: Minor
        Found in app/controllers/approvals_controller.rb and 1 other location - About 50 mins to fix
        app/controllers/approvals_controller.rb on lines 234..243

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

        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 ActiveRecord::RecordInvalid  => e
                  import_result.error_msg = "FAIL[#{row_num}]: fail save manifestation. (record invalid) #{e.message}"
                  Rails.logger.error "FAIL[#{row_num}]: fail save manifestation. (record invalid) #{e.message}"
                  Rails.logger.error "FAIL[#{row_num}]: #{$@}"
                  manifestation = nil
        Severity: Minor
        Found in app/models/resource_import_file.rb and 1 other location - About 50 mins to fix
        app/models/resource_import_file.rb on lines 133..147

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

        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

            unless params[:status].blank?
              if params[:status].include?("notset")
                ids = params[:status].reject{|e| e == "notset"}
                if ids.blank?
                  @approvals = @approvals.where("status IS NULL")
        Severity: Minor
        Found in app/controllers/approvals_controller.rb and 1 other location - About 50 mins to fix
        app/controllers/approvals_controller.rb on lines 193..202

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

        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

            unless params[:approval_result].blank?
              if params[:approval_result].include?("notset")
                ids = params[:approval_result].reject{|e| e == "notset"}
                if ids.blank?
                  @approvals = @approvals.where("approval_result IS NULL")
        Severity: Minor
        Found in app/controllers/approvals_controller.rb and 1 other location - About 50 mins to fix
        app/controllers/approvals_controller.rb on lines 179..188

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

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

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

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

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

        Refactorings

        Further Reading

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

            if params[:checkout_statistics].present?
              @checkout_statistics = CheckoutStatistics.new(params[:checkout_statistics])
              if @checkout_statistics.invalid?
                @statistical_table_types = I18n.t('statistical_table.statistical_table_types').map{|k,v|[v,k]}
                @statistical_table_type = 'checkout_statistics'
        Severity: Minor
        Found in app/controllers/statistical_table_controller.rb and 1 other location - About 50 mins to fix
        app/controllers/statistical_table_controller.rb on lines 53..62

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

        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

                        y = keepWithin(slider.height() - (hsb.s * (slider.height() / 100)), 0, slider.height());
        Severity: Minor
        Found in app/assets/javascripts/jquery.minicolors.js and 1 other location - About 50 mins to fix
        app/assets/javascripts/jquery.minicolors.js on lines 560..560

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

        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 ActiveRecord::StatementInvalid => e
                  import_result.error_msg = "FAIL[#{row_num}]: fail save manifestation. (statement invalid) #{e.message}"
                  Rails.logger.error "FAIL[#{row_num}]: fail save manifestation. (statement invalid) #{e.message}"
                  Rails.logger.error "FAIL[#{row_num}]: #{$@}"
                  manifestation = nil
        Severity: Minor
        Found in app/models/resource_import_file.rb and 1 other location - About 50 mins to fix
        app/models/resource_import_file.rb on lines 126..147

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

        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

              cols.each_with_index do |col, i|
                columns << I18n.t('statistical_table.jpn_donate')
                columns << "" if conditions.money_aggregation.present?
                columns << I18n.t('statistical_table.foreign_donate')
                columns << "" if conditions.money_aggregation.present?
        Severity: Minor
        Found in app/models/item_statistics.rb and 1 other location - About 45 mins to fix
        app/models/item_statistics.rb on lines 533..539

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

        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

              cols.each_with_index do |col, i|
                columns << I18n.t('statistical_table.jpn')
                columns << "" if conditions.money_aggregation.present?
                columns << I18n.t('statistical_table.foreign')
                columns << "" if conditions.money_aggregation.present?
        Severity: Minor
        Found in app/models/item_statistics.rb and 1 other location - About 45 mins to fix
        app/models/item_statistics.rb on lines 543..549

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

        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 _toKatakana has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            _toKatakana: function(src) {
                if(this.options.katakana) {
                    var c, i, l, str;
                    str = "";
                    for(i=0,l=src.length; i<l; i++) {
        Severity: Minor
        Found in app/assets/javascripts/jquery.autoKana.js - About 45 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

            def parse_action_names(text)
              if text.blank?
                raise ArgumentError, "empty action names"
              end
        
        
        Severity: Minor
        Found in app/models/function.rb - About 45 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function _checkValue has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            _checkValue: function() {
                var new_input, new_values;
                new_input = this.elName.value;
                if(new_input == '') {
                    this._stateClear();
        Severity: Minor
        Found in app/assets/javascripts/jquery.autoKana.js - About 45 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

          def self.generate_manifestation_list_internal(manifestation_ids, output_type, current_user, summary, cols, &block)
        Severity: Minor
        Found in app/models/manifestation.rb - About 45 mins to fix

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

            def reservable?
              unless SystemConfiguration.get("reserves.able_for_not_item")
                return false if items.for_checkout.empty? 
              end
              return false if self.periodical_master?
          Severity: Minor
          Found in app/models/manifestation.rb - About 45 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Severity
          Category
          Status
          Source
          Language