Showing 172 of 184 total issues
Function getCodigoNome
has a Cognitive Complexity of 129 (exceeds 5 allowed). Consider refactoring. Open
public function getCodigoNome()
{
$codigo = $this->getCodigo();
if (\Cnab\Banco::BRADESCO == $this->_codigo_banco) {
- 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 getCodigoNome
has 254 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getCodigoNome()
{
$codigo = $this->getCodigo();
if (\Cnab\Banco::BRADESCO == $this->_codigo_banco) {
Method testArquivoBancoDoBrasil240PodeSerCriado
has 243 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testArquivoBancoDoBrasil240PodeSerCriado()
{
$this->markTestIncomplete('A versão do layout foi alterada de 020 para 030, porém não ainda está em beta e não foram feitos testes para a nova versão');
$codigoBanco = \Cnab\Banco::BANCO_DO_BRASIL;
Method testArquivoCaixaCnab240SigcbPodeSerCriado
has 241 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testArquivoCaixaCnab240SigcbPodeSerCriado()
{
$codigoBanco = \Cnab\Banco::CEF;
$cnabFactory = new \Cnab\Factory();
$arquivo = $cnabFactory->createRemessa($codigoBanco, 'cnab240', 'sigcb');
File Detalhe.php
has 493 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Cnab\Retorno\Cnab400;
class Detalhe extends \Cnab\Format\Linha implements \Cnab\Retorno\IDetalhe
File Arquivo.php
has 424 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Cnab\Remessa\Cnab240;
class Arquivo implements \Cnab\Remessa\IArquivo
Function encode
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
public static function encode($value, $format, $options)
{
$m = array();
if (\preg_match(self::REGEX_VALID_FORMAT, $format, $m)) {
if ($m['tipo1'] == 'X' && !$m['tipo2']) {
- 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 testArquivoItauCnab400PodeSerCriado
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testArquivoItauCnab400PodeSerCriado()
{
$codigo_banco = \Cnab\Banco::ITAU;
$arquivo = new \Cnab\Remessa\Cnab400\Arquivo($codigo_banco);
$arquivo->configure(array(
Method insertDetalhe
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function insertDetalhe(array $boleto, $tipo = 'remessa')
{
$dateVencimento = $boleto['data_vencimento'] instanceof \DateTime ? $boleto['data_vencimento'] : new \DateTime($boleto['data_vencimento']);
$dateCadastro = $boleto['data_cadastro'] instanceof \DateTime ? $boleto['data_cadastro'] : new \DateTime($boleto['data_cadastro']);
$dateJurosMora = clone $dateVencimento;
Function insertDetalhe
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
public function insertDetalhe(array $boleto, $tipo = 'remessa')
{
$dateVencimento = $boleto['data_vencimento'] instanceof \DateTime ? $boleto['data_vencimento'] : new \DateTime($boleto['data_vencimento']);
$dateCadastro = $boleto['data_cadastro'] instanceof \DateTime ? $boleto['data_cadastro'] : new \DateTime($boleto['data_cadastro']);
$dateJurosMora = clone $dateVencimento;
- 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 insertDetalhe
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function insertDetalhe(array $boleto, $tipo = 'remessa')
{
$dateVencimento = $boleto['data_vencimento'] instanceof \DateTime ? $boleto['data_vencimento'] : new \DateTime($boleto['data_vencimento']);
$dateCadastro = $boleto['data_cadastro'] instanceof \DateTime ? $boleto['data_cadastro'] : new \DateTime($boleto['data_cadastro']);
Method configure
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function configure(array $params)
{
$banco = \Cnab\Banco::getBanco($this->codigo_banco);
$campos = array(
'data_geracao', 'data_gravacao', 'nome_fantasia', 'razao_social', 'cnpj', 'logradouro', 'numero', 'bairro',
Detalhe
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
class Detalhe extends \Cnab\Format\Linha implements \Cnab\Retorno\IDetalhe
{
public $codigo_banco;
public $arquivo;
Function configure
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function configure(array $params)
{
$banco = \Cnab\Banco::getBanco($this->codigo_banco);
$campos = array(
'data_geracao', 'data_gravacao', 'nome_fantasia', 'razao_social', 'cnpj', 'logradouro', 'numero', 'bairro',
- 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
Function insertDetalhe
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function insertDetalhe(array $boleto, $tipo = 'remessa')
{
$dateVencimento = $boleto['data_vencimento'] instanceof \DateTime ? $boleto['data_vencimento'] : new \DateTime($boleto['data_vencimento']);
$dateCadastro = $boleto['data_cadastro'] instanceof \DateTime ? $boleto['data_cadastro'] : new \DateTime($boleto['data_cadastro']);
- 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
Detalhe
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class Detalhe extends \Cnab\Format\Linha implements \Cnab\Retorno\IDetalhe
{
public $_codigo_banco;
public function __construct(\Cnab\Retorno\IArquivo $arquivo)
Function identifyFile
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function identifyFile($filename)
{
if (!file_exists($filename)) {
throw new \Exception('file dont exists: '.$filename);
}
- 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
File Arquivo.php
has 294 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Cnab\Remessa\Cnab400;
class Arquivo implements \Cnab\Remessa\IArquivo
Function __construct
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($codigo_banco, $filename, $layoutVersao = null)
{
$this->filename = $filename;
$this->layoutVersao = $layoutVersao;
- 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 configure
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function configure(array $params)
{
$campos = array(
'data_geracao', 'data_gravacao', 'nome_fantasia', 'razao_social', 'cnpj', 'logradouro', 'numero', 'bairro',
'cidade', 'uf', 'cep', 'agencia', 'conta'