Showing 15 of 15 total issues
Function getPossibleCombinations
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function getPossibleCombinations(array $elements, int $combinationsLevel): array
{
$baseCount = \count($elements);
$result = [];
- 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 getBaseImplementation
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getBaseImplementation(ContainerBuilder $container, string $serviceId, array $tag): Definition
{
// Connection with this name already exists - each connection name has to be unique
if ($container->hasDefinition('squirrel.connection.' . $tag['connectionName'])) {
throw new \LogicException(
Function sanitizeQuery
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function sanitizeQuery(string $connectionName, array $query): array
{
$query['explainable'] = true;
$query['params'] ??= array();
if (!\is_array($query['params'])) {
- 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 getGroupedQueries
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getGroupedQueries(): array
{
if ($this->groupedQueries !== null) {
return $this->groupedQueries;
}
Method replaceQueryParameters
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function replaceQueryParameters(string $query, array|Data $parameters): string
{
if ($parameters instanceof Data) {
$parameters = $parameters->getValue(true);
Function getGroupedQueries
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getGroupedQueries(): array
{
if ($this->groupedQueries !== null) {
return $this->groupedQueries;
}
- 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 minifyQuery
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function minifyQuery(string $query): string
{
$result = '';
$keywords = [];
$required = 1;
Method getPossibleCombinations
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getPossibleCombinations(array $elements, int $combinationsLevel): array
{
$baseCount = \count($elements);
$result = [];
Method createConnectionFromTag
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function createConnectionFromTag(
ContainerBuilder $container,
string $id,
array $tag,
array $taggedServicesOrdered,
Function sortLayers
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function sortLayers(array $taggedServices): array
{
// Ordered services according to priority
$taggedServicesOrdered = [];
- 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 escapeFunction
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function escapeFunction(mixed $parameter): string
{
$result = $parameter;
switch (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 getBaseImplementation
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function getBaseImplementation(ContainerBuilder $container, string $serviceId, array $tag): Definition
{
// Connection with this name already exists - each connection name has to be unique
if ($container->hasDefinition('squirrel.connection.' . $tag['connectionName'])) {
throw new \LogicException(
- 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 shrinkParameters
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function shrinkParameters(array $parameters, array $combination): string
{
\array_shift($parameters);
$result = '';
- 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 minifyQuery
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function minifyQuery(string $query): string
{
$result = '';
$keywords = [];
$required = 1;
- 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 sanitizeParam
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function sanitizeParam(mixed $var): array
{
if (\is_object($var)) {
$className = \get_class($var);
- 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"