MiraitSystems/enju_trunk

View on GitHub

Showing 1,155 of 1,155 total issues

Function _disableKeypad has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _disableKeypad: function(target) {
        var control = $(target);
        if (!control.hasClass(this.markerClassName)) {
            return;
        }
Severity: Minor
Found in app/assets/javascripts/jquery.keypad.js - About 1 hr to fix

    Method get_manifestation_reserve_stats_tsv has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def self.get_manifestation_reserve_stats_tsv(manifestation_reserve_stat, stats)
        data = String.new
        data << "\xEF\xBB\xBF".force_encoding("UTF-8") + "\n"
    
        # term
    Severity: Minor
    Found in app/models/manifestation_reserve_stat.rb - About 1 hr to fix

      Method set_column has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def self.set_column(selected_column, manifestation_ids)
          col_spec = OUTPUT_COLUMN_FIELDS.inject({}) do |spec, name|
            spec[name] = select_output_column_spec(name)
            spec
          end
      Severity: Minor
      Found in app/models/manifestation.rb - About 1 hr to fix

        Method get_manifestation_checkout_stats_tsv has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def self.get_manifestation_checkout_stats_tsv(manifestation_checkout_stat, stats)
            data = String.new
            data << "\xEF\xBB\xBF".force_encoding("UTF-8") + "\n"
        
            # manifestation_checkout_stat
        Severity: Minor
        Found in app/models/manifestation_checkout_stat.rb - About 1 hr to fix

          Method add_extexts has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def self.add_extexts(extexts, item_id)
              return [] if extexts.blank?
              list = []
              extexts.each do |key, value|
                next if value['value'].blank?
          Severity: Minor
          Found in app/models/item_extext.rb - About 1 hr to fix

            Method make_catalog_pdf has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def self.make_catalog_pdf(pdf_file, manifestations, list_title = nil)
                report = EnjuTrunk.new_report("#{list_title}.tlf")
                #report page
                report.events.on :page_create do |e|
                  e.page.item(:page).value(e.page.no)
            Severity: Minor
            Found in app/models/item.rb - About 1 hr to fix

              Method make_export_series_statements_list_pdf has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def self.make_export_series_statements_list_pdf(items, acquired_at)
                  return false if items.blank?
                  report = EnjuTrunk.new_report('series_statements_list')
              
                  report.events.on :page_create do |e|
              Severity: Minor
              Found in app/models/item.rb - About 1 hr to fix

                Method get_user_reserve_stats_tsv has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def self.get_user_reserve_stats_tsv(user_reserve_stat, stats)
                    data = String.new
                    data << "\xEF\xBB\xBF".force_encoding("UTF-8") + "\n"
                
                    # term
                Severity: Minor
                Found in app/models/user_reserve_stat.rb - About 1 hr to fix

                  Method create_pdf_user_number_list has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def create_pdf_user_number_list(start_number, end_number)
                      dir_base = "#{Rails.root}/private/system/barcode_list/#{self.id}/original/"
                      FileUtils.mkdir_p(dir_base) unless FileTest.exist?(dir_base)
                  
                      filename = "barcode.pdf"
                  Severity: Minor
                  Found in app/models/barcode_list.rb - About 1 hr to fix

                    Method ouput_columns has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def self.ouput_columns
                        return [{name:"approval_identifier"},
                                {name:"identifier"},
                                {name:"original_title"},
                                {name:"four_priority_areas"},
                    Severity: Minor
                    Found in app/models/approval.rb - About 1 hr to fix

                      Method get_user_checkout_stats_tsv has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def self.get_user_checkout_stats_tsv(user_checkout_stat, stats)
                          data = String.new
                          data << "\xEF\xBB\xBF".force_encoding("UTF-8") + "\n"
                      
                          # term
                      Severity: Minor
                      Found in app/models/user_checkout_stat.rb - About 1 hr to fix

                        Method parse_option! has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def parse_option!(cmd_path, argv)
                            option = {}
                        
                            OptionParser.new do |o|
                              o.banner = "使い方: #{cmd_path.sub(/\.rb\z/, '')} options term"
                        Severity: Minor
                        Found in lib/enju_trunk/scripts/ndl_statistics.rb - About 1 hr to fix

                          Method initialize_output_column_spec has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                def initialize_output_column_spec(spec_hash = OUTPUT_COLUMN_SPEC, force_all = false)
                                  clear_cache!
                          
                                  spec_file = "#{Rails.root}/lib/enju_trunk/columns_spec.csv"
                                  spec_file = Gem::Specification.find_by_name("enju_trunk").gem_dir + '/lib/enju_trunk/columns_spec.csv' unless File.exist?(spec_file)
                          Severity: Minor
                          Found in lib/enju_trunk/output_columns.rb - About 1 hr to fix

                            Method import_series_statement has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def import_series_statement(row)
                                issn = nil
                                if row['issn'].present?
                                  issn = Lisbn.new(row['issn'].to_s)
                                end
                            Severity: Minor
                            Found in app/models/resource_import_file.rb - About 1 hr 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 check_remove_item has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def check_remove_item
                                if self.circulation_status_id == CirculationStatus.where(name: 'Removed').first.try(:id) or self.remove_reason
                                  self.removed_at = Time.zone.now if self.removed_at.nil?
                                  manifestation = nil
                                  if self.manifestation
                            Severity: Minor
                            Found in app/models/item.rb - About 1 hr 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 import has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def self.import(id = nil)
                                if !id.nil?
                                  file = ResourceImportFile.find(id) rescue nil
                                  file.import_start unless file.nil?
                                else
                            Severity: Minor
                            Found in app/models/resource_import_file.rb - About 1 hr 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 _checkConvert has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                                _checkConvert: function(new_values) {
                                    if(!this.flagConvert) {
                                        if(Math.abs(this.values.length - new_values.length) > 1) {
                                            var tmp_values = new_values.join('').replace(AutoKana.kana_compacting_pattern, '').split('');
                                            if(Math.abs(this.values.length - tmp_values.length) > 1) {
                            Severity: Minor
                            Found in app/assets/javascripts/jquery.autoKana.js - About 1 hr 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 calc_file has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def self.calc_file(word, date)
                                require "find"
                                #directory = "#{Rails.root}/log" # <= if use all file of search.log
                                file = "#{Rails.root}/log/search.log"
                            
                            
                            Severity: Minor
                            Found in app/models/keyword_count.rb - About 1 hr 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 import has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def self.import(id = nil)
                                #AgentImportFile.not_imported.each do |file|
                                #  file.import_start
                                #end
                                if !id.nil?
                            Severity: Minor
                            Found in app/models/agent_import_file.rb - About 1 hr 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_date_of_death has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def set_date_of_death
                                if death_date.blank?
                                        date = nil
                                    else
                                        begin
                            Severity: Minor
                            Found in app/models/agent.rb - About 1 hr 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