OpenC3/cosmos

View on GitHub

Showing 1,379 of 1,379 total issues

Method index has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def index
    OpenC3::Logger.debug("request for aggregator metrics")
    begin
      scopes = OpenC3::ScopeModel.names()
    rescue RuntimeError => e

    Function data has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      data() {
        return {
          curValue: null,
          prevValue: null,
          grayLevel: 80,

      Function deleteItem has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          deleteItem(item) {
            let start = null
            let api = ''
            switch (item.type.toLowerCase()) {
              case 'activity':

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

            def _wait_tolerance_process_args(args)
              case args.length
              when 4, 5
                target_name, packet_name, item_name = extract_fields_from_tlm_text(args[0])
                expected_value = args[1]
        Severity: Minor
        Found in openc3/lib/openc3/script/api_shared.rb - About 1 hr to fix

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

              def process_result(results)
                openc3_lib = Regexp.new(File.join(OpenC3::PATH, 'lib'))
                # If we were passed an array we concat it to the results global
                if results.is_a? Array
                  @results.concat(results)
          Severity: Minor
          Found in openc3/lib/openc3/script/suite_results.rb - About 1 hr to fix

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

                def initialize(
                  name:,
                  config_params: [],
                  target_names: [],
                  cmd_target_names: [],
            Severity: Minor
            Found in openc3/lib/openc3/models/interface_model.rb - About 1 hr to fix

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

                    def handle_sync_pattern
                      if @sync_pattern and @sync_state == :SEARCHING
                        loop do
                          # Make sure we have some data to look for a sync word in
                          return :STOP if @data.length < @sync_pattern.length
              Severity: Minor
              Found in openc3/lib/openc3/interfaces/protocols/burst_protocol.rb - About 1 hr to fix

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

                    def connect
                      @cancel_threads = false
                      @read_queue.clear if @read_queue
                      if @write_port == @read_port # One socket
                        start_listen_thread(@read_port, true, true)
                Severity: Minor
                Found in openc3/lib/openc3/interfaces/tcpip_server_interface.rb - About 1 hr to fix

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

                    def retrieve(client = @bucket, uncompress = true)
                      @mutex.synchronize do
                        local_path = "#{BucketFileCache.instance.cache_dir}/#{File.basename(@bucket_path)}"
                        unless File.exist?(local_path)
                          OpenC3::Logger.debug "Retrieving #{@bucket_path} from logs bucket"
                  Severity: Minor
                  Found in openc3/lib/openc3/utilities/bucket_file_cache.rb - About 1 hr to fix

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

                        def self.generate_widget(args)
                          if args.length < 2 or args.length > 3
                            abort("Usage: cli generate #{args[0]} <SuperdataWidget> (--ruby or --python)")
                          end
                          # Per https://stackoverflow.com/a/47591707/453280
                    Severity: Minor
                    Found in openc3/lib/openc3/utilities/cli_generator.rb - About 1 hr to fix

                      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 add has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def add(data)
                            # OpenC3::Logger.debug "start:#{Time.at(data["start_time"].to_i/1_000_000_000.0).formatted}" if data["start_time"]
                            # OpenC3::Logger.debug "end:#{Time.at(data["end_time"].to_i/1_000_000_000.0).formatted}" if data["end_time"]
                            @mutex.synchronize do
                              # Preprocess request fields
                        Severity: Minor
                        Found in openc3-cosmos-cmd-tlm-api/app/models/streaming_api.rb - About 1 hr to fix

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                              def deploy_unknown_packetlog_microservice(gem_path, variables, parent)
                                microservice_name = "#{@scope}__PACKETLOG__UNKNOWN"
                                microservice = MicroserviceModel.new(
                                  name: microservice_name,
                                  cmd: ["ruby", "log_microservice.rb", microservice_name],
                          Severity: Major
                          Found in openc3/lib/openc3/models/scope_model.rb and 1 other location - About 1 hr to fix
                          openc3/lib/openc3/models/scope_model.rb on lines 205..224

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 59.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                            def destroy
                              return unless authorization('script_run')
                              action do
                                count = @model_class.destroy(start: params[:id].to_i, scope: params[:scope])
                                if count == 0
                          openc3-cosmos-cmd-tlm-api/app/controllers/notes_controller.rb on lines 184..198

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 59.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                            def destroy
                              return unless authorization('script_run')
                              action do
                                count = @model_class.destroy(start: params[:id].to_i, scope: params[:scope])
                                if count == 0
                          openc3-cosmos-cmd-tlm-api/app/controllers/metadata_controller.rb on lines 179..193

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 59.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                              def deploy_unknown_commandlog_microservice(gem_path, variables, parent)
                                microservice_name = "#{@scope}__COMMANDLOG__UNKNOWN"
                                microservice = MicroserviceModel.new(
                                  name: microservice_name,
                                  cmd: ["ruby", "log_microservice.rb", microservice_name],
                          Severity: Major
                          Found in openc3/lib/openc3/models/scope_model.rb and 1 other location - About 1 hr to fix
                          openc3/lib/openc3/models/scope_model.rb on lines 227..246

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 59.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Function __init__ has 11 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def __init__(
                          Severity: Major
                          Found in openc3/python/openc3/script/web_socket_api.py - About 1 hr to fix

                            Function define_item has 11 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def define_item(
                            Severity: Major
                            Found in openc3/python/openc3/packets/packet.py - About 1 hr to fix

                              Function formatted has 11 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              def formatted(
                              Severity: Major
                              Found in openc3/python/openc3/utilities/string.py - About 1 hr to fix

                                Function __init__ has 11 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def __init__(
                                Severity: Major
                                Found in openc3/python/openc3/interfaces/protocols/crc_protocol.py - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language