Showing 14 of 14 total issues
Method initialize
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
def initialize(path)
@path = path
if remote?
@head = head
- 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
Class EncodingOptions
has 38 methods (exceeds 20 allowed). Consider refactoring. Open
class EncodingOptions < Hash
def initialize(options = {})
merge!(options)
end
Method transcode_movie
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def transcode_movie
FFMPEG.logger.info("Running transcoding...\n#{command}\n")
@output = ""
Open3.popen3(*command) do |_stdin, _stdout, stderr, wait_thr|
- 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 initialize
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(path)
@path = path
if remote?
@head = head
Method apply_transcoder_options
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def apply_transcoder_options
# if true runs #validate_output_file
@transcoder_options[:validate] = @transcoder_options.fetch(:validate) { true }
return if @movie.nil? || @movie.calculated_aspect_ratio.nil?
- 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 screenshot_seek_time
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def screenshot_seek_time(options)
# Returns any seek_time for the screenshot and removes it from the options
# such that the seek time can be moved to an input option for improved FFMPEG performance
if options.is_a?(Array)
seek_time_idx = options.find_index('-seek_time') unless options.find_index('-screenshot').nil?
- 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 transcode_movie
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def transcode_movie
FFMPEG.logger.info("Running transcoding...\n#{command}\n")
@output = ""
Open3.popen3(*command) do |_stdin, _stdout, stderr, wait_thr|
Method head
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def head(location=@path, limit=FFMPEG.max_http_redirect_attempts)
url = URI(location)
return unless url.path
http = Net::HTTP.new(url.host, url.port)
- 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_output_file
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def validate_output_file(&block)
@errors << "no output file created" unless File.exist?(@output_file)
@errors << "encoded file is invalid" if encoded.nil? || !encoded.valid?
if encoding_succeeded?
- 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 each_with_timeout
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def each_with_timeout(pid, seconds, sep_string=$/)
last_update = Time.now
current_thread = Thread.current
check_update_thread = Thread.new do
- 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 screenshot_to_transcoder_options
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def screenshot_to_transcoder_options(seek_time, transcoder_options)
return if seek_time.to_s == ''
input_options = transcoder_options[:input_options] || []
# remove ss from input options because we're overriding from seek_time
- 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 to_a
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def to_a
params = []
# codecs should go before the presets so that the files will be matched successfully
# all other parameters go after so that we can override whatever is in the preset
- 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 calculate_aspect
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def calculate_aspect(ratio)
return nil unless ratio
w, h = ratio.split(':')
return nil if w == '0' || h == '0'
@rotation.nil? || (@rotation == 180) ? (w.to_f / h.to_f) : (h.to_f / w.to_f)
- 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 initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize(input, output_file, options = EncodingOptions.new, transcoder_options = {})
if input.is_a?(FFMPEG::Movie)
@movie = input
@input = input.path
end
- 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"