Showing 213 of 257 total issues
Method try_update
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def try_update(*context)
retry_attempts = self.class.retry_attempts
attempts_left = retry_attempts
failed = false
errors = []
- 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 arg_offsets
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def arg_offsets(start_offset, end_offset)
cmd_arg = ''
# start offset
# -ss Seek to given time position in seconds. hh:mm:ss[.xxx] syntax is also supported.
- 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_integrity_item
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check_integrity_item(hash)
return nil if hash.blank?
return nil if hash[:id].starts_with?('graph')
return nil if hash[:id].starts_with?('audio format')
- 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 info
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def info(source)
source = source.to_s
raise ArgumentError, "Source is not a wac file: #{source}" unless source.match(/\.wac$/)
raise Exceptions::AudioFileNotFoundError, "Could not find #{source}." unless File.exist?(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
Avoid too many return
statements within this method. Open
return nil if hash[:description].starts_with?('parser not found for')
Avoid too many return
statements within this method. Open
return nil if hash[:description].starts_with?('max_analyze_duration')
Avoid too many return
statements within this method. Open
return nil
Method update
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update
do_load_resource
do_authorize_instance
relevant_params = audio_recording_params
- 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 project_access_request
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def project_access_request(sender_user, project_ids, reason)
@sender_user = sender_user
@access_reason = reason
user_projects = {}
- 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
Function createMarker
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function createMarker(map, latLng, text, isInfoWindowOpen, draggable) {
var instructions = 'Drag marker to site location. Delete Latitude and Longitude to specify no location.';
// calculate defaults
var draggableValue = (typeof draggable !== 'undefined' || !draggable) ? draggable : false;
- 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_existing_files
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_existing_files(poll_locations)
existing_files = []
poll_locations.each do |location|
#dir = location[:dir]
- 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
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update
do_load_resource
get_audio_event
do_authorize_instance
- 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_sign_in_params
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_sign_in_params
# available parameters
email = params[:email].presence
login = params[:login].presence
password = params[:password].presence
- 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 make_visualise_path
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def make_visualise_path(value)
raise ArgumentError, 'Must provide project or site' if value.blank?
link = '/visualize?'
- 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 compose_range_string_node
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def compose_range_string_node(node, range_string)
validate_node_or_attribute(node)
range_regex = /(\[|\()(.*),(.*)(\)|\])/i
matches = range_string.match(range_regex)
- 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_yaml
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.generate_yaml(project_id, site_id, uploaders, recursive:, utc_offset: nil)
raise ArgumentError, 'recursive must be `true` or `false`' unless [true, false].include?(recursive)
uploader_section =
if uploaders.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 update
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update
@script = Script.find(params[:id])
unless @script.is_last_version?
respond_to do |format|
- 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 convert
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def convert(value, inline, words)
return nil if value.blank?
html = Kramdown::Document.new(value, KRAMDOWN_OPTIONS).to_html
- 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_channel
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate_channel(opts)
provided = validate_msg_provided(opts)
raise ArgumentError, "#{validate_msg_base} channel. #{provided}" unless opts.include? :channel
unless opts[:channel].to_i >= 0
raise ArgumentError, "channel #{validate_msg_eq_or_gt} 0: #{opts[:channel]}. #{provided}"
- 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 taxonomic_enforced
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def taxonomic_enforced
if type_of_tag == 'common_name' || type_of_tag == 'species_name'
errors.add(:is_taxonomic, "must be true for #{type_of_tag}") unless is_taxonomic
elsif is_taxonomic
errors.add(:is_taxonomic, "must be false for #{type_of_tag}")
- 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"