Showing 11 of 13 total issues
Method modelo_generico_rodape
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
def modelo_generico_rodape(doc, boleto)
#INICIO Segunda parte do BOLETO BB
# LOGOTIPO do BANCO
doc.image(boleto.logotipo, :x => '0.4 cm', :y => '16.85 cm', :zoom => 80)
doc.moveto :x => '5.05 cm', :y => '16.9 cm'
Method modelo_carne_build_data_right
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def modelo_carne_build_data_right(doc, boleto,colunas,linhas)
# LOGOTIPO do BANCO
doc.image(boleto.logotipo, :x => colunas[2], :y => linhas[0], :zoom => 50)
Method modelo_generico_cabecalho
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def modelo_generico_cabecalho(doc, boleto)
#INICIO Primeira parte do BOLETO
# LOGOTIPO do BANCO
doc.image(boleto.logotipo, x: '0.4 cm', y: '23.85 cm', zoom: 80)
# Dados
Method multiplicador
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def multiplicador(fatores, &block)
raise ArgumentError, 'Número inválido' unless self.is_number?
total = 0
multiplicador_posicao = 0
- 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 codigo_barras_segunda_parte
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def codigo_barras_segunda_parte
case self.convenio.to_s.size
when 8 # Nosso Número de 17 dígitos com Convenio de 8 dígitos e numero_documento de 9 dígitos
"000000#{self.convenio}#{self.numero_documento}#{self.carteira}"
when 7 # Nosso Número de 17 dígitos com Convenio de 7 dígitos e numero_documento de 10 dígitos
- 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 modelo_generico_multipage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def modelo_generico_multipage(boletos, options={})
doc=Document.new :paper => :A4 # 210x297
template_path = File.join(File.dirname(__FILE__),'..','..','arquivos','templates','modelo_generico.eps')
- 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 modulo_10_banespa
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def modulo_10_banespa
raise ArgumentError, 'Número inválido' unless self.is_number?
fatores = [7, 3, 1, 9, 7, 3, 1, 9, 7, 3]
total = 0
- 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 modelo_carne_multipage
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def modelo_carne_multipage(boletos, options={})
doc=Document.new :paper => :A4
max_per_page = 3
- 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 modulo10
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def modulo10
raise ArgumentError, 'Número inválido' unless self.is_number?
total = 0
multiplicador = 2
- 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 to_currency
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def to_currency(options = {})
number = self
default = Brcobranca::Currency::DEFAULT
options = default.merge(options)
precision = options[:precision] || default[:precision]
- 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 numero_documento
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def numero_documento
quantidade = case @convenio.to_s.size
when 8
9
when 7
- 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"