OpenC3/cosmos

View on GitHub

Showing 1,379 of 1,379 total issues

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

  if (this.length1 === 0) {
    coords1 = this.start1 + ',0'
  } else if (this.length1 == 1) {
    coords1 = this.start1 + 1
  } else {
openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/diff-match-patch.js on lines 2579..2585

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 92.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    def self.generate_conversion(args)
      if args.length < 3 or args.length > 4
        abort("Usage: cli generate conversion <TARGET> <NAME> (--ruby or --python)")
      end

Severity: Major
Found in openc3/lib/openc3/utilities/cli_generator.rb and 1 other location - About 2 hrs to fix
openc3/lib/openc3/utilities/cli_generator.rb on lines 333..360

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 103.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 92.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method check_tool_base has 70 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def check_tool_base(path, base_pkgs)
  Dir.chdir(path) do
    # List the remote tags and sort reverse order (latest on top)
    # Pipe to sed to get the second line because the output looks like:
    #   6b7bfd3c201c1185129e819e02dc2505dbb82994    refs/tags/v7.0.96^{}
Severity: Major
Found in scripts/release/package_audit_lib.rb - About 2 hrs to fix

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

      if (acediff.options.left.copyLinkEnabled) {
        query(
          `#${acediff.options.classes.gutterID}`,
          'click',
          `.${acediff.options.classes.newCodeConnectorLink}`,
    openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/index.js on lines 322..331

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

    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 (acediff.options.right.copyLinkEnabled) {
        query(
          `#${acediff.options.classes.gutterID}`,
          'click',
          `.${acediff.options.classes.deletedCodeConnectorLink}`,
    openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/index.js on lines 312..321

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

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

    diff_match_patch.prototype.decodeURI = function (text) {
      try {
        return decodeURI(text)
      } catch (e) {
        var i = 0

      Method to_config has 68 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def to_config(cmd_or_tlm)
            config = ''
      
            if cmd_or_tlm == :TELEMETRY
              config << "TELEMETRY #{@target_name.to_s.quote_if_necessary} #{@packet_name.to_s.quote_if_necessary} #{@default_endianness} \"#{@description}\"\n"
      Severity: Major
      Found in openc3/lib/openc3/packets/packet.rb - About 2 hrs to fix

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

        export default {
          install(Vue, options) {
            if (!Vue.prototype.hasOwnProperty('$dialog')) {
              Vue.dialog = new Dialog(Vue, options)
        
        
        openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 221..235

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

        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

        export default {
          install(Vue, options) {
            if (!Vue.prototype.hasOwnProperty('$notify')) {
              Vue.notify = new Notify(Vue, options)
        
        
        openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/dialog/index.js on lines 115..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 89.

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

            def to_config(cmd_or_tlm, default_endianness)
              config = ''
              if cmd_or_tlm == :TELEMETRY
                if self.array_size
                  config << "  ARRAY_ITEM #{self.name.to_s.quote_if_necessary} #{self.bit_offset} #{self.bit_size} #{self.data_type} #{self.array_size} \"#{self.description.to_s.gsub("\"", "'")}\""
        Severity: Major
        Found in openc3/lib/openc3/packets/packet_item.rb - About 2 hrs to fix

          Method get_packet_index has 67 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def get_packet_index(cmd_or_tlm, target_name, packet_name, entry_type, data)
                if cmd_or_tlm == :CMD
                  target_table = @cmd_packet_table[target_name]
                else
                  target_table = @tlm_packet_table[target_name]
          Severity: Major
          Found in openc3/lib/openc3/logs/packet_log_writer.rb - About 2 hrs to fix

            Method write has 67 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def write(packet)
                  name = packet.packet_name.upcase
            
                  hs_packet = @tlm_packets['HEALTH_STATUS']
                  params_packet = @tlm_packets['PARAMS']

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

              export default new Vuetify({
                theme: {
                  dark: true,
                  options: {
                    customProperties: true,
              openc3-cosmos-init/plugins/openc3-tool-base/src/plugins/vuetify.js on lines 83..106

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

              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

              export default new Vuetify({
                theme: {
                  dark: true,
                  options: {
                    customProperties: true,
              openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/vuetify.js on lines 29..52

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

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

                  def as_json(*a)
                    config = {}
                    config['name'] = self.name
                    config['bit_offset'] = self.bit_offset
                    config['bit_size'] = self.bit_size
              Severity: Major
              Found in openc3/lib/openc3/packets/packet_item.rb - About 2 hrs to fix

                Method _cmd_implementation has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def _cmd_implementation(method_name, *args, range_check:, hazardous_check:, raw:, timeout: nil, log_message: nil, manual: false, validate: true,
                                            scope: $openc3_scope, token: $openc3_token, **kwargs)
                      extract_string_kwargs_to_args(args, kwargs)
                      unless [nil, true, false].include?(log_message)
                        raise "Invalid log_message parameter: #{log_message}. Must be true or false."
                Severity: Major
                Found in openc3/lib/openc3/api/cmd_api.rb - About 2 hrs to fix

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

                      def plugin_get(plugin_name, scope: $openc3_scope)
                        response_body = nil
                        begin
                          endpoint = "/openc3-api/plugins/#{plugin_name}?scope=#{scope}"
                          uri = URI.parse($api_server.generate_url + endpoint)
                  Severity: Major
                  Found in openc3/lib/openc3/script/plugins.rb and 1 other location - About 2 hrs to fix
                  openc3/lib/openc3/script/plugins.rb on lines 162..182

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

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                      def plugin_status(process_name, scope: $openc3_scope)
                        response_body = nil
                        begin
                          endpoint = "/openc3-api/process_status/#{process_name}?scope=#{scope}"
                          uri = URI.parse($api_server.generate_url + endpoint)
                  Severity: Major
                  Found in openc3/lib/openc3/script/plugins.rb and 1 other location - About 2 hrs to fix
                  openc3/lib/openc3/script/plugins.rb on lines 46..66

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

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

                  function computeDiff(acediff, diffType, offsetLeft, offsetRight, diffText) {
                    let lineInfo = {}
                  
                    if (diffType === C.DIFF_INSERT) {
                      // pretty confident this returns the right stuff for the left editor: start & end line & char
                    Severity
                    Category
                    Status
                    Source
                    Language