Showing 214 of 258 total issues
Method modify_mp3splt
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def modify_mp3splt(source, source_info, target, start_offset, end_offset)
Method from_executables
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.from_executables(audio_master, im_convert_exe, im_identify_exe, spectrogram_defaults, temp_dir)
Method from_executables
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.from_executables(audio_defaults, logger, temp_dir, timeout_sec, opts = {})
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)
Method modify_wavpack
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def modify_wavpack(source, source_info, target, start_offset, end_offset)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(audio_defaults, logger, temp_dir, run_program, opts = {})
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)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(original_store, analysis_cache, logger, dir_worker_top, dir_programs)
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)
Method validate_hash_key
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def validate_hash_key(hash, key, value_types)
raise CustomErrors::FilterArgumentError, "Hash must include key #{key}." unless hash.include?(key)
value_types_normalised = [value_types].flatten
value = hash[key]
- 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 filter_settings
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.filter_settings
{
valid_fields: [:id, :name, :description, :notes, :creator_id,
:created_at, :updater_id, :updated_at, :deleter_id, :deleted_at, :region_id],
render_fields: [:id, :name, :description, :notes, :creator_id,
- 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 filter_settings
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.filter_settings(priority_algorithm = nil)
result = {
valid_fields: [
:id, :dataset_id, :audio_recording_id, :start_time_seconds,
:end_time_seconds, :order, :creator_id, :created_at, :priority
- 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_name
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def validate_name(name, allowed)
raise CustomErrors::FilterArgumentError, "Name must not be null, got #{name}" if name.blank?
raise CustomErrors::FilterArgumentError, "Name must be a symbol, got #{name}" unless name.is_a?(Symbol)
raise CustomErrors::FilterArgumentError, "Allowed must be an Array, got #{allowed}" unless allowed.is_a?(Array)
raise CustomErrors::FilterArgumentError, "Name must be in #{allowed}, got #{name}" unless allowed.include?(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 make_site_annotations_path
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def make_site_annotations_path(project_value, site_value)
project_id = project_value.is_a?(Project) ? project_value.id : project_value.to_i
site_id = site_value.is_a?(Site) ? site_value.id : site_value.to_i
site_tz = site_value.is_a?(Site) && !site_value.rails_tz.blank? ? site_value.rails_tz : 'UTC'
data_request_path(selected_project_id: project_id, selected_site_id: site_id, selected_timezone_name: site_tz)
- 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_project_if_exists
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_project_if_exists(for_list_endpoint: false)
return unless params.key?(:project_id)
@project = Project.find(params[:project_id])
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def update
do_load_resource
do_authorize_instance
the_params = user_update_params.dup
- 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_level_combination
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def validate_level_combination(levels)
if levels.respond_to?(:each)
if (levels.include?(:none) || levels.include?('none')) && levels.size > 1
# none cannot be with other levels because this can be ambiguous, and points to a problem with how the
# permissions were obtained.
- 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 do_get_opts
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def do_get_opts
# normalize params and get access to rails request instance
allowed_params = params.slice(:analysis_job_id, :audio_recording_id, :results_path, :format).permit!.to_h
request_params = CleanParams.perform(allowed_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 update_status_params_check
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def update_status_params_check
opts = { error_info: { audio_recording_id: params[:id] } }
if @audio_recording.blank?
respond_error(
- 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 deep_map_internal
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def deep_map_internal(value, context, &block)
case value
when ::Hash
result = value.class.new
value.each do |key, item|
- 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"