guerilla-di/tracksperanto

View on GitHub

Showing 25 of 44 total issues

Method export_point has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def export_point(frame, float_x, float_y, float_residual)
    return super if @y_factor == DEFAULT_FACTOR && @x_factor == DEFAULT_FACTOR
    
    super(frame,
      x_factor < 0 ? (@w + (float_x * x_factor)) : (float_x * x_factor),
Severity: Minor
Found in lib/tools/scaler.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

Method raise_if_format_unsupported has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def self.raise_if_format_unsupported(judging_from_file_path)
    extension = File.extname(judging_from_file_path).downcase
    formats_and_extensions.each_pair do | matcher, message |
      raise Tracksperanto::UnsupportedFormatError, message if matcher.is_a?(String) && extension == matcher
      raise Tracksperanto::UnsupportedFormatError, message if matcher.is_a?(Regexp) && extension =~ matcher
Severity: Minor
Found in lib/tracksperanto/blacklist.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

Method parse_trackers has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def parse_trackers(name, io, &blk)
      first_tracker_line = io.gets.chomp
      
      # We will be reading one line too many possibly, so we need to know
      # where to return to in case we do
Severity: Minor
Found in lib/import/pftrack.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

Method scavenge_trackers_from_channels has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def scavenge_trackers_from_channels(channel_map, names)
      # Use Hash#keys.sort because we want a consistent export order
      # irregardless of the Ruby version in use
      # (hash keys are ordered on 1.9 and not ordered on 1.8)
      channel_map.keys.sort.each do |c|
Severity: Minor
Found in lib/import/flame_stabilizer.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

Method deep_include? has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def deep_include?(array_or_element, atom_name)
      return false unless array_or_element.is_a?(Array)
      return true if array_or_element[0] == atom_name
      
      array_or_element.each do | elem |
Severity: Minor
Found in lib/import/shake_script.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