Showing 25 of 44 total issues
Method parse
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def parse
if @buf.length > MAX_BUFFER_SIZE # Wrong format and the buffer is filled up, bail
raise WrongInputError, "Atom buffer overflow at #{MAX_BUFFER_SIZE} bytes, this is definitely not a Shake script"
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"
Further reading
Method stabilize
has 17 arguments (exceeds 4 allowed). Consider refactoring. Open
def stabilize(imageIn, applyTransform, inverseTransform, trackType,
track1X, track1Y,
stabilizeX, stabilizeY,
track2X, track2Y,
matchScale,
Method matchmove
has 17 arguments (exceeds 4 allowed). Consider refactoring. Open
def matchmove(bgImage, fgImage, applyTransform,
trackType,
track1X,
track1Y,
matchX,
Method tracker
has 17 arguments (exceeds 4 allowed). Consider refactoring. Open
def tracker(input, trackRange, subPixelRes, matchSpace,
referenceTolerance, referenceBehavior, failureTolerance, failureBehavior, limitProcessing, referencFrame,
s1, s2, s3, s4, s5, s6, *trackers)
Method parse
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse
if @buf.length > MAX_BUFFER_SIZE # Wrong format and the buffer is filled up, bail
raise WrongInputError, "Atom buffer overflow at #{MAX_BUFFER_SIZE} bytes, this is definitely not a Shake script"
end
Method run_export
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run_export(tracker_data_io, importer, exporter)
points, keyframes, percent_complete = 0, 0, 0.0
last_reported_percentage = 0.0
report_progress(percent_complete, "Starting the parser")
Method each
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def each
@io.each do | line |
if line =~ /TrackName (.+)/
yield(@last_tracker) if @last_tracker && @last_tracker.any?
@last_tracker = Tracksperanto::Tracker.new(:name => $1)
- 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
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def each
wrapped_io = Tracksperanto::ExtIO.new(@io)
detect_columns(wrapped_io)
trackers = {}
filtering_trackers_from(wrapped_io) do | name, frame, x, y |
- 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 extract_trackers
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def extract_trackers(io)
while line = io.gets do
if line =~ /^(\w+)/ # Tracker name
yield(@last_tracker) if @last_tracker && @last_tracker.any?
@last_tracker = Tracksperanto::Tracker.new(:name => line.strip)
- 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
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def each
@io.each_line do | line |
name, frame, x, y, frame_status = line.split
# Do we already have this tracker?
- 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 detect_format
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def detect_format(io)
report_progress("Detecting width and height")
lines = (0..2).map{ io.gets }
last_line = lines[-1]
int_groups = last_line.scan(/(\d+)/).flatten.map{|e| e.to_i }
- 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_importer_with_path_and_options
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def initialize_importer_with_path_and_options(from_input_file_path, options)
d = Tracksperanto::FormatDetector.new(from_input_file_path)
if options[:importer]
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def initialize(options)
@trackers = []
point_channels.each do | point_name |
next unless options[point_name]
point_channel = options[point_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 each
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def each
io = Tracksperanto::ExtIO.new(@io)
extract_width_height_and_aspect(io.gets_non_empty)
while line = io.gets_and_strip
- 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 collect_tracker
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def collect_tracker(name, x_curve, y_curve, corr_curve, *discard)
Method lerp
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def lerp(x, left_x, right_x, left_y, right_y)
Method each
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def each(&blk)
until @io.eof?
line = @io.gets
next if (!line || line =~ /^#/)
- 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 extract_width_and_height_from_stream
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def extract_width_and_height_from_stream(io)
w, h = nil, nil
w_matcher = /FrameWidth (\d+)/
h_matcher = /FrameHeight (\d+)/
- 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 tag_start
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def tag_start(element_name, attrs)
@path << element_name.downcase
if element_name.downcase == 'shot'
@parser.width = attrs["w"]
- 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 gets_non_empty
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def gets_non_empty
until eof?
line = gets
return nil if line.nil?
s = line.strip
- 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"