rapid7/metasploit-aggregator

View on GitHub

Showing 25 of 31 total issues

Method forward has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def forward(connection)
        #forward input requests
        request_obj = Metasploit::Aggregator::Http::Responder.get_data(connection, false)
        uri = Metasploit::Aggregator::Http::Request.parse_uri(request_obj)
        @forwarder_mutex.synchronize do
Severity: Minor
Found in ruby/lib/metasploit/aggregator/http_forwarder.rb - About 35 mins 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 forward has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def forward(connection)
        #forward input requests
        request_obj = Metasploit::Aggregator::Http::SslResponder.get_data(connection, false)
        uri = Metasploit::Aggregator::Http::Request.parse_uri(request_obj)
        @forwarder_mutex.synchronize do
Severity: Minor
Found in ruby/lib/metasploit/aggregator/https_forwarder.rb - About 35 mins 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 initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def initialize(opts=nil)
          opts = load_new if opts.nil?
          opts = load_raw(opts[:raw]) if opts[:raw]

          self.puid      = opts[:puid]
Severity: Minor
Found in ruby/lib/metasploit/aggregator/tlv/uuid.rb - About 25 mins 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_response has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def Packet.create_response(request = nil)
          response_type = PACKET_TYPE_RESPONSE
          method = nil
          id = nil

Severity: Minor
Found in ruby/lib/metasploit/aggregator/tlv/packet.rb - About 25 mins 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 add_tlv has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def add_tlv(type, value = nil, replace = false, compress=false)

          # If we should replace any TLVs with the same type...remove them first
          if replace
            each(type) { |tlv|
Severity: Minor
Found in ruby/lib/metasploit/aggregator/tlv/packet.rb - About 25 mins 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