Showing 95 of 107 total issues
Method ontology_nav
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def ontology_nav(ontology, current_page)
resource = resource_chain.last
content_page = ontology.distributed? ? :children : :symbols
@top_level_pages = [
- 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 commits_path
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def commits_path(walker, limit, offset, path, &block)
commits = []
object = nil
commit = nil
Method suspended_save_ontologies
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def suspended_save_ontologies(options={})
versions = []
commits_count = 0
highest_change_file_count = 0
user = options.delete(:user)
Method start_element
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def start_element(name, attributes)
@path << name
case name
when ROOT
callback(:root, Hash[*[attributes]])
Method end_element
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name)
@path.pop
case name
when ONTOLOGY
Method do_or_set_failed
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def do_or_set_failed(updating_klass = nil, &block)
raise ArgumentError.new('No block given.') unless block_given?
begin
yield
- 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 determine_image_type
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def determine_image_type(resource)
if resource.is_a?(Repository) && resource.is_private
return ['data-type', "Private#{resource.class.to_s}"]
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 pre_axiom
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def pre_axiom(hash)
if is_annotation_sentence?(hash)
m = hash['text'].match(%r{
Class:\s+(?<symbol_name>.+?) # Symbol Identifier
\s+
- 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 points_through_file?
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def points_through_file?(target_path)
return false if empty?
return false unless target_path
parts = target_path.split('/')
- 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_symbol_tree
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def create_symbol_tree
raise StandardError.new('Ontology is not OWL') unless owl?
# Delete previous set of categories
delete_edges
- 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 procure_ontology
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def procure_ontology(element, iri)
if element['reference'] == 'true'
ontology = Ontology.find_with_iri(iri)
if ontology.nil?
ontology = ExternalRepository.create_ontology(iri)
- 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 validate_each
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def validate_each(record, attribute, value)
bad_uris = []
if value.is_a?(Array)
value.each do |elem|
if elem.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 resource_chain
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def resource_chain
return @resource_chain if @resource_chain
if params[:logic_id]
@resource_chain = []
- 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 context_pane
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def context_pane
if params[:controller] == 'home'
'shared/user_repositories'
elsif params[:controller] == 'categories' && params[:action] == 'show'
'shared/user_ontologies'
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
def index
ontology = Ontology.find params[:ontology_id]
if ontology && (ontology.is?('OWL2') || ontology.is?('OWL'))
begin
- 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_or_create_from_hash
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def update_or_create_from_hash(hash, timestamp = Time.now)
raise ArgumentError, 'No hash given.' unless hash.is_a? Hash
e = where(text: hash['text']).first_or_initialize
- 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 fancy_link
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def fancy_link(resource)
return nil unless resource
data_type, value = determine_image_type(resource)
- 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 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def index
ontology = Ontology.find params[:ontology_id]
if ontology && (ontology.is?('OWL2') || ontology.is?('OWL'))
begin
Method update_or_create_from_hash
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_or_create_from_hash(hash, timestamp = Time.now)
raise ArgumentError, 'No hash given.' unless hash.is_a? Hash
e = where(text: hash['text']).first_or_initialize
Method determine_image_type
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def determine_image_type(resource)
if resource.is_a?(Repository) && resource.is_private
return ['data-type', "Private#{resource.class.to_s}"]
end