OpenC3/cosmos

View on GitHub

Showing 1,379 of 1,379 total issues

Method read has 80 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def read(name, value_type = :CONVERTED, reduced_type = nil)
      value = nil
      array_index = nil
      # Check for array index to handle array items but also make sure there
      # isn't a REAL item that has brackets in the name
Severity: Major
Found in openc3/lib/openc3/packets/json_packet.rb - About 3 hrs to fix

    Function diff_halfMatch_ has 79 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    diff_match_patch.prototype.diff_halfMatch_ = function (text1, text2) {
      if (this.Diff_Timeout <= 0) {
        // Don't risk returning a non-optimal diff if we have unlimited time.
        return null
      }

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

          def initialize(
            write_item_name = nil,
            strip_crc = false,
            bad_strategy = "ERROR",
            bit_offset = -32,
      Severity: Major
      Found in openc3/lib/openc3/interfaces/protocols/crc_protocol.rb - About 3 hrs to fix

        Method spawn has 79 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def self.spawn(scope, name, suite_runner = nil, disconnect = false, environment = nil, user_full_name = nil, username = nil)
            if File.extname(name) == '.py'
              process_name = 'python'
              runner_path = File.join(RAILS_ROOT, 'scripts', 'run_script.py')
            else
        Severity: Major
        Found in openc3-cosmos-script-runner-api/app/models/running_script.rb - About 3 hrs to fix

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

              def __init__(
          Severity: Major
          Found in openc3/python/openc3/models/interface_model.py - About 3 hrs to fix

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

                def run
                  RouterTopic.receive_telemetry(@router, scope: @scope) do |topic, msg_id, msg_hash, _redis|
                    msgid_seconds_from_epoch = msg_id.split('-')[0].to_i / 1000.0
                    delta = Time.now.to_f - msgid_seconds_from_epoch
                    @metric.set(name: 'router_topic_delta_seconds', value: delta, type: 'gauge', unit: 'seconds', help: 'Delta time between data written to stream and router tlm start') if @metric
            Severity: Major
            Found in openc3/lib/openc3/microservices/interface_microservice.rb - About 3 hrs to fix

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

                                  if len(result[0]) == 0 and len(result[1]) == 0 and len(result[2]) == 0:
                                      raise socket.timeout
              Severity: Major
              Found in openc3/python/openc3/io/udp_sockets.py and 1 other location - About 3 hrs to fix
              openc3/python/openc3/io/udp_sockets.py on lines 109..110

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

              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 len(result[0]) == 0 and len(result[1]) == 0 and len(result[2]) == 0:
                                      raise socket.timeout
              Severity: Major
              Found in openc3/python/openc3/io/udp_sockets.py and 1 other location - About 3 hrs to fix
              openc3/python/openc3/io/udp_sockets.py on lines 90..91

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

              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

              Method build_suites has 77 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def self.build_suites
                    @@suites = []
                    suites = {}
                    groups = []
                    ObjectSpace.each_object(Class) do |object|
              Severity: Major
              Found in openc3/lib/openc3/script/suite_runner.rb - About 3 hrs to fix

                Method process_request has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def process_request(request_data:, request_headers:, start_time:)
                      @request_count += 1
                      begin
                        request = JsonRpcRequest.from_json(request_data, request_headers)
                        response = nil
                Severity: Major
                Found in openc3/lib/openc3/io/json_drb.rb - About 3 hrs to fix

                  Function parse_string has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    parse_string(
                      input_string,
                      original_filename,
                      yield_non_keyword_lines,
                      remove_quotes,
                  Severity: Major
                  Found in openc3/templates/tool_svelte/src/services/config-parser.js - About 3 hrs to fix

                    Function match_bitap_ has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    diff_match_patch.prototype.match_bitap_ = function (text, pattern, loc) {
                      if (pattern.length > this.Match_MaxBits) {
                        throw new Error('Pattern too long for this browser.')
                      }
                    
                    

                      Function parse_string has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        parse_string(
                          input_string,
                          original_filename,
                          yield_non_keyword_lines,
                          remove_quotes,

                        Method run_text has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def run_text(text,
                                       line_offset = 0,
                                       text_binding = nil,
                                       close_on_complete = false,
                                       initial_filename: nil)
                        Severity: Major
                        Found in openc3-cosmos-script-runner-api/app/models/running_script.rb - About 3 hrs to fix

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

                              if (m[2] === '') {
                                patch.start1--
                                patch.length1 = 1
                              } else if (m[2] == '0') {
                                patch.length1 = 0
                          openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/diff-match-patch.js on lines 2504..2512

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

                          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 (m[4] === '') {
                                patch.start2--
                                patch.length2 = 1
                              } else if (m[4] == '0') {
                                patch.length2 = 0
                          openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/diff-match-patch.js on lines 2493..2501

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

                          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

                          Method build_page has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def build_page(meta, page)
                              modifiers = {}
                              meta.each do |keyword, data|
                                page << "\n#{'#' * @level} #{keyword}\n"
                                if data['since']
                          Severity: Major
                          Found in docs.openc3.com/scripts/generate_docs_from_yaml.rb - About 2 hrs to fix

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

                              if (this.length2 === 0) {
                                coords2 = this.start2 + ',0'
                              } else if (this.length2 == 1) {
                                coords2 = this.start2 + 1
                              } else {
                            openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/diff-match-patch.js on lines 2572..2578

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

                            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.generate_limits_response(args)
                                  if args.length < 3 or args.length > 4
                                    abort("Usage: cli generate limits_response <TARGET> <NAME> (--ruby or --python)")
                                  end
                            
                            
                            Severity: Major
                            Found in openc3/lib/openc3/utilities/cli_generator.rb and 1 other location - About 2 hrs to fix
                            openc3/lib/openc3/utilities/cli_generator.rb on lines 303..330

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

                            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

                              put: function (
                                path,
                                {
                                  data,
                                  params,
                            openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/api.js on lines 117..136

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

                            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