Brunomm/br_boleto

View on GitHub

Showing 37 of 92 total issues

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    module Retorno
        module Cnab400
            class Santander < BrBoleto::Retorno::Cnab400::Base
            private
                def detalhe_fields #:doc:
Severity: Major
Found in lib/br_boleto/retorno/cnab400/santander.rb and 2 other locations - About 1 hr to fix
lib/br_boleto/retorno/cnab400/banco_brasil.rb on lines 3..42
lib/br_boleto/retorno/cnab400/sicoob.rb on lines 3..38

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 71.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                def equivalent_especie_titulo_240
                    super.merge(
                        #  Padrão    Código para
                        {# da GEM     o Banco
                            '01'  => '99',  # CH   –  Cheque
Severity: Major
Found in lib/br_boleto/conta/sicredi.rb and 1 other location - About 1 hr to fix
lib/br_boleto/conta/itau.rb on lines 556..593

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 71.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                def equivalent_codigo_ocorrencia_pagador_240
                    super.merge(
                        #  Padrão    Código para  
                        {# do Banco    a GEM
                            '1313' => '0302',  # SOLICITA A PRORROGAÇÃO DO VENCIMENTO PARA:
Severity: Major
Found in lib/br_boleto/conta/itau.rb and 1 other location - About 1 hr to fix
lib/br_boleto/conta/sicredi.rb on lines 115..151

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 71.

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

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    module Retorno
        module Cnab400
            class BancoBrasil < BrBoleto::Retorno::Cnab400::Base
            private
                def detalhe_fields #:doc:
Severity: Major
Found in lib/br_boleto/retorno/cnab400/banco_brasil.rb and 2 other locations - About 1 hr to fix
lib/br_boleto/retorno/cnab400/santander.rb on lines 3..42
lib/br_boleto/retorno/cnab400/sicoob.rb on lines 3..38

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 71.

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

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    module Retorno
        module Cnab400
            class Sicoob < BrBoleto::Retorno::Cnab400::Base
            private
                def detalhe_fields #:doc:
Severity: Major
Found in lib/br_boleto/retorno/cnab400/sicoob.rb and 2 other locations - About 1 hr to fix
lib/br_boleto/retorno/cnab400/banco_brasil.rb on lines 3..42
lib/br_boleto/retorno/cnab400/santander.rb on lines 3..42

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 71.

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

Further Reading

Identical blocks of code found in 3 locations. Consider refactoring.
Open

                def informacoes_do_pagamento(pagamento, sequencial)
                    dados = ''
                    dados << pagamento.data_vencimento_formatado('%d%m%y')
                    dados << pagamento.valor_documento_formatado(13)
                    dados << "#{conta.codigo_banco}".adjust_size_to(3,'0', :right)
Severity: Major
Found in lib/br_boleto/remessa/cnab400/santander.rb and 2 other locations - About 1 hr to fix
lib/br_boleto/remessa/cnab400/banco_brasil.rb on lines 159..172
lib/br_boleto/remessa/cnab400/itau.rb on lines 109..122

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 67.

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

Further Reading

Identical blocks of code found in 3 locations. Consider refactoring.
Open

                def informacoes_do_pagamento(pagamento, sequencial)
                    dados = ''
                    dados << pagamento.data_vencimento_formatado('%d%m%y')
                    dados << pagamento.valor_documento_formatado(13)
                    dados << "#{conta.codigo_banco}".adjust_size_to(3,'0', :right)
Severity: Major
Found in lib/br_boleto/remessa/cnab400/banco_brasil.rb and 2 other locations - About 1 hr to fix
lib/br_boleto/remessa/cnab400/itau.rb on lines 109..122
lib/br_boleto/remessa/cnab400/santander.rb on lines 110..123

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 67.

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

Further Reading

Identical blocks of code found in 3 locations. Consider refactoring.
Open

                def informacoes_do_pagamento(pagamento, sequencial)
                    dados = ''
                    dados << pagamento.data_vencimento_formatado('%d%m%y')
                    dados << pagamento.valor_documento_formatado(13)
                    dados << "#{conta.codigo_banco}".adjust_size_to(3,'0', :right)
Severity: Major
Found in lib/br_boleto/remessa/cnab400/itau.rb and 2 other locations - About 1 hr to fix
lib/br_boleto/remessa/cnab400/banco_brasil.rb on lines 159..172
lib/br_boleto/remessa/cnab400/santander.rb on lines 110..123

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 67.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                def equivalent_codigo_motivo_ocorrencia_A_400 codigo_movimento_gem
                    super.merge(
                        #  Padrão    Código para  
                        {# do Banco    a GEM
                            '01'   =>   'A220',  # Movimento sem Beneficiário Correspondente
Severity: Major
Found in lib/br_boleto/conta/caixa.rb and 1 other location - About 1 hr to fix
lib/br_boleto/conta/caixa.rb on lines 276..304

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 55.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                def detalhe_fields #:doc:
                    { #    ATRIBUTO               POSIÇÃO DA LINHA

                        carteira:                      14..14,
                        codigo_pagador_cooperativa:    15..19,
Severity: Major
Found in lib/br_boleto/retorno/cnab400/sicredi.rb and 1 other location - About 1 hr to fix
lib/br_boleto/retorno/cnab240/base.rb on lines 52..79

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 55.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                def equivalent_codigo_movimento_retorno_400
                    super.merge(
                        #  Padrão    Código para  
                        {# do Banco    a GEM
                            '01'   =>   '02',      # Entrada Confirmada
Severity: Major
Found in lib/br_boleto/conta/caixa.rb and 1 other location - About 1 hr to fix
lib/br_boleto/conta/caixa.rb on lines 224..252

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 55.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                def segmento_t_fields #:doc:
                    { #    ATRIBUTO               POSIÇÃO DA LINHA
                        codigo_movimento_retorno:      16..17,
                        agencia_com_dv:                18..23,
                        agencia_sem_dv:                18..22,
Severity: Major
Found in lib/br_boleto/retorno/cnab240/base.rb and 1 other location - About 1 hr to fix
lib/br_boleto/retorno/cnab400/sicredi.rb on lines 23..52

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 55.

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

Further Reading

Identical blocks of code found in 5 locations. Consider refactoring.
Open

                def detalhe_multas_e_juros_do_pagamento(pagamento, sequencial)
                    detalhe = ''
                    detalhe << pagamento.valor_juros_monetario_formatado(13)
                    detalhe << "#{pagamento.data_desconto_formatado('%d%m%y')}".adjust_size_to(6,'0', :right )
                    detalhe << "#{pagamento.valor_desconto_formatado}".adjust_size_to(13,'0', :right )
Severity: Major
Found in lib/br_boleto/remessa/cnab400/caixa.rb and 4 other locations - About 1 hr to fix
lib/br_boleto/remessa/cnab400/banco_brasil.rb on lines 185..192
lib/br_boleto/remessa/cnab400/bradesco.rb on lines 185..192
lib/br_boleto/remessa/cnab400/itau.rb on lines 135..142
lib/br_boleto/remessa/cnab400/santander.rb on lines 136..143

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 51.

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

Further Reading

Identical blocks of code found in 5 locations. Consider refactoring.
Open

                def detalhe_multas_e_juros_do_pagamento(pagamento, sequencial)
                    detalhe = ''
                    detalhe << pagamento.valor_juros_monetario_formatado(13)
                    detalhe << "#{pagamento.data_desconto_formatado('%d%m%y')}".adjust_size_to(6,'0', :right )
                    detalhe << "#{pagamento.valor_desconto_formatado}".adjust_size_to(13,'0', :right )
Severity: Major
Found in lib/br_boleto/remessa/cnab400/santander.rb and 4 other locations - About 1 hr to fix
lib/br_boleto/remessa/cnab400/banco_brasil.rb on lines 185..192
lib/br_boleto/remessa/cnab400/bradesco.rb on lines 185..192
lib/br_boleto/remessa/cnab400/caixa.rb on lines 147..154
lib/br_boleto/remessa/cnab400/itau.rb on lines 135..142

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 51.

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

Further Reading

Identical blocks of code found in 5 locations. Consider refactoring.
Open

                def detalhe_multas_e_juros_do_pagamento(pagamento, sequencial)
                    detalhe = ''
                    detalhe << pagamento.valor_juros_monetario_formatado(13)
                    detalhe << "#{pagamento.data_desconto_formatado('%d%m%y')}".adjust_size_to(6,'0', :right )
                    detalhe << "#{pagamento.valor_desconto_formatado}".adjust_size_to(13,'0', :right )
Severity: Major
Found in lib/br_boleto/remessa/cnab400/bradesco.rb and 4 other locations - About 1 hr to fix
lib/br_boleto/remessa/cnab400/banco_brasil.rb on lines 185..192
lib/br_boleto/remessa/cnab400/caixa.rb on lines 147..154
lib/br_boleto/remessa/cnab400/itau.rb on lines 135..142
lib/br_boleto/remessa/cnab400/santander.rb on lines 136..143

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 51.

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

Further Reading

Identical blocks of code found in 5 locations. Consider refactoring.
Open

                def detalhe_multas_e_juros_do_pagamento(pagamento, sequencial)
                    detalhe = ''
                    detalhe << pagamento.valor_juros_monetario_formatado(13)
                    detalhe << "#{pagamento.data_desconto_formatado('%d%m%y')}".adjust_size_to(6,'0', :right )
                    detalhe << "#{pagamento.valor_desconto_formatado}".adjust_size_to(13,'0', :right )
Severity: Major
Found in lib/br_boleto/remessa/cnab400/banco_brasil.rb and 4 other locations - About 1 hr to fix
lib/br_boleto/remessa/cnab400/bradesco.rb on lines 185..192
lib/br_boleto/remessa/cnab400/caixa.rb on lines 147..154
lib/br_boleto/remessa/cnab400/itau.rb on lines 135..142
lib/br_boleto/remessa/cnab400/santander.rb on lines 136..143

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 51.

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

Further Reading

Identical blocks of code found in 5 locations. Consider refactoring.
Open

                def detalhe_multas_e_juros_do_pagamento(pagamento, sequencial)
                    detalhe = ''
                    detalhe << pagamento.valor_juros_monetario_formatado(13)
                    detalhe << "#{pagamento.data_desconto_formatado('%d%m%y')}".adjust_size_to(6,'0', :right )
                    detalhe << "#{pagamento.valor_desconto_formatado}".adjust_size_to(13,'0', :right )
Severity: Major
Found in lib/br_boleto/remessa/cnab400/itau.rb and 4 other locations - About 1 hr to fix
lib/br_boleto/remessa/cnab400/banco_brasil.rb on lines 185..192
lib/br_boleto/remessa/cnab400/bradesco.rb on lines 185..192
lib/br_boleto/remessa/cnab400/caixa.rb on lines 147..154
lib/br_boleto/remessa/cnab400/santander.rb on lines 136..143

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 51.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                    {# da GEM     o Banco
                        '01'   =>   '01' ,     # Registro de títulos
                        '02'   =>   '02' ,     # Solicitação de baixa
                        '03'   =>   '03' ,     # Pedido de débito em conta
                        '04'   =>   '04' ,     # Concessão de abatimento
Severity: Minor
Found in lib/br_boleto/conta/banco_brasil.rb and 1 other location - About 1 hr to fix
lib/br_boleto/conta/banco_brasil.rb on lines 325..348

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 47.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                        {# do Banco    a GEM
                            '05'   =>   '17',   # Liquidado sem registro (carteira 17=tipo4)
                            '07'   =>   '102',  # Liquidação por Conta/Parcial
                            '08'   =>   '103',  # Liquidação por Saldo
                            '15'   =>   '101',  # Liquidação em Cartório
Severity: Minor
Found in lib/br_boleto/conta/banco_brasil.rb and 1 other location - About 1 hr to fix
lib/br_boleto/conta/banco_brasil.rb on lines 110..133

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 47.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

                    def informacoes_da_conta
                        informacoes =  "#{conta.agencia}".adjust_size_to(5, '0', :right)
                        informacoes << "#{conta.agencia_dv}"
                        informacoes << "#{conta.conta_corrente}".adjust_size_to(12, '0', :right)
                        informacoes << "#{conta.conta_corrente_dv}".adjust_size_to(2)
Severity: Minor
Found in lib/br_boleto/remessa/cnab240/banco_brasil.rb and 1 other location - About 35 mins to fix
lib/br_boleto/remessa/cnab240/cecred.rb on lines 30..35

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 36.

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

Further Reading

Severity
Category
Status
Source
Language