Showing 13 of 13 total issues
Function isQueryApplicableToItem
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function isQueryApplicableToItem(array $query, $item): bool
{
$applicable = true;
foreach ($query as $field => $value) {
if (str_contains($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
Method configure
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configure()
{
$this
->setName('install')
->setAliases(['i'])
Method getCodeForBaseInfo
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getCodeForBaseInfo(string $ns, string $tableName, array $tableConfig, array $driverConfig): array
{
$this->placeholders = array_merge($this->placeholders, [
'{namespace}',
'{uc_table_name}',
Function installTable
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function installTable(string $tableName, array $entities): void
{
/**
* @var IRepository $repo
*/
- 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 run
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function run(string $appFilename, string $packagesFilename, string $path): array
{
$finder = new Finder();
$finder->name($packagesFilename);
$extasPackages = [];
- 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 install
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function install(string $pathSave, string $pathTemplate): void
{
$drivers = $this->app[static::FIELD__DRIVERS] ?? [];
if (empty($drivers)) {
- 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 installItems
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function installItems(string $tableName, string $itemClass): void
{
/**
* @var IRepository $repo
*/
- 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 findAll
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function findAll(array $query = [], int $limit = 0, int $offset = 0, array $orderBy = [], array $fields = [])
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 = []);
Method findAll
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
array $query = [],
int $limit = 0,
int $offset = 0,
array $orderBy = [],
array $fields = []
Function findOne
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function findOne(array $query = [], int $offset = 0, array $fields = [])
{
$found = 0;
$data = $this->getTableData();
- 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 applyValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function applyValue($entity, $fields): void
{
if (is_object($fields) && method_exists($fields, static::METHOD__TO_ARRAY)) {
$fields = $fields->__toArray();
}
- 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 update
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function update($item): bool
{
$pk = $this->getPk();
$data = $this->getTableData();
- 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"