zacstewart/tengai

View on GitHub

Showing 9 of 25 total issues

File vector_ephemeris_parser.rb has 4347 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'date'
module Tengai
  class VectorEphemerisParser
    def self.parse(data, ephemeris_table_parser=EphemerisTableParser)
      data = data.unpack('c*') if data.is_a? String
Severity: Major
Found in ext/horizons/vector_ephemeris_parser.rb - About 1 wk to fix

    Method parse has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
    Open

        def self.parse(data, ephemeris_table_parser=EphemerisTableParser)
          data = data.unpack('c*') if data.is_a? String
          eof = data.length
    
          
    Severity: Minor
    Found in ext/horizons/vector_ephemeris_parser.rb - About 1 day 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 has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
    Open

        def self.parse(data)
          data = data.unpack('c*') if data.is_a? String
          eof = data.length
    
          
    Severity: Minor
    Found in ext/horizons/body_data_sheet_parser.rb - About 1 day 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 has 147 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def self.parse(data, ephemeris_table_parser=EphemerisTableParser)
          data = data.unpack('c*') if data.is_a? String
          eof = data.length
    
          
    Severity: Major
    Found in ext/horizons/vector_ephemeris_parser.rb - About 5 hrs to fix

      Method parse has 127 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def self.parse(data)
            data = data.unpack('c*') if data.is_a? String
            eof = data.length
      
            
      Severity: Major
      Found in ext/horizons/body_data_sheet_parser.rb - About 5 hrs to fix

        File body_data_sheet_parser.rb has 305 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require 'date'
        
        module Tengai
          class BodyDataSheetParser
            def self.parse(data)
        Severity: Minor
        Found in ext/horizons/body_data_sheet_parser.rb - About 3 hrs to fix

          Method receive_data has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def receive_data(data)
                case data
                when Prompts::DEFAULT
                  send_command 'E'
                when Prompts::TABLE
          Severity: Minor
          Found in lib/tengai/requests/telnet_ephemeris_request.rb - About 1 hr to fix

            Avoid deeply nested control flow statements.
            Open

                        case _ephemeris_parser_actions[_acts - 1]
            when 0 then
            # line 6 "ext/horizons/vector_ephemeris_parser.rl"
                    begin
             mark = p         end
            Severity: Major
            Found in ext/horizons/vector_ephemeris_parser.rb - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                          case _body_data_sheet_parser_actions[_acts - 1]
              when 0 then
              # line 5 "ext/horizons/body_data_sheet_parser.rl"
                      begin
               mark = p         end
              Severity: Major
              Found in ext/horizons/body_data_sheet_parser.rb - About 45 mins to fix
                Severity
                Category
                Status
                Source
                Language