Showing 25 of 25 total issues
Method write_entries
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def write_entries(entries, path, zipfile)
entries.each do |entry|
zipfile_path = path == '' ? entry : File.join(path, entry)
disk_file_path = File.join(src_path, zipfile_path)
- 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 map_rdf_strings
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def map_rdf_strings(tuples)
tuples.map do |(value, language)|
# need to skip blank entries here, otherwise we get a blank literal
# (""@"") which LDP doesn't like
next if value.blank?
- 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 gather_collections_to_add
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def gather_collections_to_add
collections_to_check = [self]
[].tap do |collections|
until collections_to_check.size.zero?
- 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 add
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def add(env, id)
collection = ::Collection.find(id)
return unless env.current_ability.can?(:deposit, collection)
- 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_field_options
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def build_field_options(value, _index)
return super if defined?(super)
dom_id = input_dom_id if respond_to?(:input_dom_id)
dom_id ||= "#{object_name}_#{attribute_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"