Showing 55 of 92 total issues
File default_codes.rb
has 1308 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module BrBoleto
module Helper
module DefaultCodes
########################################################################################
############################## ESPÉCIE DO TÍTULO #####################################
Method equivalent_codigo_motivo_ocorrencia_A_240
has 546 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def equivalent_codigo_motivo_ocorrencia_A_240 codigo_movimento_gem
# Código Padrão para
{# do Banco a Gem
'A00' => 'A00', # Ocorrência aceita
'01' => 'A01' , # Código do Banco Inválido
File itau.rb
has 496 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module BrBoleto
module Conta
class Itau < BrBoleto::Conta::Base
# MODALIDADE CARTEIRA:
Method equivalent_codigo_motivo_ocorrencia_A_400
has 167 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def equivalent_codigo_motivo_ocorrencia_A_400 codigo_movimento_gem
case codigo_movimento_gem
when '02'
super.merge(
# Padrão Código para
Method equivalent_codigo_movimento_retorno_240
has 165 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def equivalent_codigo_movimento_retorno_240
{
'01' => '01', # Solicitação de Impressão de Títulos Confirmada
'02' => '02', # Entrada Confirmada
'03' => '03', # Entrada Rejeitada
Class Santander
has 44 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Santander < BrBoleto::Remessa::Cnab240::Base
def conta_class
BrBoleto::Conta::Santander
end
Method equivalent_codigo_motivo_ocorrencia_B_240
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def equivalent_codigo_motivo_ocorrencia_B_240 codigo_movimento_gem
# Código Padrão para
{# do Banco a Gem
'01' => 'B01', # Tarifa de Extrato de Posição
'02' => 'B02', # Tarifa de Manutenção de Título Vencido
Method set_regras_tamanho_e_validations!
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
Open
def set_regras_tamanho_e_validations!
@conta ||= conta_class.new()
@conta.valid_conta_corrente_length = valid_conta_corrente_length if "#{valid_conta_corrente_length}".present?
@conta.valid_conta_corrente_minimum = valid_conta_corrente_minimum if "#{valid_conta_corrente_minimum}".present?
@conta.valid_conta_corrente_maximum = valid_conta_corrente_maximum if "#{valid_conta_corrente_maximum}".present?
- 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 equivalent_codigo_motivo_ocorrencia_A_400
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def equivalent_codigo_motivo_ocorrencia_A_400 codigo_movimento_gem
case codigo_movimento_gem
when '02'
super.merge(
# Padrão Código para
Method equivalent_codigo_motivo_ocorrencia_B_400
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def equivalent_codigo_motivo_ocorrencia_B_400 codigo_movimento_gem
super.merge(
# Padrão Código para
{# do Banco a GEM
'68' => 'B16', # Fornecimento de máquina FAX
Class Sicoob
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Sicoob < BrBoleto::Remessa::Cnab240::Base
def conta_class
BrBoleto::Conta::Sicoob
end
Method equivalent_codigo_motivo_ocorrencia_A_400
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def equivalent_codigo_motivo_ocorrencia_A_400 codigo_movimento_gem
super.merge(
# Padrão Código para
{# do Banco a GEM
'001' => 'A08', # NOSSO NUMERO NAO NUMERICO
Class Pagamento
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Pagamento < BrBoleto::ActiveModelBase
# conté o metodo 'pagador'
# CNAB: 240 e 400
include BrBoleto::HavePagador
Class Itau
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Itau < BrBoleto::Conta::Base
# MODALIDADE CARTEIRA:
# _______________________________________________________________________
# | Carteira | Descrição |
Class Caixa
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Caixa < BrBoleto::Conta::Base
# MODALIDADE CARTEIRA
# Opcoes:
# 14: Cobrança Simples com registro
File banco_brasil.rb
has 282 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module BrBoleto
module Conta
class BancoBrasil < BrBoleto::Conta::Base
# MODALIDADE CARTEIRA:
Method equivalent_codigo_motivo_ocorrencia_C_240
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def equivalent_codigo_motivo_ocorrencia_C_240 codigo_movimento_gem
# Código Padrão para
{# do Banco a Gem
'01' => 'C01', # Por Saldo
'02' => 'C02', # Por Conta
Class Itau
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Itau < BrBoleto::Remessa::Cnab240::Base
def conta_class
BrBoleto::Conta::Itau
end
Class Santander
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Santander < BrBoleto::Conta::Base
# MODALIDADE CARTEIRA:
# ___________________________________________
# | Carteira | Descrição |
Method equivalent_codigo_ocorrencia_pagador_240
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def equivalent_codigo_ocorrencia_pagador_240
{
'0101' => '0101', # Pagador alega que não recebeu a mercadoria
'0102' => '0102', # Pagador alega que a mercadoria chegou atrasada
'0103' => '0103', # Pagador alega que a mercadoria chegou avariada