OpenC3/cosmos

View on GitHub

Showing 1,379 of 1,379 total issues

Method handle_write_variable_bit_size has 89 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def handle_write_variable_bit_size(item, value, buffer)
      # Update length field to new size
      if (item.data_type == :INT or item.data_type == :UINT) and not item.original_array_size
        # QUIC encoding is currently assumed for individual variable sized integers
        # see https://datatracker.ietf.org/doc/html/rfc9000#name-variable-length-integer-enc
Severity: Major
Found in openc3/lib/openc3/accessors/binary_accessor.rb - About 3 hrs to fix

    Method process_targets has 88 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def process_targets(parser, filename, targets_config_dir)
          parser.parse_file(filename) do |keyword, parameters|
            case keyword
            when 'AUTO_DECLARE_TARGETS'
              usage = "#{keyword}"
    Severity: Major
    Found in openc3/lib/openc3/system/system_config.rb - About 3 hrs to fix

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

        ensure_offline_access() {
          this.offline_access_needed().then((needed) => {
            if (needed) {
              if (localStorage.openc3OfflineToken) {
                this.set_offline_access(localStorage.openc3OfflineToken).then(() => {
      openc3/templates/tool_svelte/src/services/openc3-api.js on lines 118..130

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

      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

        ensure_offline_access() {
          this.offline_access_needed().then((needed) => {
            if (needed) {
              if (localStorage.openc3OfflineToken) {
                this.set_offline_access(localStorage.openc3OfflineToken).then(() => {
      Severity: Major
      Found in openc3/templates/tool_svelte/src/services/openc3-api.js and 1 other location - About 3 hrs to fix
      openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 131..143

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

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

      diff_match_patch.prototype.patch_splitMax = function (patches) {
        var patch_size = this.Match_MaxBits
        for (var x = 0; x < patches.length; x++) {
          if (patches[x].length1 <= patch_size) {
            continue

        Method process_suite has 87 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def self.process_suite(name, contents, new_process: true, username: nil, scope:)
            python = false
            python = true if File.extname(name) == '.py'
        
            start = Time.now
        Severity: Major
        Found in openc3-cosmos-script-runner-api/app/models/script.rb - About 3 hrs to fix

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

            normal = function ({
              title,
              body,
              message,
              type,
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 85..105
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 109..129
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 130..150
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 177..197
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 198..218

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

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

            caution = function ({
              title,
              body,
              message,
              type,
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 85..105
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 109..129
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 153..173
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 177..197
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 198..218

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

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

            critical = function ({
              title,
              body,
              message,
              type,
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 109..129
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 130..150
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 153..173
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 177..197
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 198..218

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

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

            serious = function ({
              title,
              body,
              message,
              type,
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 85..105
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 130..150
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 153..173
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 177..197
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 198..218

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

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

            standby = function ({
              title,
              body,
              message,
              type,
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 85..105
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 109..129
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 130..150
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 153..173
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 198..218

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

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

            off = function ({
              title,
              body,
              message,
              type,
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 85..105
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 109..129
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 130..150
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 153..173
          openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 177..197

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

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

              def update
                @previous_microservices = @microservices.dup
                # Get all the microservice configuration
                @microservices = MicroserviceModel.all
          
          
          Severity: Major
          Found in openc3/lib/openc3/operators/microservice_operator.rb - About 3 hrs to fix

            Function created has 84 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              created: function () {
                this.settings.forEach((setting) => {
                  switch (setting[0]) {
                    case 'ITEM':
                      this.items.push({

              Function exports has 83 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              module.exports = (webpackConfigEnv, argv) => {
                const orgName = 'openc3'
                const defaultConfig = singleSpaDefaults({
                  orgName,
                  projectName: 'tool-base',
              Severity: Major
              Found in openc3-cosmos-init/plugins/openc3-tool-base/webpack.config.js - About 3 hrs to fix

                Method each_lexed_segment has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def each_lexed_segment(text)
                    inside_begin = false
                    lex = RubyLex.new
                    lex_io = StringIO.new(text)
                    lex.set_input(lex_io, context: @context)
                Severity: Major
                Found in openc3/lib/openc3/utilities/ruby_lex_utils.rb - About 3 hrs to fix

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

                    encode_openc3_type(val) {
                      if (Number.isNaN(val)) {
                        return { json_class: 'Float', raw: 'NaN' }
                      } else if (val == Number.POSITIVE_INFINITY) {
                        return { json_class: 'Float', raw: 'Infinity' }
                  Severity: Major
                  Found in openc3/templates/tool_svelte/src/services/openc3-api.js and 1 other location - About 3 hrs to fix
                  openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 120..129

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

                  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 (this.widgetIndex !== null) {
                          foundSetting = this.settings.find(
                            (setting) =>
                              parseInt(setting[0]) === this.widgetIndex && setting[1] === 'WIDTH'
                          )
                  openc3-cosmos-init/plugins/packages/openc3-tool-common/src/components/widgets/Widget.js on lines 225..232

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

                  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 (this.widgetIndex !== null) {
                          foundSetting = this.settings.find(
                            (setting) =>
                              parseInt(setting[0]) === this.widgetIndex && setting[1] === 'HEIGHT'
                          )
                  openc3-cosmos-init/plugins/packages/openc3-tool-common/src/components/widgets/Widget.js on lines 193..200

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

                  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

                    encode_openc3_type(val) {
                      if (Number.isNaN(val)) {
                        return { json_class: 'Float', raw: 'NaN' }
                      } else if (val == Number.POSITIVE_INFINITY) {
                        return { json_class: 'Float', raw: 'Infinity' }
                  openc3/templates/tool_svelte/src/services/openc3-api.js on lines 107..116

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

                  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