MiraitSystems/enju_trunk

View on GitHub

Showing 1,155 of 1,155 total issues

File jquery.simplecalendarjp.js has 1751 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 *-------------------------------------
 * redmine風のシンプルカレンダープラグイン
 * copyright DQNEO 2011
 * http://dqn.sakusakutto.jp/
Severity: Major
Found in app/assets/javascripts/jquery.simplecalendarjp.js - About 4 days to fix

    File manifestation.rb has 1693 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'csv'
    engines = []
    engines << EnjuTrunkFrbr::Engine        if defined? EnjuTrunkFrbr
    engines << EnjuTrunkCirculation::Engine if defined? EnjuTrunkCirculation
    engines << EnjuTrunkOrder::Engine       if defined? EnjuTrunkOrder
    Severity: Major
    Found in app/models/manifestation.rb - About 4 days to fix

      File manifestations_controller.rb has 1611 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      class ManifestationsController < ApplicationController
        authorize_function
        add_breadcrumb "I18n.t('breadcrumb.search_manifestations')", 'manifestations_path', :only => [:index] #, :unless => proc{params}
      #  add_breadcrumb "I18n.t('breadcrumb.search_manifestations')", 'manifestations_path(params)', :only => [:index], :if => proc{params}
        add_breadcrumb "I18n.t('page.showing', :model => I18n.t('activerecord.models.manifestation'))", 'manifestation_path(params[:id])', :only => [:show]
      Severity: Major
      Found in app/controllers/manifestations_controller.rb - About 4 days to fix

        File nacsis_cat.rb has 1452 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        class NacsisCat
          include ActiveModel::Conversion
          extend ActiveModel::Naming
        
          attr_accessor :record
        Severity: Major
        Found in app/models/nacsis_cat.rb - About 3 days to fix

          Method output_detail has a Cognitive Complexity of 177 (exceeds 5 allowed). Consider refactoring.
          Open

            def self.output_detail(wbstyles, sheet, data, conditions, cols, remove = nil)
              default_style = wbstyles.add_style :font_name => Setting.item_statistics_print_excelx.fontname
          
              if remove.blank?
                book_sym = "book".to_sym
          Severity: Minor
          Found in app/models/item_statistics.rb - About 3 days 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_csv has a Cognitive Complexity of 172 (exceeds 5 allowed). Consider refactoring.
          Open

            def output_csv
              approvals = Approval.scoped
              # approval_identifier
              unless params[:approval_identifier].blank?
                approvals = approvals.where(["approvals.approval_identifier like ?", params[:approval_identifier] + "%"])
          Severity: Minor
          Found in app/controllers/approvals_controller.rb - About 3 days 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

          File item.rb has 1307 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require EnjuTrunkFrbr::Engine.root.join('app', 'models', 'item')
          require EnjuTrunkCirculation::Engine.root.join('app', 'models', 'item') if Setting.operation
          require EnjuTrunkOrder::Engine.root.join('app', 'models', 'item') if defined? EnjuTrunkOrder
          class Item < ActiveRecord::Base
            extend ActiveRecordExtension
          Severity: Major
          Found in app/models/item.rb - About 3 days to fix

            File import_book.rb has 1148 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            module EnjuTrunk
              module ImportBook
                SERIES_REQUIRE_COLUMNS = %w(
                  series.original_title
                  series.series_statement_identifier
            Severity: Major
            Found in lib/enju_trunk/resourceadapter/import_book.rb - About 2 days to fix

              Method make_query_string_and_hl_pattern has a Cognitive Complexity of 138 (exceeds 5 allowed). Consider refactoring.
              Open

                def make_query_string_and_hl_pattern
                  qwords = []
                  highlight = []
              
                  #
              Severity: Minor
              Found in app/controllers/manifestations_controller.rb - About 2 days 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 543 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def initialize(user, ip_address = nil)
                  # TODO
                  initialize_circulation(user, ip_address) if Setting.operation
                  initialize_event(user, ip_address) if defined?(EnjuEvent)
                  initialize_subject(user, ip_address) if defined?(EnjuSubject)
              Severity: Major
              Found in app/models/ability.rb - About 2 days to fix

                Method make_form_boolean has a Cognitive Complexity of 126 (exceeds 5 allowed). Consider refactoring.
                Open

                 def make_form_boolean(string, system_configuration)
                   ['true', 'false'].each do |state|
                     string << "<input type=radio
                                       name=system_configurations[#{ system_configuration.id }]
                                       value=#{state} "
                Severity: Minor
                Found in app/helpers/system_configurations_helper.rb - About 2 days 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_reminder_postal_card has a Cognitive Complexity of 118 (exceeds 5 allowed). Consider refactoring.
                Open

                  def self.output_reminder_postal_card(file, reminder_lists, user, current_user)
                    logger.info "create_file=> #{file}"
                    report_path = EnjuTrunk.report_path
                
                    report = ThinReports::Report.create do
                Severity: Minor
                Found in app/models/reminder_list.rb - About 2 days 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 excel_worksheet_value has a Cognitive Complexity of 113 (exceeds 5 allowed). Consider refactoring.
                Open

                  def excel_worksheet_value(ws_type, ws_col, sep_flg, ccount, item = nil)
                    if ws_type == 'root'
                      if root_manifestation = series_statement.try(:root_manifestation)
                        root_manifestation.excel_worksheet_value('book', ws_col, sep_flg, ccount, item)
                      else
                Severity: Minor
                Found in app/models/manifestation.rb - About 2 days 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

                File user.rb has 864 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                require EnjuTrunkOrder::Engine.root.join('app', 'models', 'user') if defined? EnjuTrunkOrder
                class User < ActiveRecord::Base
                  self.extend UsersHelper
                  # Include default devise modules. Others available are:
                  # :token_authenticatable, :lockable and :timeoutable
                Severity: Major
                Found in app/models/user.rb - About 2 days to fix

                  Method update_or_create_manifestation has a Cognitive Complexity of 98 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def update_or_create_manifestation(datas, sheet, manifestation_type, manifestation, not_set_serial_number, series_statement, error_msgs, external_resource, is_root = false)
                        if is_root
                          # root_manifestationのための処理を行う
                          field = 'root'
                          return nil unless series_statement
                  Severity: Minor
                  Found in lib/enju_trunk/resourceadapter/import_book.rb - About 1 day 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 export_removing_list has a Cognitive Complexity of 96 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def self.export_removing_list(out_dir, file_type = nil)
                      raise "invalid parameter: no path" if out_dir.nil? || out_dir.length < 1
                      tsv_file = out_dir + "removing_list.tsv"
                      pdf_file = out_dir + "removing_list.pdf"
                      logger.info "output removing_list tsv: #{tsv_file} pdf: #{pdf_file}"
                  Severity: Minor
                  Found in app/models/item.rb - About 1 day 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_columns has a Cognitive Complexity of 96 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def self.output_columns(wbstyles, sheet, conditions, cols)
                      merge_style = wbstyles.add_style :font_name => Setting.item_statistics_print_excelx.fontname, :alignment => {:horizontal => :center, :vertical => :center}
                      if cols.length > 0
                        # 1行目
                        if conditions.aggregation_first.present?
                  Severity: Minor
                  Found in app/models/item_statistics.rb - About 1 day 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 92 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def index
                      set_reserve_user
                      search_opts = make_index_plan # 検索動作の方針を抽出する
                  
                      @seconds = Benchmark.realtime do
                  Severity: Minor
                  Found in app/controllers/manifestations_controller.rb - About 1 day 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 advanced_search_condition_summary has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def advanced_search_condition_summary(opts = {})
                        return "(#{I18n.t('page.new_resource')})" if params[:mode] == 'recent'
                        return "(#{params[:solr_query]})" if params[:solr_query].present?
                  
                        summary_ary = []
                  Severity: Minor
                  Found in lib/enju_trunk/enju_trunk_helper.rb - About 1 day 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 set_manifestations_data has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def self.set_manifestations_data(column, manifestation_ids)
                      logger.debug "begin export manifestations"
                      transaction do
                        where(:id => manifestation_ids).
                            includes(
                  Severity: Minor
                  Found in app/models/manifestation.rb - About 1 day 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