Config
has 45 functions (exceeds 20 allowed). Consider refactoring. Open
class Config extends BaseObject implements ConfigInterface
{
private $_model;
/**
File Config.php
has 363 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace luya\admin\ngrest;
use luya\admin\Module;
Function getExtraFields
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function getExtraFields()
{
if ($this->_extraFields === null) {
$extraFields = [];
foreach ($this->getConfig() as $pointer => $fields) {
- 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 getPlugins
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function getPlugins()
{
if ($this->_plugins === null) {
$plugins = [];
foreach ($this->getConfig() as $pointer => $fields) {
- 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 appendFieldOption
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function appendFieldOption($fieldName, $optionKey, $optionValue)
{
foreach ($this->getConfig() as $pointer => $fields) {
if (is_array($fields)) {
foreach ($fields as $field) {
- 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 onFinish
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function onFinish()
{
foreach ($this->getPrimaryKey() as $pk) {
if (!$this->hasField('list', $pk)) {
$alias = $pk;
- 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 getRelations
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getRelations()
{
if ($this->_relations === null) {
// ensure relations are made not on composite table.
if ($this->model->ngRestRelations() && (is_countable($this->getPrimaryKey()) ? count($this->getPrimaryKey()) : 0) > 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"