guerilla-di/tracksperanto

View on GitHub

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
Severity: Minor
Found in lib/import/shake_grammar/lexer.rb - About 3 hrs to fix

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,
Severity: Major
Found in lib/import/shake_script.rb - About 2 hrs to fix

    Method matchmove has 17 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def matchmove(bgImage, fgImage, applyTransform,
          trackType,
          track1X,
          track1Y,
          matchX,
    Severity: Major
    Found in lib/import/shake_script.rb - About 2 hrs to fix

      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)
      Severity: Major
      Found in lib/import/shake_script.rb - About 2 hrs to fix

        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
        Severity: Minor
        Found in lib/import/shake_grammar/lexer.rb - About 1 hr to fix

          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")
          Severity: Minor
          Found in lib/pipeline/base.rb - About 1 hr to fix

            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)
            Severity: Minor
            Found in lib/import/shake_text.rb - About 1 hr to fix

            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 |
            Severity: Minor
            Found in lib/import/boujou.rb - About 1 hr to fix

            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)
            Severity: Minor
            Found in lib/import/equalizer3.rb - About 1 hr to fix

            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?
            Severity: Minor
            Found in lib/import/syntheyes.rb - About 55 mins to fix

            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 }
            Severity: Minor
            Found in lib/import/match_mover.rb - About 55 mins to fix

            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]
            Severity: Minor
            Found in lib/pipeline/base.rb - About 45 mins to fix

            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]
            Severity: Minor
            Found in lib/import/nuke_script.rb - About 45 mins to fix

            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
            Severity: Minor
            Found in lib/import/maya_live.rb - About 45 mins to fix

            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)
            Severity: Minor
            Found in lib/import/shake_script.rb - About 35 mins to fix

              Method lerp has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                def lerp(x, left_x, right_x, left_y, right_y)
              Severity: Minor
              Found in lib/tools/lens_disto.rb - About 35 mins to fix

                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 =~ /^#/)
                      
                Severity: Minor
                Found in lib/import/pftrack.rb - About 35 mins to fix

                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+)/
                Severity: Minor
                Found in lib/import/flame_stabilizer.rb - About 35 mins to fix

                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"]
                Severity: Minor
                Found in lib/import/match_mover_rzml.rb - About 35 mins to fix

                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
                Severity: Minor
                Found in lib/tracksperanto/ext_io.rb - About 25 mins to fix

                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

                Severity
                Category
                Status
                Source
                Language