Showing 12 of 21 total issues
DomainModel
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
class DomainModel
{
/**
* @var int|null
*/
DomainRecordModel
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class DomainRecordModel
{
const TYPE_A = 'A';
const TYPE_AAAA = 'AAAA';
const TYPE_NS = 'NS';
TypeModel
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class TypeModel
{
const MEMORY_CLASS_STANDARD = 'standard';
const MEMORY_CLASS_HIGH = 'highmem';
File DomainModel.php
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* iDimensionz/{linode-api-v4}
* DomainModel.php
*
Function isValidCondition
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
protected function isValidCondition($condition)
{
$isValidCondition = false;
if ($condition instanceof FilterConditionAbstract) {
if ($condition instanceof FilterConditionFilter) {
- 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 toArray
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function toArray(): array
{
$data = [];
$domain = $this->getDomainName();
if (!is_null($domain)) {
Method toArray
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function toArray(): array
{
$data = [];
$type = $this->getType();
if (!is_null($type)) {
Function toArray
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function toArray(): array
{
$data = [];
$domain = $this->getDomainName();
if (!is_null($domain)) {
- 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 isValidCondition
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function isValidCondition($condition)
{
$isValidCondition = false;
if ($condition instanceof FilterConditionAbstract) {
if ($condition instanceof FilterConditionFilter) {
Function toArray
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function toArray(): array
{
$data = [];
$type = $this->getType();
if (!is_null($type)) {
- 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 jsonSerialize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function jsonSerialize()
{
$returnData = [];
$conditions = $this->getConditions();
$data = [];
- 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 setValue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function setValue($value)
{
$operatorTypes = $this->getValueOperatorTypes();
$key = $this->getField();
// Make sure the value is the correct type for this operator.
- 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"