OpenC3/cosmos

View on GitHub

Showing 1,379 of 1,379 total issues

Method reduce_running has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def reduce_running(key, reduced, samples, samples_sum, avg_key, stddev_key, avgvals_key, stddevvals_key)
Severity: Major
Found in openc3/lib/openc3/microservices/reducer_microservice.rb - About 1 hr to fix

    Method _openc3_script_wait_implementation_comparison has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def _openc3_script_wait_implementation_comparison(target_name, packet_name, item_name, value_type, comparison_to_eval, timeout, polling_rate = DEFAULT_TLM_POLLING_RATE, scope: $openc3_scope, token: $openc3_token, &block)
    Severity: Major
    Found in openc3/lib/openc3/script/api_shared.rb - About 1 hr to fix

      Method _openc3_script_wait_implementation has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def _openc3_script_wait_implementation(target_name, packet_name, item_name, value_type, timeout, polling_rate, exp_to_eval, scope: $openc3_scope, token: $openc3_token, &block)
      Severity: Major
      Found in openc3/lib/openc3/script/api_shared.rb - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

              if @cmd_log_retain_time or @cmd_decom_log_retain_time or @tlm_log_retain_time or @tlm_decom_log_retain_time or
                 @reduced_minute_log_retain_time or @reduced_hour_log_retain_time or @reduced_day_log_retain_time
                # Cleanup Microservice
                deploy_target_microservices('CLEANUP', nil, nil) do |_, instance, parent|
                  deploy_cleanup_microservice(gem_path, variables, instance, parent)
        Severity: Major
        Found in openc3/lib/openc3/models/target_model.rb - About 1 hr to fix

          Method write_array has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def self.write_array(values, bit_offset, bit_size, data_type, array_size, buffer, endianness, overflow)
          Severity: Major
          Found in openc3/lib/openc3/accessors/binary_accessor.rb - About 1 hr to fix

            Method write_entry has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def write_entry(entry_type, cmd_or_tlm, target_name, packet_name, time_nsec_since_epoch, stored, data, id, received_time_nsec_since_epoch: nil, extra: nil)
            Severity: Major
            Found in openc3/lib/openc3/logs/packet_log_writer.rb - About 1 hr to fix

              Method initialize has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                    remote_log_directory,
                    label,
                    logging_enabled = true,
                    cycle_time = nil,
                    cycle_size = 1_000_000_000,
              Severity: Major
              Found in openc3/lib/openc3/logs/packet_log_writer.rb - About 1 hr to fix

                Method initialize has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def initialize(port_name,
                                   baud_rate,
                                   parity = :NONE,
                                   stop_bits = 1,
                                   write_timeout = 10.0,
                Severity: Major
                Found in openc3/lib/openc3/io/serial_driver.rb - About 1 hr to fix

                  Method initialize has 8 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def initialize(port_name = '/dev/ttyS0',
                                     baud_rate = 9600,
                                     parity = :NONE,
                                     stop_bits = 1,
                                     write_timeout = 10.0,
                  Severity: Major
                  Found in openc3/lib/openc3/io/posix_serial_driver.rb - About 1 hr to fix

                    Method initialize has 8 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                          bind_port = 0,
                          bind_address = HOST_0_0_0_0,
                          external_port = nil,
                          external_address = nil,
                          multicast_interface_address = nil,
                    Severity: Major
                    Found in openc3/lib/openc3/io/udp_sockets.rb - About 1 hr to fix

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

                                      if e.args[0] == socket.EAGAIN or e.args[0] == socket.EWOULDBLOCK:
                      Severity: Major
                      Found in openc3/python/openc3/io/udp_sockets.py and 1 other location - About 1 hr to fix
                      openc3/python/openc3/io/udp_sockets.py on lines 107..107

                      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 38.

                      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

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

                                      if e.args[0] == socket.EAGAIN or e.args[0] == socket.EWOULDBLOCK:
                      Severity: Major
                      Found in openc3/python/openc3/io/udp_sockets.py and 1 other location - About 1 hr to fix
                      openc3/python/openc3/io/udp_sockets.py on lines 88..88

                      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 38.

                      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

                          if (!endLineSet && endCharNum <= runningTotal) {
                            info.endLine = lineIndex
                            info.endChar = endCharNum - runningTotal + lineLength
                            endLineSet = true
                          }
                      openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/index.js on lines 670..674

                      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 54.

                      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

                          isInt(str) {
                            // Regular expression to identify a String as an integer
                            if (/^\s*[-+]?\d+\s*$/.test(str)) {
                              return true
                            }
                      openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdsender/src/tools/CommandSender/utilities.js on lines 25..35

                      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 54.

                      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 self.protocol_cmd(interface_name, cmd_name, *cmd_params, read_write: :READ_WRITE, index: -1, scope:)
                            data = {}
                            data['cmd_name'] = cmd_name
                            data['cmd_params'] = cmd_params
                            data['read_write'] = read_write.to_s.upcase
                      Severity: Minor
                      Found in openc3/lib/openc3/topics/interface_topic.rb and 1 other location - About 55 mins to fix
                      openc3/lib/openc3/topics/router_topic.rb on lines 99..105

                      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 46.

                      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 self.protocol_cmd(router_name, cmd_name, *cmd_params, read_write: :READ_WRITE, index: -1, scope:)
                            data = {}
                            data['cmd_name'] = cmd_name
                            data['cmd_params'] = cmd_params
                            data['read_write'] = read_write.to_s.upcase
                      Severity: Minor
                      Found in openc3/lib/openc3/topics/router_topic.rb and 1 other location - About 55 mins to fix
                      openc3/lib/openc3/topics/interface_topic.rb on lines 89..95

                      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 46.

                      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

                          if (!startLineSet && offset < runningTotal) {
                            info.startLine = lineIndex
                            info.startChar = offset - runningTotal + lineLength
                            startLineSet = true
                          }
                      openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/index.js on lines 676..680

                      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 54.

                      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

                          isFloat(str) {
                            // Regex to identify a string as a floating point number
                            if (/^\s*[-+]?\d*\.\d+\s*$/.test(str)) {
                              return true
                            }
                      openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdsender/src/tools/CommandSender/utilities.js on lines 37..48

                      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 54.

                      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

                              if not in_try and type(node) in (ast.Try, ast.TryStar):
                                  self.in_try = False
                      Severity: Minor
                      Found in openc3-cosmos-script-runner-api/scripts/script_instrumentor.py and 1 other location - About 55 mins to fix
                      openc3-cosmos-script-runner-api/scripts/script_instrumentor.py on lines 45..46

                      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 37.

                      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

                              if not in_try and type(node) in (ast.Try, ast.TryStar):
                                  self.in_try = True
                      Severity: Minor
                      Found in openc3-cosmos-script-runner-api/scripts/script_instrumentor.py and 1 other location - About 55 mins to fix
                      openc3-cosmos-script-runner-api/scripts/script_instrumentor.py on lines 48..49

                      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 37.

                      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

                      Severity
                      Category
                      Status
                      Source
                      Language