Showing 5 of 70 total issues
File constants.rb
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module Gerencianet
# Endpoints signatures
module Constants
URL = {
DEFAULT: {
Method authenticate
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def authenticate
if (@options.has_key?(:pix_cert))
url = get_url({}, @endpoints[:PIX][:authorize][:route])
else
url = get_url({}, @endpoints[:DEFAULT][:authorize][:route])
Method make_request
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def make_request(params, body, settings)
url = get_url(params, settings[:route])
headers = {
"accept" => "application/json",
"api-sdk" => "ruby-#{Gerencianet::VERSION}"
Method current_base_url
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def current_base_url
if (@options.has_key?(:pix_cert))
@options[:sandbox] ? @urls[:PIX][:sandbox] : @urls[:PIX][:production]
else
@options[:sandbox] ? @urls[:DEFAULT][:sandbox] : @urls[:DEFAULT][:production]
- 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 a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def authenticate
if (@options.has_key?(:pix_cert))
url = get_url({}, @endpoints[:PIX][:authorize][:route])
else
url = get_url({}, @endpoints[:DEFAULT][:authorize][:route])
- 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"