OpenC3/cosmos

View on GitHub

Showing 1,379 of 1,379 total issues

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

    def define_item(name, bit_offset, bit_size, data_type, array_size = nil, endianness = @default_endianness, overflow = :ERROR, format_string = nil, read_conversion = nil, write_conversion = nil, id_value = nil)
Severity: Major
Found in openc3/lib/openc3/packets/packet.rb - About 1 hr to fix

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

          write_item_name = nil,
          strip_crc = false,
          bad_strategy = "ERROR",
          bit_offset = -32,
          bit_size = 32,
    Severity: Major
    Found in openc3/lib/openc3/interfaces/protocols/crc_protocol.rb - About 1 hr to fix

      Function diff_compute_ has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      diff_match_patch.prototype.diff_compute_ = function (
        text1,
        text2,
        checklines,
        deadline,

        Function diff_halfMatchI_ has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function diff_halfMatchI_(longtext, shorttext, i) {
            // Start with a 1/4 length substring at position i as a seed.
            var seed = longtext.substring(i, i + Math.floor(longtext.length / 4))
            var j = -1
            var best_common = ''

          Function __init__ has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def __init__(self, id, scope, name, disconnect):
                  RunningScript.instance = self
                  RunningScript.id = id
                  self.scope = scope
                  self.name = name
          Severity: Minor
          Found in openc3-cosmos-script-runner-api/scripts/running_script.py - About 1 hr to fix

            Method process_entry_list has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def process_entry_list(xml, packet, cmd_vs_tlm)
                  if cmd_vs_tlm == :COMMAND
                    type = "Argument"
                  else # :TELEMETRY
                    type = "Parameter"
            Severity: Minor
            Found in openc3/lib/openc3/packets/parsers/xtce_converter.rb - About 1 hr to fix

              Method arc has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def self.arc(f, t)
                    dot = (f[0] * t[0]) + (f[1] * t[1]) + (f[2] * t[2])
                    if dot > 0.999999
                      x = 0.0
                      y = 0.0
              Severity: Minor
              Found in openc3/lib/openc3/utilities/quaternion.rb - About 1 hr to fix

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

                  def create
                    return unless authorization('script_run')
                    begin
                      hash = params.to_unsafe_h.slice(:start, :stop, :kind, :data, :recurring).to_h
                      hash['data'] ||= {}
                Severity: Minor
                Found in openc3-cosmos-cmd-tlm-api/app/controllers/activity_controller.rb - About 1 hr to fix

                  Method next_log_entry has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def next_log_entry
                      next_time = nil
                      next_reader = nil
                      closed_readers = nil
                      @open_readers.each do |reader|
                  Severity: Minor
                  Found in openc3-cosmos-cmd-tlm-api/app/models/message_file_reader.rb - About 1 hr to fix

                    Method build_parameters has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def build_parameters(parameters, page)
                        page << "| Parameter | Description | Required |\n"
                        page << "|-----------|-------------|----------|\n"
                        parameters.each do |param|
                          description = param['description']
                    Severity: Minor
                    Found in docs.openc3.com/scripts/generate_docs_from_yaml.rb - About 1 hr to fix

                      Method build_summary_report has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      def build_summary_report(containers)
                        report = ""
                        report << "OpenC3 COSMOS Package Report Summary\n"
                        report << ("-" * 80)
                        report << "\n\nCreated: #{Time.now}\n\n"
                      Severity: Minor
                      Found in scripts/release/package_audit_lib.rb - About 1 hr to fix

                        Method open_current_files has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def open_current_files
                            opened_files = nil
                            if not @file_list[0]
                              if @extend_file_list
                                # See if any new files have showed up once

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

                            cmd_no_hazardous_check(
                              target_name,
                              command_name,
                              param_list,
                              headerOptions = {},
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 464..476
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 478..490
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 492..509
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 511..523
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 525..542
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 563..575
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 577..599
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 601..613
                          openc3/templates/tool_svelte/src/services/openc3-api.js on lines 417..429

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

                          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 10 locations. Consider refactoring.
                          Open

                            cmd_raw(target_name, command_name, param_list, headerOptions = {}) {
                              if (command_name === undefined) {
                                return this.exec('cmd_raw', target_name, {}, headerOptions)
                              } else {
                                return this._cmd(
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 464..476
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 478..490
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 492..509
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 525..542
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 544..561
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 563..575
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 577..599
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 601..613
                          openc3/templates/tool_svelte/src/services/openc3-api.js on lines 417..429

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

                          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 10 locations. Consider refactoring.
                          Open

                            get_cmd_hazardous(target_name, command_name, param_list, headerOptions = {}) {
                              if (command_name === undefined) {
                                return this.exec('get_cmd_hazardous', target_name, {}, headerOptions)
                              } else {
                                return this._cmd(
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 478..490
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 492..509
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 511..523
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 525..542
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 544..561
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 563..575
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 577..599
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 601..613
                          openc3/templates/tool_svelte/src/services/openc3-api.js on lines 417..429

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

                          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 10 locations. Consider refactoring.
                          Open

                            cmd_no_range_check(
                              target_name,
                              command_name,
                              param_list,
                              headerOptions = {},
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 464..476
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 478..490
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 511..523
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 525..542
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 544..561
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 563..575
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 577..599
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 601..613
                          openc3/templates/tool_svelte/src/services/openc3-api.js on lines 417..429

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

                          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 10 locations. Consider refactoring.
                          Open

                            cmd_no_checks(target_name, command_name, param_list, headerOptions = {}) {
                              if (command_name === undefined) {
                                return this.exec('cmd_no_checks', target_name, {}, headerOptions)
                              } else {
                                return this._cmd(
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 464..476
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 478..490
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 492..509
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 511..523
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 525..542
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 544..561
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 577..599
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 601..613
                          openc3/templates/tool_svelte/src/services/openc3-api.js on lines 417..429

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

                          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 10 locations. Consider refactoring.
                          Open

                            cmd(target_name, command_name, param_list, headerOptions = {}) {
                              if (command_name === undefined) {
                                return this.exec('cmd', target_name, {}, headerOptions)
                              } else {
                                return this._cmd(
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 464..476
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 492..509
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 511..523
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 525..542
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 544..561
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 563..575
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 577..599
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 601..613
                          openc3/templates/tool_svelte/src/services/openc3-api.js on lines 417..429

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

                          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 10 locations. Consider refactoring.
                          Open

                            cmd(target_name, command_name, param_list, headerOptions = {}) {
                              if (command_name === undefined) {
                                return this.exec('cmd', target_name, {}, headerOptions)
                              } else {
                                return this._cmd(
                          Severity: Major
                          Found in openc3/templates/tool_svelte/src/services/openc3-api.js and 9 other locations - About 1 hr to fix
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 464..476
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 478..490
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 492..509
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 511..523
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 525..542
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 544..561
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 563..575
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 577..599
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 601..613

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

                          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 10 locations. Consider refactoring.
                          Open

                            cmd_raw_no_hazardous_check(
                              target_name,
                              command_name,
                              param_list,
                              headerOptions = {},
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 464..476
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 478..490
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 492..509
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 511..523
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 525..542
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 544..561
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 563..575
                          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 601..613
                          openc3/templates/tool_svelte/src/services/openc3-api.js on lines 417..429

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

                          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