Showing 714 of 1,025 total issues
Method update_timestamps
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def update_timestamps(from, to)
begin
["updated_at"].each do |key|
if to.has_attribute?(key)
logger.debug("explicit_versioning - update_timestamps method - setting timestamp_column '#{key}'")
- 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_admin_defined_role_projects
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def resolve_admin_defined_role_projects
projects = Seek::Config.project_hierarchy_enabled ? self.projects_and_descendants : self.projects
admin_defined_role_projects.each do |role|
unless projects.include?(role.project)
- 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 cache_path
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def cache_path(size=nil, include_local_name=false)
id = self.kind_of?(Integer) ? self : self.id
if self.kind_of?(ContentBlob)
rtn = Seek::Config.temporary_filestore_path + '/image_assets'
elsif self.kind_of?(Avatar)
- 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 ontology_editor_display
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def ontology_editor_display type, root_id=nil, selected_id=nil
# login users can edit new defined assay/technology types
# only admin can edit/delete new defined assay/technology types
show_edit = false
- 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 too many return
statements within this function. Open
return [arcIntersections[0], arcIntersections[1]];
Avoid too many return
statements within this function. Open
return [arcIntersections[0], arcIntersections[1]];
Avoid too many return
statements within this function. Open
return [arcIntersections[0], arcIntersections[1]];
Avoid too many return
statements within this function. Open
return [arcIntersections[0], arcIntersections[1]];
Avoid too many return
statements within this method. Open
return nil
Avoid too many return
statements within this method. Open
return false
Avoid too many return
statements within this method. Open
return downloadable ? I18n.t('access.editing_downloadable') : I18n.t('access.editing')
Avoid too many return
statements within this method. Open
return "Invalid access type"
Avoid too many return
statements within this method. Open
return I18n.t('access.managing')
Avoid too many return
statements within this method. Open
return false
Avoid too many return
statements within this method. Open
return false
Avoid too many return
statements within this method. Open
return false unless process_from_url(item_params)
Avoid too many return
statements within this method. Open
return false unless process_upload(item_params)
Avoid too many return
statements within this method. Open
return false unless check_for_valid_scheme(item_params)
Avoid too many return
statements within this method. Open
return false
Avoid too many return
statements within this method. Open
return access_type >= Policy::MANAGING