Method check_integrity_output
has a Cognitive Complexity of 19 (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 253 lines of code (exceeds 250 allowed). Consider refactoring. Open
module BawAudioTools
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 41 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 modify_command
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def modify_command(source, source_info, target, start_offset = nil, end_offset = nil, channel = nil, sample_rate = nil)
fail Exceptions::FileNotFoundError, "Source does not exist: #{source}" unless File.exists? source
fail Exceptions::FileAlreadyExistsError, "Target exists: #{target}" if File.exists? target
fail 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 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
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 if hash[:description].starts_with?('max_analyze_duration')
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?('Application provided invalid, non monotonically increasing dts to muxer in stream')
Method parse_ffprobe_output
has a Cognitive Complexity of 6 (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"