Method check_integrity_output
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def check_integrity_output(execute_msg)
#stdout = execute_msg[:stdout]
stderr = execute_msg[:stderr]
result = {
- 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
File audio_ffmpeg.rb
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
module BawAudioTools
# Used to manipulate the ffmpeg command line tool
class AudioFfmpeg
ERROR_FRAME_SIZE_1 = 'Could not find codec parameters for stream [0-9]+ \\(Audio\\: [a-zA-Z0-9]+\\, [0-9]+ channels\\, [a-zA-Z0-9]+\\)\\: unspecified frame size'
ERROR_FRAME_SIZE_2 = 'Failed to read frame size: Could not seek to [0-9]+\\.'
Method check_integrity_output
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def check_integrity_output(execute_msg)
#stdout = execute_msg[:stdout]
stderr = execute_msg[:stderr]
result = {
Method codec_calc
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def codec_calc(target)
# high quality codec settings
# https://trac.ffmpeg.org/wiki/GuidelinesHighQualityAudio
# http://trac.ffmpeg.org/wiki/TheoraVorbisEncodingGuide
Method parse_ffprobe_output
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def parse_ffprobe_output(source, execute_msg)
# ffprobe std err contains info (separate on first equals(=))
result = {}
ffprobe_current_block_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 modify_command
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def modify_command(source, source_info, target, start_offset = nil, end_offset = nil, channel = nil, sample_rate = nil)
raise Exceptions::FileNotFoundError, "Source does not exist: #{source}" unless File.exist? source
raise Exceptions::FileAlreadyExistsError, "Target exists: #{target}" if File.exist? target
raise ArgumentError, "Source and Target are the same file: #{target}" if source == 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 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def modify_command(source, source_info, target, start_offset = nil, end_offset = nil, channel = nil, sample_rate = nil)
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 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
Avoid too many return
statements within this method. Open
return nil
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')