Showing 17 of 93 total issues
Function encode
has a Cognitive Complexity of 55 (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 testRemessaPagamentosOk
has 147 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testRemessaPagamentosOk()
{
$remessaLayout = new Layout(__DIR__.'/../../../config/febraban/cnab240/pagamentos.yml');
$remessa = new Remessa($remessaLayout);
$this->assertInstanceOf('CnabParser\Model\Remessa', $remessa);
Method testJsonSerializeRemessaOk
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testJsonSerializeRemessaOk()
{
$remessaLayout = new Layout(__DIR__.'/../../../config/itau/cnab240/cobranca.yml');
$remessa = new Remessa($remessaLayout);
$this->assertInstanceOf('CnabParser\Model\Remessa', $remessa);
Method testRemessaOk
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testRemessaOk()
{
$remessaLayout = new Layout(__DIR__.'/../../../config/itau/cnab240/cobranca.yml');
$remessa = new Remessa($remessaLayout);
$this->assertInstanceOf('CnabParser\Model\Remessa', $remessa);
Method testRemessaOk
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testRemessaOk()
{
$remessaLayout = new Layout(__DIR__.'/../../../config/cef/cnab400/cobranca_sigcb.yml');
$remessa = new Remessa($remessaLayout);
$this->assertInstanceOf('CnabParser\Model\Remessa', $remessa);
Function decode
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public static function decode($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 encode
has 61 lines of code (exceeds 25 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']) {
Method decodeLotesCnab240
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function decodeLotesCnab240()
{
$defTipoRegistro = array(
'pos' => array(8, 8),
'picture' => '9(1)',
Method testRetornoGenerateModelSuccess
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testRetornoGenerateModelSuccess()
{
$layout = new Layout(__DIR__.'/../../../config/itau/cnab400/cobranca.yml');
$retornoFile = new RetornoFile($layout, __DIR__.'/../../data/cobranca-itau-cnab400.ret');
Method testRetornoGenerateModelSuccess
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testRetornoGenerateModelSuccess()
{
$layout = new Layout(__DIR__.'/../../../config/itau/cnab240/cobranca.yml');
$retornoFile = new RetornoFile($layout, __DIR__.'/../../data/cobranca-itau-cnab240.ret');
Method decodeLotesCnab400
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function decodeLotesCnab400()
{
$defTipoRegistro = array(
'pos' => array(1, 1),
'picture' => '9(1)',
Method decode
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function decode($value, $format, $options)
{
$m = array();
if (preg_match(self::REGEX_VALID_FORMAT, $format, $m)) {
if ($m['tipo1'] == 'X' && !$m['tipo2']) {
Function decodeLotesCnab240
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function decodeLotesCnab240()
{
$defTipoRegistro = array(
'pos' => array(8, 8),
'picture' => '9(1)',
- 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 novoDetalhe
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function novoDetalhe(array $excetoSegmentos = array())
{
$detalhe = new \stdClass;
if (isset($this->layout['detalhes'])) {
foreach ($this->layout['detalhes'] as $segmento => $segmentoDefinitions) {
- 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 decodeLotesCnab400
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function decodeLotesCnab400()
{
$defTipoRegistro = array(
'pos' => array(1, 1),
'picture' => '9(1)',
- 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 __construct
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(Layout $layout)
{
parent::__construct($layout);
$remessaLayout = $this->layout->getRemessaLayout();
- 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 __construct
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(array $layout, $sequencial = 1)
{
$this->layout = $layout;
$this->sequencial = $sequencial;
- 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"