Crate
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class Crate extends Object implements ICrate {
/**
* @var ISchema
*/
protected $schema;
- Create a ticketCreate a ticket
Function push
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function push(array $push, bool $strict = true): ICrate {
if ($strict && ($diff = array_diff(array_keys($push), array_keys($this->propertyList))) !== []) {
throw new CrateException(sprintf('Setting unknown values [%s] to the crate [%s].', implode(', ', $diff), $this->schema->getSchemaName()));
}
foreach ($push as $property => $value) {
- Read upRead up
- Create a ticketCreate a ticket
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 put
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function put(array $put, bool $strict = true): ICrate {
if ($strict && ($diff = array_diff(array_keys($put), array_keys($this->propertyList))) !== []) {
throw new CrateException(sprintf('Setting unknown values [%s] to the crate [%s].', implode(', ', $diff), $this->schema->getSchemaName()));
}
foreach ($put as $property => $value) {
- Read upRead up
- Create a ticketCreate a ticket
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 getIdentifierList
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getIdentifierList(): array {
if ($this->identifierList === null) {
$this->identifierList = [];
foreach ($this->propertyList as $property) {
if ($property->getSchemaProperty()->isIdentifier()) {
- Read upRead up
- Create a ticketCreate a ticket
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 commit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function commit(callable $callback = null): ICrate {
if ($callback === null && $this->commit === null) {
throw new CryptException(sprintf('Commit is not available on crate [%s]. It has to be set before calling.', $this->schema->getSchemaName()));
}
if ($callback === null) {
- Read upRead up
- Create a ticketCreate a ticket
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"