Showing 114 of 202 total issues
File http.rb
has 1117 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'ronin/support/network/http/user_agents'
require 'ronin/support/network/http/request'
require 'ronin/support/network/http/set_cookie'
require 'ronin/support/network/http/core_ext'
require 'ronin/support/network/dns/idn'
Class Buffer
has 106 methods (exceeds 20 allowed). Consider refactoring. Open
class Buffer < Memory
include CTypes::Mixin
#
Class Stream
has 103 methods (exceeds 20 allowed). Consider refactoring. Open
class Stream
#
# Adds `read_*`/`write_*` methods for reading and writing binary data
# types.
#
Class HTTP
has 70 methods (exceeds 20 allowed). Consider refactoring. Open
class HTTP
#
# The Ronin HTTP proxy to use.
#
Class Host
has 59 methods (exceeds 20 allowed). Consider refactoring. Open
class Host
# The host name.
#
# @return [String]
Method initialize
has 164 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(types)
super(types)
typedef :int, :__clockid_t
typedef :int, :clockid_t
File buffer.rb
has 418 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'ronin/support/binary/memory'
require 'ronin/support/binary/byte_slice'
require 'ronin/support/binary/ctypes/mixin'
module Ronin
Method initialize
has 142 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(types)
super(types)
typedef :long, :__blkcnt_t
typedef :long, :__blksize_t
Class Resolver
has 39 methods (exceeds 20 allowed). Consider refactoring. Open
class Resolver
# The nameserver(s) to query.
#
# @return [Array<String>]
File methods.rb
has 377 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'ronin/support/binary/buffer'
require 'ronin/support/binary/array'
require 'ronin/support/binary/struct'
require 'ronin/support/binary/union'
Method initialize
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(types)
super(types)
typedef :int, :__clockid_t
typedef :int, :clockid_t
Class Proxy
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
class Proxy
# Default host to bind to
DEFAULT_HOST = '0.0.0.0'
Method initialize
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(types)
super(types)
typedef :long_long, :blkcnt_t
typedef :int, :blksize_t
Method initialize
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(types)
super(types)
typedef :int, :__clockid_t
typedef :int, :clockid_t
Class HTTP
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
class HTTP
#
# Provides helper methods for communicating with HTTP Servers.
#
module Mixin
File host.rb
has 296 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'ronin/support/network/dns'
require 'ronin/support/network/dns/idn'
require 'ronin/support/network/ip'
require 'ronin/support/network/tld'
require 'ronin/support/network/public_suffix'
Method context
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def self.context(version: nil,
min_version: nil,
max_version: nil,
verify: :none,
key: nil,
- 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
Consider simplifying this complex logical expression. Open
if (byte == 33) || (byte == 36) || (byte == 38) || ((byte >= 39) && (byte <= 59)) || (byte == 61) || ((byte >= 63) && (byte <= 91)) || (byte == 93) || (byte == 95) || ((byte >= 97) && (byte <= 122)) || (byte == 126)
byte.chr
else
encode_byte(byte,**kwargs)
end
Method initialize_ssl
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def initialize_ssl(ca_bundle: nil,
cert: nil,
cert_store: nil,
ciphers: nil,
extra_chain_cert: nil,
- 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 build
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def self.build(method,path, # query string keyword arguments
query: nil,
query_params: nil,
# Basic-Auth keyword arguments
user: nil,
- 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"