OpenC3/cosmos

View on GitHub

Showing 1,379 of 1,379 total issues

Method create has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def create(update = false)
    return unless authorization('admin')
    file = params[:plugin]
    if file
      scope = sanitize_params([:scope])
Severity: Minor
Found in openc3-cosmos-cmd-tlm-api/app/controllers/plugins_controller.rb - About 1 hr to fix

    Method debug has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def debug(debug_text)
        handle_output_io()
        if not running?
          # Capture STDOUT and STDERR
          $stdout.add_stream(@output_io)
    Severity: Minor
    Found in openc3-cosmos-script-runner-api/app/models/running_script.rb - About 1 hr to fix

      Method remote_target_files has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def self.remote_target_files(bucket_client:, prefix:, include_temp: false, path_matchers: nil)
            result = Set.new
            temp = Set.new
            resp = bucket_client.list_objects(
              bucket: ENV['OPENC3_CONFIG_BUCKET'],
      Severity: Minor
      Found in openc3/lib/openc3/utilities/target_file.rb - About 1 hr to fix

        Method generate_microservice has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

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

                case args.length
                when 1
                  target_name, cmd_name, cmd_params = extract_fields_from_cmd_text(args[0], scope: scope)
                when 2, 3
                  target_name  = args[0]
          Severity: Major
          Found in openc3/lib/openc3/api/cmd_api.rb and 1 other location - About 1 hr to fix
          openc3/lib/openc3/api/cmd_api.rb on lines 267..280

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

          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

                case args.length
                when 1
                  target_name, command_name, parameters = extract_fields_from_cmd_text(args[0], scope: scope)
                when 2, 3
                  target_name = args[0]
          Severity: Major
          Found in openc3/lib/openc3/api/cmd_api.rb and 1 other location - About 1 hr to fix
          openc3/lib/openc3/api/cmd_api.rb on lines 113..126

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

          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 _wait_packet has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

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

            Function _openc3_script_wait has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

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

              Consider simplifying this complex logical expression.
              Open

                    if (
                      lastEquality &&
                      ((pre_ins && pre_del && post_ins && post_del) ||
                        (lastEquality.length < this.Diff_EditCost / 2 &&
                          pre_ins + pre_del + post_ins + post_del == 3))

                Function _openc3_script_wait_value has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

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

                  Function _get_overrides has 8 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def _get_overrides(cls, now, tgt_pkt_key, overrides, target_name, packet_name, cache_timeout, scope):
                  Severity: Major
                  Found in openc3/python/openc3/models/cvt_model.py - About 1 hr to fix

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

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

                      Function check_overflow has 8 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def check_overflow(cls, value, min_value, max_value, hex_max_value, bit_size, data_type, overflow):
                      Severity: Major
                      Found in openc3/python/openc3/accessors/binary_accessor.py - About 1 hr to fix

                        Function _openc3_script_wait has 8 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def _openc3_script_wait(
                        Severity: Major
                        Found in openc3/python/openc3/api/api_shared.py - About 1 hr to fix

                          Function _wait_packet has 8 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          def _wait_packet(
                          Severity: Major
                          Found in openc3/python/openc3/api/api_shared.py - About 1 hr to fix

                            Function _openc3_script_wait_value has 8 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            def _openc3_script_wait_value(
                            Severity: Major
                            Found in openc3/python/openc3/api/api_shared.py - About 1 hr to fix

                              Function check_overflow_array has 8 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def check_overflow_array(cls, values, min_value, max_value, hex_max_value, bit_size, data_type, overflow):
                              Severity: Major
                              Found in openc3/python/openc3/accessors/binary_accessor.py - About 1 hr to fix

                                Function write has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def write(cls, value, bit_offset, bit_size, data_type, buffer, endianness, overflow):
                                Severity: Major
                                Found in openc3/python/openc3/accessors/binary_accessor.py - About 1 hr to fix

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

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

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

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