OpenC3/cosmos

View on GitHub

Showing 1,379 of 1,379 total issues

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

module.exports = {
  publicPath: '/tools/bucketexplorer',
  outputDir: 'tools/bucketexplorer',
  filenameHashing: false,
  transpileDependencies: ['vuetify'],
openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-admin/vue.config.js on lines 1..43
openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/vue.config.js on lines 1..43
openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataextractor/vue.config.js on lines 1..43
openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataviewer/vue.config.js on lines 1..43
openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-handbooks/vue.config.js on lines 1..43
openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-iframe/vue.config.js on lines 1..43
openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-limitsmonitor/vue.config.js on lines 1..43
openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-packetviewer/vue.config.js on lines 1..43
openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/vue.config.js on lines 1..43
openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tablemanager/vue.config.js on lines 1..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 217.

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

module.exports = {
  publicPath: '/tools/cmdtlmserver',
  outputDir: 'tools/cmdtlmserver',
  filenameHashing: false,
  transpileDependencies: ['vuetify'],
openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-admin/vue.config.js on lines 1..43
openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-bucketexplorer/vue.config.js on lines 1..43
openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataextractor/vue.config.js on lines 1..43
openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataviewer/vue.config.js on lines 1..43
openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-handbooks/vue.config.js on lines 1..43
openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-iframe/vue.config.js on lines 1..43
openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-limitsmonitor/vue.config.js on lines 1..43
openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-packetviewer/vue.config.js on lines 1..43
openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/vue.config.js on lines 1..43
openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tablemanager/vue.config.js on lines 1..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 217.

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

    def run
      InterfaceTopic.receive_commands(@interface, scope: @scope) do |topic, msg_id, msg_hash, _redis|
        OpenC3.with_context(msg_hash) do
          release_critical = false
          msgid_seconds_from_epoch = msg_id.split('-')[0].to_i / 1000.0
Severity: Major
Found in openc3/lib/openc3/microservices/interface_microservice.rb - About 1 day to fix

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

          if (foundSetting) {
            return foundSetting['HEIGHT']
          } else {
            if (height) {
              let setting = ['HEIGHT', `${height}${units}`]
    openc3-cosmos-init/plugins/packages/openc3-tool-common/src/components/widgets/Widget.js on lines 201..220

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

    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 (foundSetting) {
            return foundSetting['WIDTH']
          } else {
            if (width) {
              let setting = ['WIDTH', `${width}${units}`]
    openc3-cosmos-init/plugins/packages/openc3-tool-common/src/components/widgets/Widget.js on lines 233..252

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

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

          def self.write(value, bit_offset, bit_size, data_type, buffer, endianness, overflow)
            given_bit_offset = bit_offset
            given_bit_size = bit_size
    
            bit_offset = check_bit_offset_and_size(:write, given_bit_offset, given_bit_size, data_type, buffer)
    Severity: Major
    Found in openc3/lib/openc3/accessors/binary_accessor.rb - About 6 hrs to fix

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

        async get_tlm_packet(target_name, packet_name, value_type, stale_time = 30) {
          const data = await this.exec('get_tlm_packet', [target_name, packet_name], {
            type: value_type,
            stale_time: stale_time,
          })
      Severity: Major
      Found in openc3/templates/tool_svelte/src/services/openc3-api.js and 1 other location - About 6 hrs to fix
      openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 277..294

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

      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

        async get_tlm_packet(target_name, packet_name, value_type, stale_time = 30) {
          const data = await this.exec('get_tlm_packet', [target_name, packet_name], {
            type: value_type,
            stale_time: stale_time,
          })
      openc3/templates/tool_svelte/src/services/openc3-api.js on lines 239..256

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

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

          def self.write_array(values, bit_offset, bit_size, data_type, array_size, buffer, endianness, overflow)
            # Save given values of bit offset, bit size, and array_size
            given_bit_offset = bit_offset
            given_bit_size = bit_size
            given_array_size = array_size
      Severity: Major
      Found in openc3/lib/openc3/accessors/binary_accessor.rb - About 6 hrs to fix

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

              footer: {
                style: 'dark',
                links: [
                  {
                    title: 'Homepage',
        Severity: Major
        Found in docs.openc3.com/docusaurus.config.js and 1 other location - About 5 hrs to fix
        docs.openc3.com/docusaurus-plugin.config.js on lines 148..193

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

        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

              footer: {
                style: 'dark',
                links: [
                  {
                    title: 'Homepage',
        Severity: Major
        Found in docs.openc3.com/docusaurus-plugin.config.js and 1 other location - About 5 hrs to fix
        docs.openc3.com/docusaurus.config.js on lines 169..214

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

        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

        module.exports = {
          css: {
            extract: false,
          },
          filenameHashing: false,
        Severity: Major
        Found in openc3/templates/widget/vue.config.js and 1 other location - About 5 hrs to fix
        openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/vue.config.js on lines 3..28

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

        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

        module.exports = {
          css: {
            extract: false,
          },
          filenameHashing: false,
        openc3/templates/widget/vue.config.js on lines 3..28

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

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

            def process_current_packet(parser, keyword, params)
              case keyword
        
              # Select or delete an item in the current packet
              when 'SELECT_PARAMETER', 'SELECT_ITEM', 'DELETE_PARAMETER', 'DELETE_ITEM'
        Severity: Major
        Found in openc3/lib/openc3/packets/packet_config.rb - About 5 hrs to fix

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

              def read(count_100hz, time)
                pending_packets = get_pending_packets(count_100hz)
          
                pending_packets.each do |packet|
                  case packet.packet_name

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

            Severity: Major
            Found in openc3/python/openc3/io/stderr.py and 1 other location - About 5 hrs to fix
            openc3/python/openc3/io/stdout.py on lines 0..38

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

            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

            Severity: Major
            Found in openc3/python/openc3/io/stdout.py and 1 other location - About 5 hrs to fix
            openc3/python/openc3/io/stderr.py on lines 0..38

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

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

                def process_current_item(parser, keyword, params)
                  case keyword
            
                  # Add a state to the current telemety item
                  when 'STATE'
            Severity: Major
            Found in openc3/lib/openc3/packets/packet_config.rb - About 5 hrs to fix

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

                async hashString(string) {
                  if (window.isSecureContext) {
                    // Encode the string as an arrayBuffer which the subtle crypto API uses
                    const arrayBuffer = new TextEncoder().encode(string)
                    // Use the subtle crypto API to perform a SHA256 Sum of the array buffer
              openc3/templates/tool_svelte/src/services/openc3-api.js on lines 585..605

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

              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

                async hashString(string) {
                  if (window.isSecureContext) {
                    // Encode the string as an arrayBuffer which the subtle crypto API uses
                    const arrayBuffer = new TextEncoder().encode(string)
                    // Use the subtle crypto API to perform a SHA256 Sum of the array buffer
              Severity: Major
              Found in openc3/templates/tool_svelte/src/services/openc3-api.js and 1 other location - About 5 hrs to fix
              openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 701..721

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

              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