OpenC3/cosmos

View on GitHub
openc3/lib/openc3/microservices/decom_microservice.rb

Summary

Maintainability
B
4 hrs
Test Coverage

Method limits_change_callback has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def limits_change_callback(packet, item, old_limits_state, value, log_change)
      return if @cancel_thread
      # Make a copy because packet_time is frozen
      packet_time = packet.packet_time.dup
      if value
Severity: Minor
Found in openc3/lib/openc3/microservices/decom_microservice.rb - About 1 hr to fix

    Method run has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def run
          setup_microservice_topic()
          while true
            break if @cancel_thread
    
    
    Severity: Minor
    Found in openc3/lib/openc3/microservices/decom_microservice.rb - About 1 hr to fix

      Method decom_packet has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def decom_packet(_topic, msg_id, msg_hash, _redis)
            OpenC3.in_span("decom_packet") do
              msgid_seconds_from_epoch = msg_id.split('-')[0].to_i / 1000.0
              delta = Time.now.to_f - msgid_seconds_from_epoch
              @metric.set(name: 'decom_topic_delta_seconds', value: delta, type: 'gauge', unit: 'seconds', help: 'Delta time between data written to stream and decom start')
      Severity: Minor
      Found in openc3/lib/openc3/microservices/decom_microservice.rb - About 1 hr to fix

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

            def limits_change_callback(packet, item, old_limits_state, value, log_change)
        Severity: Minor
        Found in openc3/lib/openc3/microservices/decom_microservice.rb - About 35 mins to fix

          There are no issues that match your filters.

          Category
          Status