File Data.php
has 371 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* 2007-2016 [PagSeguro Internet Ltda.]
*
* NOTICE OF LICENSE
Function getTitleCodePaymentMethod
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public static function getTitleCodePaymentMethod($code)
{
if (!is_null($code)) {
switch ($code) {
case 101:
- 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 getTitleCodePaymentMethod
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getTitleCodePaymentMethod($code)
{
if (!is_null($code)) {
switch ($code) {
case 101:
Function getTransactionTypeName
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static function getTransactionTypeName($transactionTypeCode)
{
if ($transactionTypeCode) {
switch ($transactionTypeCode) {
case 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
Method getTransactionTypeName
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getTransactionTypeName($transactionTypeCode)
{
if ($transactionTypeCode) {
switch ($transactionTypeCode) {
case 1:
Function getPaymentStatusToString
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function getPaymentStatusToString($key)
{
if (array_key_exists($key, self::$statusList)) {
switch ($key) {
- 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 getPaymentStatusToString
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getPaymentStatusToString($key)
{
if (array_key_exists($key, self::$statusList)) {
switch ($key) {
Function sortData
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private static function sortData($text)
{
if (preg_match('/[-,\\n]/', $text)) {
$broken = preg_split('/[-,\\n]/', $text);
for ($i = 0; $i < strlen($broken[0]); $i++) {
- 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 getTitleTypePaymentMethod
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function getTitleTypePaymentMethod($type)
{
if (!is_null($type)) {
switch ($type) {
case 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
Avoid too many return
statements within this method. Open
return 'Disponível';
Avoid too many return
statements within this method. Open
return 'Devolvida';
Avoid too many return
statements within this method. Open
return 'Validador';
Avoid too many return
statements within this method. Open
return 'Cartão de crédito Cabal';
Avoid too many return
statements within this method. Open
return 'Cartão de crédito Mais!';
Avoid too many return
statements within this method. Open
return 'Débito online Itaú';
Avoid too many return
statements within this method. Open
return 'Pagamento pré aprovado';
Avoid too many return
statements within this method. Open
return 'Cartão de crédito VALECARD';
Avoid too many return
statements within this method. Open
return 'Cartão de crédito Elo';
Avoid too many return
statements within this method. Open
return 'Cartão de crédito BrasilCard';
Avoid too many return
statements within this method. Open
return 'Débito online Banrisul';
Avoid too many return
statements within this method. Open
return 'Saldo PagSeguro';
Avoid too many return
statements within this method. Open
return $code;
Avoid too many return
statements within this method. Open
return 'Cobrança';
Avoid too many return
statements within this method. Open
return 'Operacional';
Avoid too many return
statements within this method. Open
return 'Depósito em conta';
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return 'Cartão de crédito Sorocred';
Avoid too many return
statements within this method. Open
return 'Cartão de crédito Up Policard';
Avoid too many return
statements within this method. Open
return 'Cartão de crédito Banese Card';
Avoid too many return
statements within this method. Open
return 'Débito online Banco do Brasil';
Avoid too many return
statements within this method. Open
return 'Bônus';
Avoid too many return
statements within this method. Open
return 'Cartão de crédito Hipercard';
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return 'Repasse de bônus';
Avoid too many return
statements within this method. Open
return 'Doação pública';
Avoid too many return
statements within this method. Open
return 'Cartão de crédito FORTBRASIL';
Avoid too many return
statements within this method. Open
return 'Cartão de crédito GRANDCARD';
Avoid too many return
statements within this method. Open
return 'Cartão de crédito Aura';
Avoid too many return
statements within this method. Open
return 'Débito online Bradesco';
Avoid too many return
statements within this method. Open
return 'Em disputa';
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return 'Cartão de crédito PersonalCard';
Avoid too many return
statements within this method. Open
return 'Boleto Bradesco';
Avoid too many return
statements within this method. Open
return 'Boleto Santander';
Avoid too many return
statements within this method. Open
return 'Cancelada';
Avoid too many return
statements within this method. Open
return 'Chargeback Debitado';
Avoid too many return
statements within this method. Open
return 'Campanha bônus';
Avoid too many return
statements within this method. Open
return 'Depósito em conta - Banco do Brasil';
Avoid too many return
statements within this method. Open
return 'Doação';
Avoid too many return
statements within this method. Open
return 'Em Contestação';
Avoid too many return
statements within this method. Open
return 'Secundária';
Avoid too many return
statements within this method. Open
return $transactionTypeCode;
Avoid too many return
statements within this method. Open
return $type;