OpenC3/cosmos

View on GitHub

Showing 1,379 of 1,379 total issues

Function patch_make has 99 lines of code (exceeds 25 allowed). Consider refactoring.
Open

diff_match_patch.prototype.patch_make = function (a, opt_b, opt_c) {
  var text1, diffs
  if (
    typeof a == 'string' &&
    typeof opt_b == 'string' &&

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

      decode_openc3_type(val) {
        if (val !== null && typeof val === 'object') {
          if (val.json_class == 'Float' && val.raw) {
            if (val.raw == 'NaN') {
              return NaN
    openc3/templates/tool_svelte/src/services/openc3-api.js on lines 92..105

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

    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

      decode_openc3_type(val) {
        if (val !== null && typeof val === 'object') {
          if (val.json_class == 'Float' && val.raw) {
            if (val.raw == 'NaN') {
              return NaN
    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 105..118

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

    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

      mount = function () {
        if (this.mounted) return
    
        const ToastConstructor = this.Vue.extend(Toast)
        const toast = new ToastConstructor()
    openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/dialog/index.js on lines 32..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 112.

    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

      mount = function () {
        if (this.mounted) return
    
        const DialogConstructor = this.Vue.extend(ConfirmDialog)
        const dialog = new DialogConstructor()
    openc3-cosmos-init/plugins/packages/openc3-tool-common/src/plugins/notify/index.js on lines 33..44

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

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

    diff_match_patch.prototype.diff_bisect_ = function (text1, text2, deadline) {
      // Cache the text lengths to prevent multiple calls.
      var text1_length = text1.length
      var text2_length = text2.length
      var max_d = Math.ceil((text1_length + text2_length) / 2)

      Method process_file has 95 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def process_file(filename, existing_variables = {})
            current_interface_or_router = nil
            current_type = nil
            current_interface_log_added = false
      
      
      Severity: Major
      Found in openc3/lib/openc3/bridge/bridge_config.rb - About 3 hrs to fix

        Method process_file has 93 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def process_file(filename)
              # Partial files are included into another file and thus aren't directly processed
              return if File.basename(filename)[0] == '_' # Partials start with underscore
              @filename = filename
              @last_config = [File.basename(filename), File.read(filename)]
        Severity: Major
        Found in openc3/lib/openc3/tools/table_manager/table_config.rb - About 3 hrs to fix

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

          diff_match_patch.prototype.diff_text2 = function (diffs) {
            var text = []
            for (var x = 0; x < diffs.length; x++) {
              if (diffs[x][0] !== DIFF_DELETE) {
                text[x] = diffs[x][1]
          openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/diff-match-patch.js on lines 1606..1614

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

          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

          diff_match_patch.prototype.diff_text1 = function (diffs) {
            var text = []
            for (var x = 0; x < diffs.length; x++) {
              if (diffs[x][0] !== DIFF_INSERT) {
                text[x] = diffs[x][1]
          openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/diff-match-patch.js on lines 1621..1629

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

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

              def initialize(name, is_plugin: false)
                @shutdown_complete = false
                raise "Microservice must be named" unless name
          
                @name = name
          Severity: Major
          Found in openc3/lib/openc3/microservices/microservice.rb - About 3 hrs to fix

            Method process_file has 91 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def process_file(filename, process_target_name, language = 'ruby')
                  # Handle .xtce files
                  extension = File.extname(filename).to_s.downcase
                  if extension == ".xtce" or extension == ".xml"
                    XtceParser.process(@commands, @telemetry, @warnings, filename, process_target_name)
            Severity: Major
            Found in openc3/lib/openc3/packets/packet_config.rb - About 3 hrs to fix

              Function diff_cleanupSemanticLossless has 90 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              diff_match_patch.prototype.diff_cleanupSemanticLossless = function (diffs) {
                /**
                 * Given two strings, compute a score representing whether the internal
                 * boundary falls on logical boundaries.
                 * Scores range from 6 (best) to 0 (worst).

                Method process_file has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def process_file(filename, type, entry_nanoseconds, file_nanoseconds)
                      throttle = OpenC3::Throttle.new(@max_cpu_utilization)
                      file = BucketFile.new(filename)
                      file.retrieve
                      unless File.exist?(file.local_path)
                Severity: Major
                Found in openc3/lib/openc3/microservices/reducer_microservice.rb - About 3 hrs to fix

                  Method read_item has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def read_item(item, value_type = :CONVERTED, buffer = @buffer, given_raw = nil)
                        if given_raw
                          # Must clone this since value is returned
                          value = given_raw.clone
                        else
                  Severity: Major
                  Found in openc3/lib/openc3/packets/packet.rb - About 3 hrs to fix

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

                        def __init__(self, target_name):
                            super().__init__(target_name)
                    
                            self.target = System.targets[target_name]
                            position_filename = os.path.join(self.target.dir, "data", "position.bin")

                      Method handle_config has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          def handle_config(parser, keyword, parameters)
                            case keyword
                            when 'MAP_TARGET'
                              parser.verify_num_parameters(1, 1, "#{keyword} <Target Name>")
                              target_name = parameters[0].upcase
                      Severity: Major
                      Found in openc3/lib/openc3/models/interface_model.rb - About 3 hrs to fix

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

                            _limitsState: function () {
                              let limitsState = this.limitsState
                              if (limitsState === null) {
                                if (this.screen) {
                                  if (this.screen.screenValues[this.valueId]) {
                        openc3-cosmos-init/plugins/packages/openc3-tool-common/src/components/widgets/VWidget.js on lines 135..147

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

                        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

                            _counter: function () {
                              let counter = this.counter
                              if (counter === null) {
                                if (this.screen) {
                                  if (this.screen.screenValues[this.valueId]) {
                        openc3-cosmos-init/plugins/packages/openc3-tool-common/src/components/widgets/VWidget.js on lines 122..134

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

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

                        diff_match_patch.prototype.patch_apply = function (patches, text) {
                          if (patches.length == 0) {
                            return [text, []]
                          }
                          // Deep copy the patches so that no changes are made to originals.
                          Severity
                          Category
                          Status
                          Source
                          Language