Showing 95 of 107 total issues
Method commits_path
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def commits_path(walker, limit, offset, path, &block)
commits = []
object = nil
commit = 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 list
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def list()
type_iri = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'
label_iri = 'http://www.w3.org/2000/01/rdf-schema#label'
comment_iri = 'http://www.w3.org/2000/01/rdf-schema#comment'
defined_iri = 'http://www.w3.org/2000/01/rdf-schema#isDefinedBy'
- 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 initialize
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(user, access_token)
# Define abilities for the passed in user here.
user ||= User.new # guest user (not logged in)
Class Ontology
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class Ontology < LocIdBaseModel
# Ontohub Library Includes
include Commentable
include Metadatable
Class RepositoryFile
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class RepositoryFile < FakeRecord
class PathValidator < ActiveModel::Validator
def validate(record)
if record.repository.points_through_file?(record.target_path)
record.errors[:target_directory] = "Error! This path points to or through a file."
Class GitRepository
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class GitRepository
require 'git_repository/config'
include GitRepository::Config
include GitRepository::Cloning
Method start_element
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def start_element(name, attributes)
@path << name
case name
when ROOT
callback(:root, Hash[*[attributes]])
- 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 list
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
def list()
type_iri = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'
label_iri = 'http://www.w3.org/2000/01/rdf-schema#label'
comment_iri = 'http://www.w3.org/2000/01/rdf-schema#comment'
defined_iri = 'http://www.w3.org/2000/01/rdf-schema#isDefinedBy'
Method initialize
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def initialize(user, access_token)
# Define abilities for the passed in user here.
user ||= User.new # guest user (not logged in)
- 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 permission?
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def permission?(role, user)
# Deny if user is nil
return false unless user
# Deny if user is of wrong 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 start_element
has 59 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 ontology_nav
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ontology_nav(ontology, current_page)
resource = resource_chain.last
content_page = ontology.distributed? ? :children : :symbols
@top_level_pages = [
Method end_element
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
@path.pop
case name
when ONTOLOGY
- 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 end_element
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
order = :end
@path.pop
case 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 fancy_tag
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def fancy_tag(resource, tags)
result = ""
first = true
tags.each do |tag|
if (eval "resource." + tag.to_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 initialize
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def initialize(collection_path, options)
@collection_path = collection_path
@editable = true
options.each do |key,value|
- 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 44 lines of code (exceeds 25 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']
Method commits_all
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def commits_all(walker, limit, offset, &block)
commits = []
original_offset = offset
walker.each_with_index do |c,i|
- 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_element
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def start_element(name, attributes)
order = :start
@path << name
case name
when ROOT
Method end_element
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name)
order = :end
@path.pop
case name