OpenC3/cosmos

View on GitHub

Showing 1,379 of 1,379 total issues

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

  cmd_raw_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 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 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_raw_no_checks(target_name, command_name, param_list, headerOptions = {}) {
    if (command_name === undefined) {
      return this.exec('cmd_raw_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 563..575
openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 577..599
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

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

  connect_interface(interface_name, ...interface_params) {
    if (interface_params.length > 0) {
      return this.exec('connect_interface', [
        interface_name,
        ...interface_params,
Severity: Major
Found in openc3/templates/tool_svelte/src/services/openc3-api.js and 1 other location - About 1 hr to fix
openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 165..174

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

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

  connect_interface(interface_name, ...interface_params) {
    if (interface_params.length > 0) {
      return this.exec('connect_interface', [
        interface_name,
        ...interface_params,
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 152..161

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

const AstroStatusIcons = AstroStatuses.reduce((values, status) => {
  return {
    [`astro-status-${status}`]: {
      component: AstroStatusIndicator,
      props: {
openc3-cosmos-init/plugins/packages/openc3-tool-common/src/components/icons/index.js on lines 150..160

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

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

          if value.is_a?(String)
            value = value.dup
            if item_type == :BLOCK or item_type == :STRING
              if !value.is_printable?
                value = "0x" + value.simple_formatted
Severity: Major
Found in openc3/lib/openc3/packets/commands.rb and 1 other location - About 1 hr to fix
openc3/lib/openc3/api/cmd_api.rb on lines 563..580

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

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

Rails.application.configure do
  # Settings specified here will take precedence over those in config/application.rb.

  # Turn false under Spring and add config.action_view.cache_template_loading = true.
  config.cache_classes = true
Severity: Major
Found in openc3-cosmos-cmd-tlm-api/config/environments/test.rb and 1 other location - About 1 hr to fix
openc3-cosmos-script-runner-api/config/environments/test.rb on lines 8..43

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

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 value.is_a?(String)
            value = value.dup
            if item_type == :BLOCK or item_type == :STRING
              if !value.is_printable?
                value = "0x" + value.simple_formatted
Severity: Major
Found in openc3/lib/openc3/api/cmd_api.rb and 1 other location - About 1 hr to fix
openc3/lib/openc3/packets/commands.rb on lines 229..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 58.

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

          when 32
            if data_type == :INT
              values = self.check_overflow_array(values, MIN_INT32, MAX_INT32, MAX_UINT32, bit_size, data_type, overflow)
              if endianness == HOST_ENDIANNESS
                packed = values.pack(PACK_NATIVE_32_BIT_INT_ARRAY)
Severity: Major
Found in openc3/lib/openc3/accessors/binary_accessor.rb and 1 other location - About 1 hr to fix
openc3/lib/openc3/accessors/binary_accessor.rb on lines 1184..1198

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

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

const AstroRegularIcons = AstroIconLibrary.reduce((values, icon) => {
  return {
    [`astro-${icon}`]: {
      component: AstroIcon,
      props: {
openc3-cosmos-init/plugins/packages/openc3-tool-common/src/components/icons/index.js on lines 161..171

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

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

Rails.application.configure do
  # Settings specified here will take precedence over those in config/application.rb.

  # Turn false under Spring and add config.action_view.cache_template_loading = true.
  config.cache_classes = true
Severity: Major
Found in openc3-cosmos-script-runner-api/config/environments/test.rb and 1 other location - About 1 hr to fix
openc3-cosmos-cmd-tlm-api/config/environments/test.rb on lines 8..43

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

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

          when 16
            if data_type == :INT
              values = self.check_overflow_array(values, MIN_INT16, MAX_INT16, MAX_UINT16, bit_size, data_type, overflow)
              if endianness == HOST_ENDIANNESS
                packed = values.pack(PACK_NATIVE_16_BIT_INT_ARRAY)
Severity: Major
Found in openc3/lib/openc3/accessors/binary_accessor.rb and 1 other location - About 1 hr to fix
openc3/lib/openc3/accessors/binary_accessor.rb on lines 1202..1216

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

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

diff_match_patch.patch_obj.prototype.toString = function () {
  var coords1, coords2
  if (this.length1 === 0) {
    coords1 = this.start1 + ',0'
  } else if (this.length1 == 1) {

    Function openConfigBase has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        openConfigBase: function (name, routed = false, callback = null) {
          new OpenC3Api()
            .load_config(this.configKey, name)
            .then((response) => {
              if (response) {

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

          def __init__(
              self,
              target_name=None,
              packet_name=None,
              default_endianness="BIG_ENDIAN",
      Severity: Minor
      Found in openc3/python/openc3/packets/packet.py - About 1 hr to fix

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

            def run
              setup_microservice_topic()
              while true
                break if @cancel_thread
        
        
        Severity: Minor
        Found in openc3/lib/openc3/microservices/decom_microservice.rb - About 1 hr to fix

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

              def initialize(handshake, interface_target_name)
                @handshake = handshake
          
                # Interpret the command field of the handshake packet
                # Where DATA is defined as:
          Severity: Minor
          Found in openc3/lib/openc3/interfaces/linc_interface.rb - About 1 hr to fix

            Method start_read_thread has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def start_read_thread(interface_info)
                  @read_threads << Thread.new do
                    index_to_delete = nil
                    begin
                      begin
            Severity: Minor
            Found in openc3/lib/openc3/interfaces/tcpip_server_interface.rb - About 1 hr to fix

              Method deploy_target_microservices has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def deploy_target_microservices(type, base_topic_list, topic_prefix)
                    target_microservices = @target_microservices[type]
                    if target_microservices
                      # These are stand alone microservice(s) ... not part of MULTI
                      if base_topic_list
              Severity: Minor
              Found in openc3/lib/openc3/models/target_model.rb - About 1 hr to fix

                Method open_current_files has 33 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
                Severity: Minor
                Found in openc3-cosmos-cmd-tlm-api/app/models/message_file_reader.rb - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language