Showing 9 of 13 total issues
Function all
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function all($where, int $limit = 0, int $offset = 0, array $orderBy = [], array $fields = [])
{
$items = [];
foreach (self::$data as $item) {
- 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 one
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function one($where, int $offset = 0, array $fields = [])
{
foreach (self::$data as $item) {
$equal = true;
foreach ($where as $field => $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"
Further reading
Method configure
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configure()
{
$this
->setName('uninstall')
->setAliases(['u'])
Method prepareContainer
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function prepareContainer(InputInterface $input, OutputInterface &$output): void
{
$containerRewrite = $input->getOption(static::OPTION__CONTAINER_REWRITE);
$lockContainerPath = getenv('EXTAS__CONTAINER_PATH_STORAGE_LOCK')
Method configure
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configure()
{
$this
// the name of the command (the part after "bin/console")
->setName('install')
Function isTheSame
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function isTheSame(IItem $existed, array $current): bool
{
$theSame = false;
$stage = IStageItemSame::NAME . '.' . $this->getDottedName();
- 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 all
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function all($where, int $limit = 0, int $offset = 0, array $orderBy = [], array $fields = [])
Function delete
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function delete($where, $item = null): int
{
$byUID = $this->getDataByUID();
$deleted = 0;
- 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 prepareContainer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function prepareContainer(InputInterface $input, OutputInterface &$output): void
{
$containerRewrite = $input->getOption(static::OPTION__CONTAINER_REWRITE);
$lockContainerPath = getenv('EXTAS__CONTAINER_PATH_STORAGE_LOCK')
- 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"