OpenC3/cosmos

View on GitHub

Showing 1,379 of 1,379 total issues

Method action has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def action
    begin
      yield
    rescue ArgumentError, TypeError => e
      logger.error(e.formatted)
Severity: Minor
Found in openc3-cosmos-cmd-tlm-api/app/controllers/metadata_controller.rb - About 1 hr to fix

    Function _openc3_script_wait_array_tolerance has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def _openc3_script_wait_array_tolerance(
    Severity: Major
    Found in openc3/python/openc3/script/api_shared.py - About 1 hr to fix

      Function append_item has 10 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def append_item(
      Severity: Major
      Found in openc3/python/openc3/packets/packet.py - About 1 hr to fix

        Function _openc3_script_wait_array_tolerance has 10 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def _openc3_script_wait_array_tolerance(
        Severity: Major
        Found in openc3/python/openc3/api/api_shared.py - About 1 hr to fix

          Function __init__ has 10 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def __init__(
          Severity: Major
          Found in openc3/python/openc3/interfaces/udp_interface.py - About 1 hr to fix

            Function __init__ has 10 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(
            Severity: Major
            Found in openc3/python/openc3/interfaces/protocols/length_protocol.py - About 1 hr to fix

              Method append_item has 10 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def append_item(name, bit_size, data_type, array_size = nil, endianness = @default_endianness, overflow = :ERROR, format_string = nil, read_conversion = nil, write_conversion = nil, id_value = nil)
              Severity: Major
              Found in openc3/lib/openc3/packets/packet.rb - About 1 hr to fix

                Method _openc3_script_wait_implementation_array_tolerance has 10 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def _openc3_script_wait_implementation_array_tolerance(array_size, target_name, packet_name, item_name, value_type, expected_value, tolerance, timeout, polling_rate = DEFAULT_TLM_POLLING_RATE, scope: $openc3_scope, token: $openc3_token, &block)
                Severity: Major
                Found in openc3/lib/openc3/script/api_shared.rb - About 1 hr to fix

                  Method initialize has 10 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                        length_bit_offset = 0,
                        length_bit_size = 16,
                        length_value_offset = 0,
                        length_bytes_per_count = 1,
                        length_endianness = 'BIG_ENDIAN',
                  Severity: Major
                  Found in openc3/lib/openc3/interfaces/protocols/length_protocol.rb - About 1 hr to fix

                    Method buffered_write has 10 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def buffered_write(entry_type, cmd_or_tlm, target_name, packet_name, time_nsec_since_epoch, stored, data, id = nil, redis_topic = nil, redis_offset = '0-0', received_time_nsec_since_epoch: nil, extra: nil)
                    Severity: Major
                    Found in openc3/lib/openc3/logs/buffered_packet_log_writer.rb - About 1 hr to fix

                      Method write has 10 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def write(entry_type, cmd_or_tlm, target_name, packet_name, time_nsec_since_epoch, stored, data, id = nil, redis_topic = nil, redis_offset = '0-0', take_mutex: true, allow_new_file: true, received_time_nsec_since_epoch: nil, extra: nil)
                      Severity: Major
                      Found in openc3/lib/openc3/logs/packet_log_writer.rb - About 1 hr to fix

                        Method formatted has 10 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            word_size = 1,
                            words_per_line = 16,
                            word_separator = ' ',
                            indent = 0,
                            show_address = true,
                        Severity: Major
                        Found in openc3/lib/openc3/core_ext/string.rb - About 1 hr to fix

                          Method initialize has 10 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def initialize(port_name = 'COM1',
                                             baud_rate = 9600,
                                             parity = :NONE,
                                             stop_bits = 1,
                                             write_timeout = 10.0,
                          Severity: Major
                          Found in openc3/lib/openc3/io/win32_serial_driver.rb - About 1 hr to fix

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

                              acediff.editors.right.markers.forEach((marker) => {
                                acediff.editors.right.ace.getSession().removeMarker(marker)
                              }, acediff)
                            openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/index.js on lines 447..449

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

                            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

                              acediff.editors.left.markers.forEach((marker) => {
                                acediff.editors.left.ace.getSession().removeMarker(marker)
                              }, acediff)
                            openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/index.js on lines 450..452

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

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

                              function diff_cleanupSemanticScore_(one, two) {
                                if (!one || !two) {
                                  // Edges are the best.
                                  return 6
                                }

                              Function diff_commonOverlap_ has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              diff_match_patch.prototype.diff_commonOverlap_ = function (text1, text2) {
                                // Cache the text lengths to prevent multiple calls.
                                var text1_length = text1.length
                                var text2_length = text2.length
                                // Eliminate the null case.

                                Method _openc3_script_wait_implementation_expression has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    def _openc3_script_wait_implementation_expression(exp_to_eval, timeout, polling_rate, context, scope: $openc3_scope, token: $openc3_token)
                                      end_time = Time.now.sys + timeout
                                      raise "Invalid comparison to non-ascii value" unless exp_to_eval.is_printable?
                                
                                      while true
                                Severity: Minor
                                Found in openc3/lib/openc3/script/api_shared.rb - About 1 hr to fix

                                  Method build_dcb has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      def self.build_dcb
                                        dcb = Structure.new(:LITTLE_ENDIAN)
                                        dcb.define_item('DCBlength', 0, 32, :UINT)
                                        dcb.define_item('BaudRate',  32, 32, :UINT)
                                        dcb.define_item('fBinary', 71, 1, :UINT)
                                  Severity: Minor
                                  Found in openc3/lib/openc3/win32/win32.rb - About 1 hr to fix

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

                                        def initialize(
                                          start_char = nil,
                                          read_strip_characters = true,
                                          read_enable_escaping = true,
                                          write_enable_escaping = true,
                                    Severity: Minor
                                    Found in openc3/lib/openc3/interfaces/protocols/slip_protocol.rb - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language