Showing 109 of 196 total issues
File http.rb
has 1063 lines of code (exceeds 250 allowed). Consider refactoring. Open
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
Open
class Buffer < Memory
include CTypes::Mixin
#
Class Stream
has 103 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Stream
#
# Adds `read_*`/`write_*` methods for reading and writing binary data
# types.
#
Class HTTP
has 68 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class HTTP
#
# The Ronin HTTP proxy to use.
#
Class Host
has 59 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Host
# The host name.
#
# @return [String]
Method initialize
has 164 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
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
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
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
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
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
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
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
Open
def initialize(types)
super(types)
typedef :int, :__clockid_t
typedef :int, :clockid_t
Class HTTP
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
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
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'
Consider simplifying this complex logical expression. Open
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
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(types)
super(types)
if types::ADDRESS_SIZE == 8
# NOTE: `long` and `unsigne long` are actually 4 bytes on
Class IP
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class IP < IPAddr
#
# Initializes the IP address.
#
Method run
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Open
def run
io_array = [@io, @stdin]
loop do
readable, _writable, errors = IO.select(io_array,nil,io_array)
- 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"