Showing 95 of 107 total issues
Method perform
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def perform(repo_path, oldrev, newrev, refname, key_id)
Method import_remote
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def import_remote(type, user, source, name, params={})
Method commits_path
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def commits_path(walker, limit, offset, path, &block)
Method subnavigation
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def subnavigation(resource, pages, current_page, options = {},
additional_actions = [], partial: '/shared/subnavigation')
Method add_file
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_file(userinfo, tmp_path, target_path, message, &block)
Method commit_file
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def commit_file(userinfo, file_contents, target_path, message, &block)
Method update_redis
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.update_redis(repo_path, oldrev, newrev, refname, key_id)
Method update_or_create_from_hash
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def update_or_create_from_hash(hash, _user, timestamp = Time.now)
raise ArgumentError, 'No hash given.' unless hash.is_a? Hash
# hash['name'] # maybe nil, in this case, we need to generate a name
mapping_iri = locid_for_child(hash['name'] || hash['linkid'])
mapping_name = hash['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 generate_ontology_iri
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def generate_ontology_iri(internal_iri, current_element)
if current_element['reference'] == 'true'
ontology = Ontology.find_with_iri(internal_iri)
if ontology.nil?
ontohub_iri = ExternalRepository.determine_iri(internal_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 generate_fingerpint
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def generate_fingerpint
self.fingerprint = nil
return unless key?
output = ''
- 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 save_ontology
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def save_ontology(commit_oid, ontology_version_options, changed_files: [],
do_parse: true)
# We expect that this method is only called, when we can expect an ontology
# in this file.
file_extension = File.extname(ontology_version_options.filepath)
- 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 characters
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def characters(text)
case @path.last
when DESCRIPTION
if @current_logic
@current_logic.description ||= ''
- 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 flash_messages
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def flash_messages
out = ''
flash.each do |type, message|
unless type == :recaptcha_error
type = :info unless FLASH_TYPES.include?(type)
- 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 fetch_uri_content
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def fetch_uri_content(uri, limit: 10, write_file: nil, prev_resp: nil)
raise TooManyRedirectionsError.new(last_response: prev_resp) if limit == 0
Net::HTTP.get_response(URI(uri)) do |response|
response.read_body
if has_actual_content?(response)
- 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 method. Open
return true if perm.role == 'owner' and role == :reader
Avoid too many return
statements within this method. Open
return true if perm.role == 'editor' and role == :reader
Avoid too many return
statements within this method. Open
return true if perm.role == 'owner' and role == :editor
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"
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"