Method parse
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def parse(value, datastore)
Enumerator.new do |results|
# extract the individual elements from the rhost string, ensuring that
# whitespace, strings, escape characters, etc are handled correctly.
values = Rex::Parser::Arguments.from_s(value)
- Read upRead up
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 parse
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse(value, datastore)
Enumerator.new do |results|
# extract the individual elements from the rhost string, ensuring that
# whitespace, strings, escape characters, etc are handled correctly.
values = Rex::Parser::Arguments.from_s(value)
Method parse_http_uri
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def parse_http_uri(value, datastore)
uri = ::Addressable::URI.parse(value)
result = {}
result['RHOSTS'] = uri.hostname
- Read upRead up
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 parse_smb_uri
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def parse_smb_uri(value, datastore)
uri = ::Addressable::URI.parse(value)
result = {}
result['RHOSTS'] = uri.hostname
- Read upRead up
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 each
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def each(&block)
return unless @value
return unless block_given?
parse(@value, @datastore).each do |result|
- Read upRead up
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 errors
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def errors(&block)
return unless @value
return unless block_given?
parse(@value, @datastore).each do |result|
- Read upRead up
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"