BallAerospace/COSMOS

View on GitHub

Showing 688 of 938 total issues

Method write has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    def write(packet)
      raise "Interface not connected for write: #{@name}" unless connected?
      raise "Interface not writable: #{@name}" unless write_allowed?

      _write do
Severity: Minor
Found in cosmos/lib/cosmos/interfaces/interface.rb - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method set_limits has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    def set_limits(target_name, packet_name, item_name, red_low, yellow_low, yellow_high, red_high,
                   green_low = nil, green_high = nil, limits_set = :CUSTOM, persistence = nil, enabled = true,
                   scope: $cosmos_scope, token: $cosmos_token)
      authorize(permission: 'tlm_set', target_name: target_name, packet_name: packet_name, scope: scope, token: token)
      if (red_low > yellow_low) || (yellow_low >= yellow_high) || (yellow_high > red_high)
Severity: Minor
Found in cosmos/lib/cosmos/api/limits_api.rb - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method report has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    def self.report(binary, definition_filename, requested_table_name = nil)
      report = StringIO.new
      config = TableConfig.process_file(definition_filename)
      begin
        load_binary(config, binary)
Severity: Minor
Found in cosmos/lib/cosmos/tools/table_manager/table_manager_core.rb - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method read has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

      def read(read_length)
        if read_length <= (@buffer.length - @buffer_index)
          # Return part of the buffer without having to go to the OS
          result = @buffer[@buffer_index, read_length]
          @buffer_index += read_length
Severity: Minor
Found in cosmos/lib/cosmos/io/buffered_file.rb - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method read has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    def read
      data = ''
      sleep_time = 0.0

      loop do
Severity: Minor
Found in cosmos/lib/cosmos/io/win32_serial_driver.rb - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method identify has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    def identify(packet_data, target_names = nil)
      identified_packet = nil

      target_names = target_names() unless target_names

Severity: Minor
Found in cosmos/lib/cosmos/packets/commands.rb - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method create_commands has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    def create_commands(xml, commands, target_name)
      return unless commands[target_name]

      xml['xtce'].CommandMetaData do
        xml['xtce'].ArgumentTypeSet do
Severity: Minor
Found in cosmos/lib/cosmos/packets/parsers/xtce_converter.rb - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method unsegment_packet has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    def unsegment_packet(packet)
      @ccsds_packet.buffer = packet.buffer

      previous_sequence_count = @sequence_count
      @sequence_count = @ccsds_packet.read('CcsdsSeqcnt')
Severity: Minor
Found in cosmos/lib/cosmos/ccsds/ccsds_parser.rb - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method get_tlm_values has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    def self.get_tlm_values(items, scope: $cosmos_scope)
      results = []
      lookups = []
      packet_lookup = {}
      # First generate a lookup hash of all the items represented so we can query the CVT
Severity: Minor
Found in cosmos/lib/cosmos/models/cvt_model.rb - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method formatted has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

  def formatted(
    word_size = 1,
    words_per_line = 16,
    word_separator = ' ',
    indent = 0,
Severity: Minor
Found in cosmos/lib/cosmos/core_ext/string.rb - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method monitor has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    def monitor
      processes_to_delete = []
      cleanup_time = Time.now
      while true
        current_time = Time.now
Severity: Minor
Found in cosmos/lib/cosmos/utilities/process_manager.rb - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method get_limits_events has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    def get_limits_events(offset = nil, count: 100)
      result = $api_server.get_limits_events(offset, count: count)
      if result
        result[0] = result[0].to_s.intern
        if result[0] == :LIMITS_CHANGE
Severity: Minor
Found in cosmos/lib/cosmos/script/limits.rb - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method run has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    def run
      results = []

      # Setup the script group
      result = run_setup()
Severity: Minor
Found in cosmos/lib/cosmos/script/suite.rb - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method _cosmos_script_wait_implementation has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    def _cosmos_script_wait_implementation(target_name, packet_name, item_name, value_type, timeout, polling_rate, exp_to_eval, scope: $cosmos_scope, token: $cosmos_token, &block)
      end_time = Time.now.sys + timeout

      while true
        work_start = Time.now.sys
Severity: Minor
Found in cosmos/lib/cosmos/script/api_shared.rb - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method process_array_type has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    def process_array_type(element, bit_size)
      array_num_items = 1
      # Need to determine dimensions
      xtce_recurse_element(element) do |block_element|
        if block_element.name == 'Dimension'
Severity: Minor
Found in cosmos/lib/cosmos/packets/parsers/xtce_parser.rb - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method set_parameters has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    def set_parameters(command, params, range_checking)
      given_item_names = []
      params.each do |item_name, value|
        item_upcase = item_name.to_s.upcase
        item = command.get_item(item_upcase)
Severity: Minor
Found in cosmos/lib/cosmos/packets/commands.rb - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method write_item has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    def write_item(item, value, value_type = :CONVERTED, buffer = @buffer)
      case value_type
      when :RAW
        super(item, value, value_type, buffer)
      when :CONVERTED
Severity: Minor
Found in cosmos/lib/cosmos/packets/packet.rb - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method identify has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    def identify(packet_data, target_names = nil)
      target_names = target_names() unless target_names

      target_names.each do |target_name|
        target_name = target_name.to_s.upcase
Severity: Minor
Found in cosmos/lib/cosmos/packets/telemetry.rb - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method update has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    def update
      @previous_microservices = @microservices.dup
      # Get all the microservice configuration
      @microservices = MicroserviceModel.all

Severity: Minor
Found in cosmos/lib/cosmos/operators/microservice_operator.rb - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method get_overall_limits_state has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    def get_overall_limits_state(ignored_items = nil, scope: $cosmos_scope, token: $cosmos_token)
      # We only need to check out of limits items so call get_out_of_limits() which authorizes
      out_of_limits = get_out_of_limits(scope: scope, token: token)
      overall = 'GREEN'
      limits_packet_stale = false # TODO: Calculate stale
Severity: Minor
Found in cosmos/lib/cosmos/api/limits_api.rb - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Severity
Category
Status
Source
Language