Showing 8 of 8 total issues
Repository
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class Repository extends Component implements Contracts\Repository {
use TransactionAccess;
/**
* @var array Stores errors which could occur during save process
*/
EntitiesRepository
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class EntitiesRepository extends Base\Repository {
/**
* @var string data mapper class name. Required to map data from record to entity. Change it in {@link init()} method
* if you need custom mapper. But be aware - data mapper is internal class and it is strongly advised to not
* touch this property.
Record
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class Record extends ActiveRecord implements Contracts\Record, ContainerAware, ServiceLocatorAware, LoggerAware, EntityDataSource {
use LoggerAccess;
use ServiceLocatorAccess;
use ContainerAccess;
use StaticSelfAccess;
Function setFlash
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function setFlash($message, $params = []): void {
if (!$this->useFlashMessages || empty($message)) {
return;
}
$session = $this->session;
- 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 getPropertyFromDataSource
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function getPropertyFromDataSource($propertyName) {
$property = $this->canGet($propertyName) ? $this->dataSource->$propertyName : null;
if ($property instanceof Record && ($repository = $this->findRepositoryForRecord($property))) {
$property = $repository->createEntityFromSource($property);
- 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 updateActionDefinition
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function updateActionDefinition($name, $definition) {
if (is_string($definition) || is_object($definition)) {
$this->_actions[$name] = $definition;
} elseif (is_array($definition)) {
if ($this->isDynamicActionDefined($name) && is_array($this->_actions[$name])) {
- 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 convertToEntityAttributes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function convertToEntityAttributes(): array {
$entityAttributesMap = $this->getEntityAttributesMap();
if (empty($entityAttributesMap)) {
return $this->getAttributes();
}
- 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 current
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function current() {
$iterator = $this->getQueryResultIterator();
$value = $iterator->current();
if ($iterator->each && $value instanceof Contracts\Record) {
$entity = $this->getRepository()->createEntityFromSource($value);
- 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"