Showing 213 of 257 total issues
Method validate_each
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def validate_each(record, attribute, value)
# bypass rail's eager serialization of values
if value.is_a?(Hash)
return true if record.attributes_before_type_cast[attribute.to_s].is_a?(Hash)
- 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 create
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create
do_new_resource
do_set_attributes(site_params)
get_project_if_exists
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 audio_tool_segment
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def audio_tool_segment(extension, audio_tool_method, source, source_info, target, modify_parameters)
Method command
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def command(
source, _source_info, target,
width: 1800, height: 280,
colour_fg: 'FF9329FF', # audacity dark theme orange
scale: :lin
- 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 perform
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def perform(analysis_params)
analysis_params_sym = BawWorkers::Jobs::Analysis::Payload.normalize_opts(analysis_params)
BawWorkers::Config.logger_worker.info do
{ message: 'Started analysis', parameters: Job.format_params_for_log(analysis_params_sym) }
- 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 modify_command
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def modify_command(source, target)
raise ArgumentError, "Source is not a wac file: #{source}" unless source.to_s.match(/\.wac$/)
raise ArgumentError, "Target is not a wav file: : #{target}" unless target.to_s.match(/\.wav$/)
raise Exceptions::FileNotFoundError, "Source does not exist: #{source}" unless File.exist? source
raise Exceptions::FileAlreadyExistsError, "Target exists: #{target}" if File.exist? target
- 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 modify_command
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def modify_command(source, _source_info, target, start_offset = nil, end_offset = nil)
source = Pathname(source)
target = Pathname(target)
raise ArgumentError, "Source is not a mp3 file: #{source}" unless source.extname == '.mp3'
raise ArgumentError, "Target is not a mp3 file: : #{target}" unless target.extname == '.mp3'
- 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 percent_complete
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def percent_complete
if completed?
100
elsif queued?
0
- 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_status
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def update_status(*messages, status: nil, progress: nil, total: nil)
ensure_status
status ||= @status.status
unless TERMINAL_STATUSES.include?(status) || status == STATUS_WORKING
- 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 decode
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def decode(status_string)
return nil if status_string.nil?
raise ArgumentError, 'status_string was not a string' unless status_string.is_a?(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 modify_command
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def modify_command(source, _source_info, target, start_offset = nil, end_offset = nil)
source = Pathname(source)
target = Pathname(target)
raise ArgumentError, "Source is not a wavpack file: #{source}" unless source.extname == '.wv'
raise ArgumentError, "Target is not a wav file: : #{target}" unless target.extname == '.wav'
- 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
Consider simplifying this complex logical expression. Open
return if value.is_a?(NilClass) || value.is_a?(Integer) || value.is_a?(String) || value.is_a?(Float) ||
value.is_a?(TrueClass) || value.is_a?(FalseClass)
Method send_message
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def send_message(logged_in_user, model, rails_request, subject_prefix, template_name)
Method compose_not_range
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def compose_not_range(table, column_name, allowed, from, to)
Method compose_sites_from_projects
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def compose_sites_from_projects(field, filter_name, filter_value, table, valid_fields)
Method create_available_details
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_available_details(audio_recording, current, modified_params, formats, relevant_keys)
Method compose_range
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def compose_range(table, column_name, allowed, from, to)
Function createMarker
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function createMarker(map, latLng, text, isInfoWindowOpen, draggable) {
Method create_audio_recording_name
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_audio_recording_name(audio_recording, start_offset, end_offset, extra_options = '', extension = '')
Method modify_command
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def modify_command(source, _source_info, target, start_offset = nil, end_offset = nil)