Showing 16 of 54 total issues
Function parseNumberPlan
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
private function parseNumberPlan(string $plan)
{
if (preg_match("/(?'prefix'[\d]*)(\((?'suffix'[\d\-,]*)\))?/", strval($plan), $f)) {
$answer = [];
$prefix = $f['prefix'];
- 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 isValid
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function isValid($checkedValue, bool $asEx = false): bool
{
try {
static::isValidType($checkedValue, static::TYPE_STRING, true);
if (!preg_match('/^[A-NPR-Z]{3}[0-9]{6}$/', $checkedValue)) {
Method isValidType
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function isValidType($checkedValue, string $requiredType, bool $asEx = false)
{
$requiredType = strtolower($requiredType);
switch ($requiredType) {
Function isValidType
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected static function isValidType($checkedValue, string $requiredType, bool $asEx = false)
{
$requiredType = strtolower($requiredType);
switch ($requiredType) {
- 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 parseNumberPlan
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function parseNumberPlan(string $plan)
{
if (preg_match("/(?'prefix'[\d]*)(\((?'suffix'[\d\-,]*)\))?/", strval($plan), $f)) {
$answer = [];
$prefix = $f['prefix'];
Function isValid
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function isValid($checkedValue, bool $asEx = false): bool
{
try {
static::isValidType($checkedValue, static::TYPE_STRING, true);
- 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 isValid
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function isValid($checkedValue, bool $asEx = false): bool
{
try {
static::isValidType($checkedValue, static::TYPE_STRING, true);
if (strlen($checkedValue) !== 9 && strlen($checkedValue) !== 11) {
- 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 getRegion
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getRegion()
{
$sRegion = null;
if ($this->isMobile()) {
$nr = $this->getNationalFormat();
- 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 isValid
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function isValid($checkedValue, bool $asEx = false): bool
{
try {
static::isValidType($checkedValue, static::TYPE_STRING, true);
- 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 isValid
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function isValid($checkedValue, bool $asEx = false): bool
{
try {
if (is_int($checkedValue)) {
$sIp = long2ip($checkedValue);
- 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 isValid
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function isValid($checkedValue, bool $asEx = false): bool
{
try {
static::isValidType($checkedValue, static::TYPE_STRING, true);
$checkedValue = static::clean($checkedValue);
- 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 getUkeMobilePlan
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getUkeMobilePlan()
{
if (empty($this->ukeMobilePlan)) {
$oXml = new \SimpleXMLElement(file_get_contents(__DIR__ . '/../Databases/T2-PLMN_T9-MVNO.xml'));
- 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 isValid
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function isValid($checkedValue, bool $asEx = false): bool
{
try {
static::isValidType($checkedValue, static::TYPE_STRING, true);
- 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 isValid
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function isValid($checkedValue, bool $asEx = false): bool
{
try {
static::isValidType($checkedValue, static::TYPE_STRING, true);
if (!preg_match('/^[A-NPR-Z]{3}[0-9]{6}$/', $checkedValue)) {
- 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 parseBirthDate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function parseBirthDate()
{
$inYear = intval($this->checkedValue [0] . $this->checkedValue [1]);
$inMonth = intval($this->checkedValue [2] . $this->checkedValue [3]);
$inDay = intval($this->checkedValue [4] . $this->checkedValue [5]);
- 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 isValid
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function isValid($checkedValue, bool $asEx = false): bool
{
try {
static::isValidType($checkedValue, static::TYPE_STRING, true);
- 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"