andersondanilo/CnabPHP

View on GitHub

Showing 172 of 184 total issues

Method getBanco has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function getBanco($codigo)
    {
        if ($codigo == self::BANCO_DO_BRASIL) {
            return array(
                'codigo_do_banco' => self::BANCO_DO_BRASIL,
Severity: Minor
Found in src/Cnab/Banco.php - About 1 hr to fix

    Function getText has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getText()
        {
            $numero_sequencial_lote = 1;
            $qtde_registro_lote = 2; // header e trailer = 2
            $qtde_titulo_cobranca_simples = 0;
    Severity: Minor
    Found in src/Cnab/Remessa/Cnab240/Arquivo.php - About 1 hr 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 getAlegacaoPagador has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getAlegacaoPagador()
        {
            // @TODO: implementar funçao getAlegacaoPagador nos outros bancos
            if ($this->_codigo_banco == 341) {
                if ($this->getCodigo() == 25) {
    Severity: Minor
    Found in src/Cnab/Retorno/Cnab400/Detalhe.php - About 1 hr 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 addField has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function addField($nome, $pos_start, $pos_end, $format, $default, $options)
    Severity: Minor
    Found in src/Cnab/Format/Linha.php - About 45 mins to fix

      Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function __construct(Linha $linha, $nome, $format, $pos_start, $pos_end, $options)
      Severity: Minor
      Found in src/Cnab/Format/Field.php - About 45 mins to fix

        Function createRetorno has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public function createRetorno($filename)
            {
                $identifier = new Format\Identifier();
        
                if (empty($filename)) {
        Severity: Minor
        Found in src/Cnab/Factory.php - About 45 mins 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 mod11 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function mod11($num, $base = 9, $r = 0)
            {
                $soma = 0;
                $fator = 2;
                /* Separacao dos numeros */
        Severity: Minor
        Found in src/Cnab/Remessa/Cnab240/Arquivo.php - About 35 mins 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 insertSegmento has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function insertSegmento($linha)
            {
                $codigo_segmento = strtoupper(substr($linha, 13, 1));
                $segmento = null;
                if ('T' == $codigo_segmento) {
        Severity: Minor
        Found in src/Cnab/Retorno/Cnab240/Lote.php - About 35 mins 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 loadArray has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function loadArray(Linha $cnabLinha, $array)
            {
                $this->validateArray($array);
        
                $keys = array('generic');
        Severity: Minor
        Found in src/Cnab/Format/YamlLoad.php - About 35 mins 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

        Avoid too many return statements within this method.
        Open

                        return 'Abatimento Concedido';
        Severity: Major
        Found in src/Cnab/Retorno/Cnab400/Detalhe.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return 'LIQUIDAÇÃO NORMAL';
          Severity: Major
          Found in src/Cnab/Retorno/Cnab400/Detalhe.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return 'CUSTAS DE EDITAL';
            Severity: Major
            Found in src/Cnab/Retorno/Cnab400/Detalhe.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              return 'TARIFA DE OCORRÊNCIAS';
              Severity: Major
              Found in src/Cnab/Retorno/Cnab400/Detalhe.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return 'ENTRADA REJEITADA CARNÊ (NOTA 20 – TABELA 1)';
                Severity: Major
                Found in src/Cnab/Retorno/Cnab400/Detalhe.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                  return 'Acerto dos dados do rateio de Crédito';
                  Severity: Major
                  Found in src/Cnab/Retorno/Cnab400/Detalhe.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                    return 'Alteração da Opção de Protesto para Devolução';
                    Severity: Major
                    Found in src/Cnab/Retorno/Cnab400/Detalhe.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                      return 'Liquidação';
                      Severity: Major
                      Found in src/Cnab/Retorno/Cnab400/Detalhe.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        return 'Baixa por Protesto';
                        Severity: Major
                        Found in src/Cnab/Retorno/Cnab400/Detalhe.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                          return 'ABATIMENTO CONCEDIDO ';
                          Severity: Major
                          Found in src/Cnab/Retorno/Cnab400/Detalhe.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                            return 'BAIXAS REJEITADAS (NOTA 20 - TABELA 4)';
                            Severity: Major
                            Found in src/Cnab/Retorno/Cnab400/Detalhe.php - About 30 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language