Showing 1,025 of 1,025 total issues
Method simulate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def simulate model_or_file
@@builder ||= Seek::JWS::Builder.new
if (model_or_file.is_a?(String))
- 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 delete
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def delete
if request.delete?
id=params[:id].split("_")[1].to_i
f=Favourite.find(id)
f.resource.destroy if f.resource.instance_of?(SavedSearch)
- 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 test_email_configuration
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def test_email_configuration
smtp_hash_old = ActionMailer::Base.smtp_settings
smtp_hash_new = {:address => params[:address], :enable_starttls_auto => params[:enable_starttls_auto]=="1", :domain => params[:domain], :authentication => params[:authentication], :user_name => (params[:user_name].blank? ? nil : params[:user_name]), :password => (params[:password].blank? ? nil : params[:password])}
smtp_hash_new[:port] = params[:port] if only_integer params[:port], 'port'
ActionMailer::Base.smtp_settings = smtp_hash_new
- 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 update_annotations_ajax
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update_annotations_ajax
entity=controller_name.singularize.camelize.constantize.find(params[:id])
if entity.can_view?
clear_cloud = immediately_clear_tag_cloud?
update_owned_annotations entity
- 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 configure_exception_notification
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def configure_exception_notification
if exception_notification_enabled && !Rails.application.config.consider_all_requests_local
SEEK::Application.config.middleware.use ExceptionNotification::Rack,
:email=>{
:sender_address => [self.noreply_sender],
- 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 show_via_url
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def show_via_url asset, content_blob=nil
content_blob = content_blob.nil? ? asset.content_blob : content_blob
code = url_response_code(content_blob.url)
if (["301","302", "401"].include?(code))
redirect_to(content_blob.url, :target=>"_blank")
- 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 publish!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def publish! comment=nil
if can_publish?
if gatekeeper_required? && !User.current_user.person.is_gatekeeper_of?(self)
false
else
- 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 resolve_tags_from_params
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def resolve_tags_from_params params, attr
tags=[]
selected_key = "#{attr}_autocompleter_selected_ids".to_sym
unrecognized_key = "#{attr}_autocompleter_unrecognized_items".to_sym
- 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 process_data_fuse_response
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def process_data_fuse_response response
parser = LibXML::XML::Parser.string(response, :encoding => LibXML::XML::Encoding::UTF_8)
doc = parser.parse
doc.find("//data_fuse_results/result").collect do |node|
r=DataFuseResult.new
- 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 create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create
@experimental_condition=ExperimentalCondition.new(params[:experimental_condition])
@experimental_condition.sop=@sop
@experimental_condition.sop_version = params[:version]
new_substances = params[:substance_autocompleter_unrecognized_items] || []
- 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 check_content
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def check_content blob, str, max_length=1500
char_count=0
filepath=blob.filepath
begin
f = File.open(filepath, "r")
- 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 resolve_feed_date
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.resolve_feed_date(entry)
date = nil
date = entry.try(:updated) if entry.respond_to?(:updated)
date ||= entry.try(:published) if entry.respond_to?(:published)
date ||= entry.try(:last_modified) if entry.respond_to?(:last_modified)
- 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 extract_main_parameters
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def extract_main_parameters doc
params={}
doc.find("//form[@id='main']/*/parameter").each do |node|
unless node.attributes['id'].nil?
id=node.attributes['id']
- 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 start
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.start number=0,restart=false
number = Seek::Config.workflows_enabled ? number : 0
action = restart ? "restart" : "start"
- 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 convert_to_pdf
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def convert_to_pdf dat_filepath=filepath, pdf_filepath=filepath('pdf')
begin
unless File.exists?(pdf_filepath)
#copy dat file to original file extension in order to convert to pdf on this file
file_extension = mime_extensions(content_type).first
- 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 arrayify_params
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def arrayify_params(blob_params)
result = []
Array(blob_params[:data_url]).each.with_index do |url, index|
unless url.blank?
result << { data_url: url,
- 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 send_immediate_subscriptions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def send_immediate_subscriptions activity_log
if Seek::Config.email_enabled && subscribers_are_notified_of?(activity_log.action)
subscriptions.each do |subscription|
if !subscription.person.user.nil? && subscription.person.receive_notifications? && subscription.immediately? && can_view?(subscription.person.user)
- 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 update_descendants_cache
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update_descendants_cache
disable_authorization_checks do
if new_record?
if parent_id
self.ancestors = self.calculate_ancestors
- 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 fix_file_extensions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def fix_file_extensions(run)
Dir.mktmpdir("#{run.id}", Rails.root.join("tmp")) do |tmp_dir|
tmp_zip = File.join(tmp_dir, "all.zip")
Zip::File.open(run.results.path) do |old_zip|
Zip::File.open(tmp_zip, Zip::File::CREATE) do |new_zip|
- 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 child_select_options
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def child_select_options parent, depth=0
result = []
unless parent.children.empty?
parent.children.sort { |a, b| a.title.downcase <=> b.title.downcase }.each do |child|
result << ["---"*depth + child.title, child.id]
- 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"