Method parse_args_http
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_args_http(args = [], _type = 'http')
opt_parser = Rex::Parser::Arguments.new(
'-0' => [ false, 'Use HTTP 1.0' ],
'-1' => [ false, 'Use TLSv1 (SSL)' ],
'-2' => [ false, 'Use SSLv2 (SSL)' ],
Method cmd_request
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def cmd_request(*args)
# short circuit the whole deal if they need help
return help if args.empty?
return help if args.length == 1 && args.first =~ HELP_REGEX
- 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 handle_request_http
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
def handle_request_http(opts, _opt_parser)
uri = opts[:uri]
http_client = Rex::Proto::Http::Client.new(
uri.host,
uri.port,
Method cmd_request
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def cmd_request(*args)
# short circuit the whole deal if they need help
return help if args.empty?
return help if args.length == 1 && args.first =~ HELP_REGEX
Method handle_request_http
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def handle_request_http(opts, _opt_parser)
uri = opts[:uri]
http_client = Rex::Proto::Http::Client.new(
uri.host,
uri.port,
- 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_args_http
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def parse_args_http(args = [], _type = 'http')
opt_parser = Rex::Parser::Arguments.new(
'-0' => [ false, 'Use HTTP 1.0' ],
'-1' => [ false, 'Use TLSv1 (SSL)' ],
'-2' => [ false, 'Use SSLv2 (SSL)' ],
- 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 output_line
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def output_line(opts, line)
if opts[:output_file].nil?
if line[-2..] == "\r\n"
print_line(line[0..-3])
elsif line[-1] == "\n"
- 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"