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")
- Read upRead up
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
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})"
- Read upRead up
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
- Read upRead up
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
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)
Avoid deeply nested control flow statements. Open
next_volume = current_volume + self.volume_param if self.volume_param && (vol > current_volume)
Avoid deeply nested control flow statements. Open
sql << " AND " unless Shelf.categories.first == c
Avoid deeply nested control flow statements. Open
unless current_user == @user
access_denied; return
end
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
- Read upRead up
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)
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
Avoid deeply nested control flow statements. Open
next if c == 'other'
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
- Read upRead up
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?
- Read upRead up
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'
- Read upRead up
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'
- Read upRead up
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
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
- Read upRead up
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)