Showing 15 of 15 total issues
Method request
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def request(url, data = {}, header = {}, method = @method, retry_auth = DEFAULT_RETRY)
response = ''
http = Net::HTTP.new(url.host, url.port)
http.read_timeout = 600
- 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 get_object
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def get_object(resource, type, id, location = false) #:yields: data_object
header = {
'Accept' => mimemap.keys.join(',')
}
- 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
Class Client
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Client
COMPACT_FORMAT = 'COMPACT'
METHOD_GET = 'GET'
METHOD_POST = 'POST'
File client.rb
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'cgi'
require 'digest/md5'
require 'logger'
require 'net/http'
require 'uri'
Method get_object
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_object(resource, type, id, location = false) #:yields: data_object
header = {
'Accept' => mimemap.keys.join(',')
}
Method request
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def request(url, data = {}, header = {}, method = @method, retry_auth = DEFAULT_RETRY)
response = ''
http = Net::HTTP.new(url.host, url.port)
http.read_timeout = 600
Method login
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def login(username, password) #:yields: login_results
@request_struct.username = username
@request_struct.password = password
# We are required to set the Accept header to this by the RETS 1.5 specification.
- 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 login
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def login(username, password) #:yields: login_results
@request_struct.username = username
@request_struct.password = password
# We are required to set the Accept header to this by the RETS 1.5 specification.
Method calculate_digest
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.calculate_digest(username, password, realm, nonce, method, uri, qop = false, cnonce = false, nc = 0) # :nodoc:
Method connection
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def self.connection(spec = nil)
case spec
when nil
connection(RETS4R::ListingService.env)
when Symbol, String
- 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 authenticate
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.authenticate(response, username, password, uri, method, requestId, useragent, nc = 0) # :nodoc:
Method request
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def request(url, data = {}, header = {}, method = @request_method, retry_auth = DEFAULT_RETRY)
Method request
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def request(url, data = {}, header = {}, method = @method, retry_auth = DEFAULT_RETRY)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(uri, type, id, format, request_struct)
Method start_element
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def start_element name, attrs = []
case name
when 'DELIMITER'
# This is a workaround for the old attribute handling in nokogiri
@delimiter = if Array === attrs.last
- 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"