MiraitSystems/enju_trunk

View on GitHub

Showing 1,155 of 1,155 total issues

Method new has a Cognitive Complexity of 87 (exceeds 5 allowed). Consider refactoring.
Open

  def new
    @select_theme_tags = Manifestation.struct_theme_selects if defined?(EnjuTrunkTheme)
    original_manifestation = Manifestation.where(:id => params[:manifestation_id]).first
    if original_manifestation # GET /manifestations/new?manifestation_id=1
      @manifestation = original_manifestation.dup
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 download_file has a Cognitive Complexity of 87 (exceeds 5 allowed). Consider refactoring.
Open

  def download_file
    @libraries = Library.all
    @bookstores = Bookstore.all
    @budgets = Budget.all
    @budget_types = BudgetType.all
Severity: Minor
Found in app/controllers/expenses_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

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

/* http://keith-wood.name/keypad.html
   Keypad field entry extension for jQuery v1.4.2.
   Written by Keith Wood (kbwood{at}iinet.com.au) August 2008.
   Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and 
   MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses. 
Severity: Major
Found in app/assets/javascripts/jquery.keypad.js - About 1 day to fix

    File item_statistics.rb has 706 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    class ItemStatistics
      include ActiveModel::Conversion
      include ActiveModel::Validations
      extend ActiveModel::Naming
      extend ActiveModel::Translation
    Severity: Major
    Found in app/models/item_statistics.rb - About 1 day to fix

      Method make_item_register_pdf has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring.
      Open

        def self.make_item_register_pdf(pdf_file, items, list_title = nil)
          report = EnjuTrunk.new_report('item_register.tlf')
          report.events.on :page_create do |e|
            e.page.item(:page).value(e.page.no)
          end
      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

      File enju_trunk_helper.rb has 668 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      module EnjuTrunk
        module EnjuTrunkHelper
          extend ActiveSupport::Concern
      
          included do
      Severity: Major
      Found in lib/enju_trunk/enju_trunk_helper.rb - About 1 day to fix

        Method new_manifestation_from_nacsis_cat has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
        Open

              def new_manifestation_from_nacsis_cat(nacsis_cat, book_types, volg_info = {}, manifestation = nil)
                return nil if nacsis_cat.blank? # || book_types.blank?
                nacsis_info = nacsis_cat.detail
                attrs = {}
                if nacsis_info[:source].nil?
        Severity: Minor
        Found in app/models/nacsis_cat.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

        Class Manifestation has 78 methods (exceeds 20 allowed). Consider refactoring.
        Open

        class Manifestation < ActiveRecord::Base
          extend ActiveRecordExtension
          self.extend ItemsHelper
          include EnjuNdl::NdlSearch
          include EnjuTrunk::OutputColumns
        Severity: Major
        Found in app/models/manifestation.rb - About 1 day to fix

          Class NacsisCat has 78 methods (exceeds 20 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 1 day to fix

            Method set_agent_value has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
            Open

              def set_agent_value(agent, row)
                #日本語化
                full_name = I18n.t('activerecord.attributes.agent.full_name')
                full_name_transcription = I18n.t('activerecord.attributes.agent.full_name_transcription')
                full_name_alternative = I18n.t('activerecord.attributes.agent.full_name_alternative')
            Severity: Minor
            Found in app/models/agent_import_file.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 import has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring.
            Open

              def import
                num = {:manifestation_imported => 0, :item_imported => 0, :manifestation_found => 0, :item_found => 0, :failed => 0}
                row_num = 2
                rows = open_import_file
                field = rows.first
            Severity: Minor
            Found in app/models/resource_import_file.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 initialize has a Cognitive Complexity of 68 (exceeds 5 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: Minor
            Found in app/models/ability.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 make_data has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
            Open

              def make_data
                items = Item.select("items.id")
                items = items.joins(:manifestation)
                items = items.joins(:budget_category)
                items = items.joins(:shelf)
            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

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

            /*
             * jQuery MiniColors: A tiny color picker built on jQuery
             *
             * Copyright: Cory LaViska for A Beautiful Site, LLC.
             *
            Severity: Major
            Found in app/assets/javascripts/jquery.minicolors.js - About 1 day to fix

              Method create has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
              Open

                def create
                  LossItem.transaction do 
                    flash[:notice] = ""
                    @loss_item = LossItem.new(params[:loss_item])
                    if params[:user_number]
              Severity: Minor
              Found in app/controllers/loss_items_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 article_attributes has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
              Open

                  def article_attributes(origin_datas, sheet)
                    attrs = {}
                    Manifestation.article_output_columns.each do |column|
                      name, value = sheet.field_name_and_data(origin_datas, column)
              
              
              Severity: Minor
              Found in lib/enju_trunk/resourceadapter/import_article.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 make_data has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
              Open

                def make_data
                  # 集計日付を求める
                  if md = self.checked_at_from.match(/^([0-9]{4})-([0-9]{2})$/)
                    checked_at_from = "#{md[1]}-#{md[2]}-01"
                  else
              Severity: Minor
              Found in app/models/checkout_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 import has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
              Open

                def import
                  sm_start!
                  #日本語化
                  full_name = I18n.t('activerecord.attributes.agent.full_name')
                  username = I18n.t('activerecord.attributes.user.username')
              Severity: Minor
              Found in app/models/agent_import_file.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

              File ability.rb has 558 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require EnjuTrunkCirculation::Engine.root.join('app', 'models', 'ability') if Setting.operation
              
              engines = []
              engines << EnjuSubject::Engine  if defined?(EnjuSubject)
              engines << EnjuEvent::Engine    if defined?(EnjuEvent)
              Severity: Major
              Found in app/models/ability.rb - About 1 day to fix

                Method get_list_size has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
                Open

                  def get_list_size
                    return nil unless request.xhr?
                    # budgets
                    budgets = params[:budgets] || []
                    all_budgets = eval(params[:all_budgets]) if params[:all_budgets]
                Severity: Minor
                Found in app/controllers/expenses_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

                Severity
                Category
                Status
                Source
                Language