Showing 93 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)',
Avoid excessively long variable names like $primeiroCodigoSegmentoLayout. Keep variable name length under 20. Open
$primeiroCodigoSegmentoLayout = $this->layout->getPrimeiroCodigoSegmentoRetorno();
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $ultimoCodigoSegmentoLayout. Keep variable name length under 20. Open
$ultimoCodigoSegmentoLayout = $this->layout->getUltimoCodigoSegmentoRetorno();
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $primeiroCodigoSegmentoLayout. Keep variable name length under 20. Open
$primeiroCodigoSegmentoLayout = $this->layout->getPrimeiroCodigoSegmentoRetorno();
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $ultimoCodigoSegmentoLayout. Keep variable name length under 20. Open
$ultimoCodigoSegmentoLayout = $this->layout->getUltimoCodigoSegmentoRetorno();
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $proximoCodigoSegmento. Keep variable name length under 20. Open
$proximoCodigoSegmento = $proximaLinha->obterValorCampo($defCodigoSegmento);
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $proximoCodigoSegmento. Keep variable name length under 20. Open
$proximoCodigoSegmento = $proximaLinha->obterValorCampo($defCodigoSegmento);
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $linhaTrailerArquivoStr. Keep variable name length under 20. Open
$linhaTrailerArquivoStr = $this->linhas[count($this->linhas) - 1];
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
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"