Showing 196 of 196 total issues
File http.rb
has 1063 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 68 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 30 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'
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
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(types)
super(types)
if types::ADDRESS_SIZE == 8
# NOTE: `long` and `unsigne long` are actually 4 bytes on
Similar blocks of code found in 2 locations. Consider refactoring. Open
module Ronin
module Support
module Binary
module CTypes
#
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 100.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
module Ronin
module Support
module Binary
module CTypes
#
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 100.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76