OpenC3/cosmos

View on GitHub
openc3-cosmos-cmd-tlm-api/app/models/messages_thread.rb

Summary

Maintainability
B
5 hrs
Test Coverage

Method setup_thread_body has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def setup_thread_body
    # The goal of this mode is to determine if we are starting with files or from
    # realtime
    if @start_time
      # start_time can be at most 1 minute in the future to prevent
Severity: Minor
Found in openc3-cosmos-cmd-tlm-api/app/models/messages_thread.rb - About 1 hr to fix

    Method handle_log_entry has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def handle_log_entry(log_entry)
        log_entry_time = log_entry["time"].to_i
    
        # Filter based on start_time
        return nil if @start_time and log_entry_time < @start_time
    Severity: Minor
    Found in openc3-cosmos-cmd-tlm-api/app/models/messages_thread.rb - About 1 hr to fix

      Avoid too many return statements within this method.
      Open

              return nil if @level != "DEBUG"
      Severity: Major
      Found in openc3-cosmos-cmd-tlm-api/app/models/messages_thread.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return nil if @level == "FATAL"
        Severity: Major
        Found in openc3-cosmos-cmd-tlm-api/app/models/messages_thread.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return nil if @level == "ERROR" or @level == "FATAL"
          Severity: Major
          Found in openc3-cosmos-cmd-tlm-api/app/models/messages_thread.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return nil if @level == "WARN" or @level == "ERROR" or @level == "FATAL"
            Severity: Major
            Found in openc3-cosmos-cmd-tlm-api/app/models/messages_thread.rb - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                  return log_entry
              Severity: Major
              Found in openc3-cosmos-cmd-tlm-api/app/models/messages_thread.rb - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                        return log_entry
                Severity: Major
                Found in openc3-cosmos-cmd-tlm-api/app/models/messages_thread.rb - About 30 mins to fix

                  There are no issues that match your filters.

                  Category
                  Status