Showing 29 of 197 total issues
File BlameableTrait.php
has 379 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* _ __ __ _____ _____ ___ ____ _____
* | | / // // ___//_ _// || __||_ _|
Function register
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function register($associatedModels = [], $authRoles = [])
{
if (!$this->isNewRecord) {
return false;
}
- 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
File SelfBlameableTrait.php
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* _ __ __ _____ _____ ___ ____ _____
* | | / // // ___//_ _// || __||_ _|
File UserRelationTrait.php
has 275 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* _ __ __ _____ _____ ___ ____ _____
* | | / // // ___//_ _// || __||_ _|
Method register
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function register($associatedModels = [], $authRoles = [])
{
if (!$this->isNewRecord) {
return false;
}
Function getIpAddress
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getIpAddress()
{
if (!$this->enableIP) {
return null;
}
- 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 updateChildren
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function updateChildren($value = false)
{
$children = $this->getOldChildren();
if (empty($children)) {
return 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
Method getIdRules
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getIdRules()
{
if ($this->idAttribute == false) {
return [];
}
Method updateChildren
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateChildren($value = false)
{
$children = $this->getOldChildren();
if (empty($children)) {
return true;
Function getIdRules
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getIdRules()
{
if ($this->idAttribute == false) {
return [];
}
- 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 getContentRules
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getContentRules()
{
if (!$this->contentAttribute) {
return [];
}
Function addOrCreateBlame
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function addOrCreateBlame(&$blame = null, $user = null)
{
if (!is_string($this->multiBlamesClass)) {
throw new InvalidConfigException('$multiBlamesClass must be specified if you want to use multiple blameable features.');
}
- 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 resetConfirmation
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function resetConfirmation()
{
$contentAttribute = $this->contentAttribute;
if (!$contentAttribute) {
return;
- 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 setIpAddress
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function setIpAddress($ipAddress)
{
if (!$ipAddress || !$this->enableIP) {
return null;
}
- 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 getContentRules
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getContentRules()
{
if (!$this->contentAttribute) {
return [];
}
- 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 gets
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function gets($keys = null)
{
$noInitModel = static::buildNoInitModel();
$query = static::find();
if ($keys == null) {
- 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 deleteChildren
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function deleteChildren()
{
$children = $this->children;
if (empty($children)) {
return 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 buildRelation
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected static function buildRelation($user, $other)
{
$relationQuery = static::find()->initiators($user)->recipients($other);
$noInit = $relationQuery->noInitModel;
$relation = $relationQuery->one();
- 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 getRange
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getRange()
{
$rangeAttribute = $this->rangeAttribute;
if (!is_string($rangeAttribute)) {
return null;
- 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 onUpdateChildren
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function onUpdateChildren($event)
{
$sender = $event->sender;
if (!is_string($sender->parentAttribute)) {
return 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"