Showing 19 of 23 total issues
Method _prepareParts
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _prepareParts()
{
//
$headerSize = self::HEADER_SIZE;
$max = Helper::getLimit('normal');
PDU
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class PDU {
/**
* Service Centre Address
* @var PDU\SCA
Function getValue
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function getValue()
{
$this->_encodeGroup = 0x00;
// set data encoding, from alphabet and message class
- 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 parse
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function parse($isAddress = TRUE)
{
$SCA = new self($isAddress);
$size = hexdec(PDU::getPduSubstr(2));
Function __toString
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function __toString()
{
// get pdu type
$type = $this->getPdu()->getType();
- 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 getValue
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getValue()
{
$this->_encodeGroup = 0x00;
// set data encoding, from alphabet and message class
Method parse
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function parse(Data $data)
{
$alphabet = $data->getPdu()->getDcs()->getTextAlphabet();
$header = NULL;
$length = $data->getPdu()->getUdl() * ($alphabet == PDU\DCS::ALPHABET_UCS2 ? 4 : 2);
Function parse
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function parse()
{
$DCS = new self();
$byte = hexdec(PDU::getPduSubstr(2));
- 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 parse
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function parse()
{
$DCS = new self();
$byte = hexdec(PDU::getPduSubstr(2));
Function _prepareParts
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function _prepareParts()
{
//
$headerSize = self::HEADER_SIZE;
$max = Helper::getLimit('normal');
- 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 parse
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function parse($isAddress = TRUE)
{
$SCA = new self($isAddress);
$size = hexdec(PDU::getPduSubstr(2));
- 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 parse
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function parse(Submit $pdu)
{
$vp = new self($pdu);
switch($pdu->getType()->getVpf()){
- 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 sprintf("%02X", ($weeks > 63 ? 63 : $weeks)+192);
Avoid too many return
statements within this method. Open
case 0x0E: return "c";
Avoid too many return
statements within this method. Open
default: return $letter;
Avoid too many return
statements within this method. Open
return "";
Avoid too many return
statements within this method. Open
default: return $letter;
Avoid too many return
statements within this method. Open
case "c": return 'E';
Function __toString
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function __toString()
{
$PDU = sprintf("%02X", $this->getSize());
if($this->getSize()){
- 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"