MiraitSystems/enju_trunk

View on GitHub

Showing 1,155 of 1,155 total issues

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

  def index
    @resource_import_file = ResourceImportFile.where(:id => params[:resource_import_file_id]).first
    if @resource_import_file
      if params[:display_result] && params[:display_result] == "has_msg"
        @resource_import_results = @resource_import_file.resource_import_results.where("error_msg is not null")
Severity: Minor
Found in app/controllers/resource_import_results_controller.rb - About 45 mins to fix

Cognitive Complexity

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

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

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

Further reading

Avoid deeply nested control flow statements.
Open

            next_issue = 2 if Keycode.find(issue_sequence_type).try(:v).to_i == 4
Severity: Major
Found in app/models/sequence_pattern.rb - About 45 mins to fix

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

      def manifestation_page(manifestation)
        page = ""
        if manifestation.start_page and manifestation.start_page.present? and manifestation.end_page and manifestation.end_page.present?
          if manifestation.start_page == manifestation.end_page
            page = "(#{manifestation.start_page})"
    Severity: Minor
    Found in app/helpers/manifestations_helper.rb - About 45 mins to fix

    Cognitive Complexity

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

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

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

    Further reading

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

      def language_facet(language, current_languages, facet)
        string = ''
        languages = current_languages.dup
        current = true if languages.include?(language.name)
        if current
    Severity: Minor
    Found in app/helpers/manifestations_helper.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

    Avoid deeply nested control flow statements.
    Open

                next_volume = current_volume + self.volume_param if current_volume && self.volume_param
    Severity: Major
    Found in app/models/sequence_pattern.rb - About 45 mins to fix

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

        def agent_relationship_type_facet(select_id, select_relation = nil, current_type, current_relation, display_name, count)
      Severity: Minor
      Found in app/helpers/agents_helper.rb - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                    next_volume = current_volume + self.volume_param if self.volume_param && (vol > current_volume)
        Severity: Major
        Found in app/models/sequence_pattern.rb - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                      sql << " AND " unless Shelf.categories.first == c
          Severity: Major
          Found in app/controllers/shelves_controller.rb - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                      unless current_user == @user
                        access_denied; return
                      end
            Severity: Major
            Found in app/controllers/purchase_requests_controller.rb - About 45 mins to fix

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

                def call_numberformat(item = nil)
                  call_number = item.call_number
                  if SystemConfiguration.get("items.call_number.delete_first_delimiter")
                    delimiter = item.try(:shelf).try(:library).try(:call_number_delimiter) || '|'
                    if call_number
              Severity: Minor
              Found in app/helpers/items_helper.rb - About 45 mins to fix

              Cognitive Complexity

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

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

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

              Further reading

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

                def parse_list_params(library_ids, carrier_type_ids, bookstore_ids, ndcs, acquired_at, deny_blank_bookstore_ids = true)
              Severity: Minor
              Found in app/controllers/export_item_lists_controller.rb - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                          if @user == current_user
                            @answers = @user.answers.order('answers.id').page(params[:page])
                          else
                            @answers = @user.answers.public_answers.order('answers.id').page(params[:page])
                          end
                Severity: Major
                Found in app/controllers/answers_controller.rb - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                              next if c == 'other'
                  Severity: Major
                  Found in app/controllers/shelves_controller.rb - About 45 mins to fix

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

                      def show
                        if @agent_import_file.agent_import.path
                          unless Setting.uploaded_file.storage == :s3
                            file = @agent_import_file.agent_import.path
                          end
                    Severity: Minor
                    Found in app/controllers/agent_import_files_controller.rb - About 45 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

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

                      def output
                        # 貸出統計表
                        if params[:checkout_statistics].present?
                          @checkout_statistics = CheckoutStatistics.new(params[:checkout_statistics])
                          if @checkout_statistics.invalid?
                    Severity: Minor
                    Found in app/controllers/statistical_table_controller.rb - About 45 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

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

                      def upload_to_nacsis
                        result = NacsisCat.upload_info_to_nacsis(params[:work_id], params[:db_type], params[:command])
                    
                        case params[:db_type]
                        when 'BOOK'
                    Severity: Minor
                    Found in app/controllers/manifestations_controller.rb - About 45 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

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

                      def index
                        @displist = []
                        dispList = Struct.new(:state, :reserves)
                    
                        unless params[:format] == 'pdf' or params[:format] == 'tsv'
                    Severity: Minor
                    Found in app/controllers/reservelists_controller.rb - About 45 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

                    Avoid deeply nested control flow statements.
                    Open

                            if params[:without_article]
                              search_opts[:with_article] = false
                            else
                              search_opts[:with_article] = !SystemConfiguration.isWebOPAC || clinet_is_special_ip?
                            end
                    Severity: Major
                    Found in app/controllers/manifestations_controller.rb - About 45 mins to fix

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

                        def show
                          if @event_import_file.event_import.path
                            unless Setting.uploaded_file.storage == :s3
                              file = @event_import_file.event_import.path
                            end
                      Severity: Minor
                      Found in app/controllers/event_import_files_controller.rb - About 45 mins to fix

                      Cognitive Complexity

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

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

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

                      Further reading

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

                          def initialize(options, params, query, with_filter, without_filter, sort)
                      Severity: Minor
                      Found in app/controllers/manifestations_controller.rb - About 45 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language