andersondanilo/CnabPHP

View on GitHub

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) {
Severity: Minor
Found in src/Cnab/Retorno/Cnab400/Detalhe.php - About 2 days to fix

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) {
Severity: Major
Found in src/Cnab/Retorno/Cnab400/Detalhe.php - About 1 day to fix

    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;
    Severity: Major
    Found in tests/Cnab/Remessa/Cnab240/BancoDoBrasilTest.php - About 1 day to fix

      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');
      Severity: Major
      Found in tests/Cnab/Remessa/Cnab240/CaixaTest.php - About 1 day to fix

        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
        Severity: Minor
        Found in src/Cnab/Retorno/Cnab400/Detalhe.php - About 7 hrs to fix

          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
          Severity: Minor
          Found in src/Cnab/Remessa/Cnab240/Arquivo.php - About 6 hrs to fix

            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']) {
            Severity: Minor
            Found in src/Cnab/Format/Picture.php - About 5 hrs to fix

            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(
            Severity: Major
            Found in tests/Cnab/Remessa/Cnab400/ArquivoTest.php - About 5 hrs to fix

              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;
              Severity: Major
              Found in src/Cnab/Remessa/Cnab240/Arquivo.php - About 4 hrs to fix

                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;
                Severity: Minor
                Found in src/Cnab/Remessa/Cnab240/Arquivo.php - About 4 hrs to fix

                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']);
                
                
                Severity: Major
                Found in src/Cnab/Remessa/Cnab400/Arquivo.php - About 4 hrs to fix

                  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',
                  Severity: Major
                  Found in src/Cnab/Remessa/Cnab240/Arquivo.php - About 4 hrs to fix

                    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;
                    
                    
                    Severity: Minor
                    Found in src/Cnab/Retorno/Cnab240/Detalhe.php - About 4 hrs to fix

                      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',
                      Severity: Minor
                      Found in src/Cnab/Remessa/Cnab240/Arquivo.php - About 3 hrs to fix

                      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']);
                      
                      
                      Severity: Minor
                      Found in src/Cnab/Remessa/Cnab400/Arquivo.php - About 3 hrs to fix

                      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)
                      Severity: Minor
                      Found in src/Cnab/Retorno/Cnab400/Detalhe.php - About 3 hrs to fix

                        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);
                                }
                        Severity: Minor
                        Found in src/Cnab/Format/Identifier.php - About 3 hrs to fix

                        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
                        Severity: Minor
                        Found in src/Cnab/Remessa/Cnab400/Arquivo.php - About 3 hrs to fix

                          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;
                          
                          
                          Severity: Minor
                          Found in src/Cnab/Retorno/Cnab240/Arquivo.php - About 2 hrs to fix

                          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'
                          Severity: Major
                          Found in src/Cnab/Remessa/Cnab400/Arquivo.php - About 2 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language