Showing 95 of 107 total issues
Method search_with_params
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def search_with_params
if params[:query].present? && in_repository
search_params = params[:query].split(' ')
@anded << search_params.delete(search_params.first)
@anded = @anded.join(' AND ')
- 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 build_api_uri
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def build_api_uri(command, arguments = [], query_string = {})
hierarchy = [hets_instance.uri, command, *arguments].join('/')
query_part =
if query_string && !query_string.empty?
query_string.reduce('?') do |str, (key, val)|
- 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_used_axioms
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def process_used_axioms(proof_info, proof_attempt)
used_axioms = []
used_theorems = []
generated_axioms = []
proof_info[:used_axioms].each do |axiom_name|
- 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 get_object
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_object(rugged_commit, object_path='')
object = rugged_commit.tree
object_path.split('/').each do |part|
return nil unless object[part]
object = @repo.lookup(object[part][:oid]) unless part.empty?
- 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 commit_raw_file
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def commit_raw_file
return true if ontology.parent
raise "raw file missing" unless @raw_file
self.path = @raw_file.original_filename if self.path.nil?
# otherwise the file upload is broken (no implicit conversion of ActionDispatch::Http::UploadedFile into 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 import_remote
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def import_remote(type, user, source, name, params={})
unless SOURCE_TYPES.include?(type)
raise ArgumentError, "invalid source type: #{type}"
end
unless GitRepository.send "is_#{type}_repository?", source
- 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 axiom
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def axiom(current_element)
if logic_callback.pre_axiom(current_element)
axiom = ontology.axioms.update_or_create_from_hash(
current_element, importer.now)
ontology.axioms_count += 1
- 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_read_permissions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def check_read_permissions
unless params[:action] == 'index'
authorize! :show, resource.source.repository if resource.source
authorize! :show, resource.target.repository if resource.target
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 imported_axiom
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def imported_axiom(current_element)
if logic_callback.pre_axiom(current_element)
current_element['imported'] = true
axiom = ontology.axioms.update_or_create_from_hash(
current_element, importer.now)
- 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 in_process
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.in_process(user=nil)
return [] if user.nil?
state = "done"
stmt = ['state != ?', state] if user == true
if user.is_a?(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 deepest_existing_dir
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def deepest_existing_dir(path, commit_oid = nil)
path ||= '/'
dirs = path.split('/')
dir = nil
- 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 path_exists?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def path_exists?(path, commit_oid = nil)
return true if path == '/' || path.empty?
return false if empty?
rugged_commit = get_commit(commit_oid)
if !rugged_commit && path.empty?
- 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 mapping
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def mapping(current_element)
if logic_callback.pre_mapping(current_element)
alias_iris_for_mappings!(current_element)
mapping = parent_ontology.mappings.update_or_create_from_hash(
current_element, user, importer.now)
- 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 assign_path_parameters
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def assign_path_parameters(request, element)
ontology = element.is_a?(Ontology) ? element : element.ontology
proof_attempt = element.proof_attempt if @map[:proof_attempt]
theorem = element.theorem if @map[:theorem]
- 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 theorem
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def theorem(current_element)
if logic_callback.pre_theorem(current_element)
theorem = ontology.theorems.update_or_create_from_hash(
current_element, importer.now)
ontology.theorems_count += 1
- 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"