Showing 14 of 24 total issues
MysqlQueryBuilder
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class MysqlQueryBuilder implements QueryBuilderInterface
{
/**
* @var IndexInterface
*/
Function determineSnippetLocation
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function determineSnippetLocation(array $locations, int $relativePosition): int
{
$locationsCount = count($locations);
$smallestDiff = PHP_INT_MAX;
- 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 createIndexTables
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function createIndexTables(): void
{
$result = $this->connection->query('SHOW TABLES');
$tables = $result->fetchAll(\PDO::FETCH_COLUMN);
Method fulltextMatchResult
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fulltextMatchResult($searchword, $resultTokens = 200, $ellipsis = '...', $beginModifier = '<b>', $endModifier = '</b>'): string
{
$searchword = trim($searchword);
$query = $this->buildQueryString();
Function likeAnyMatch
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function likeAnyMatch(string $propertyName, array $propertyValues): QueryBuilderInterface
{
if ($propertyValues === null || empty($propertyValues) || $propertyValues[0] === null) {
return $this;
}
- 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 anyMatch
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function anyMatch(string $propertyName, array $propertyValues): QueryBuilderInterface
{
if ($propertyValues === null || empty($propertyValues) || $propertyValues[0] === null) {
return $this;
}
- 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 anyMatch
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function anyMatch(string $propertyName, array $propertyValues): QueryBuilderInterface
{
if ($propertyValues === null || empty($propertyValues) || $propertyValues[0] === null) {
return $this;
}
- 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 likeAnyMatch
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function likeAnyMatch(string $propertyName, array $propertyValues): QueryBuilderInterface
{
if ($propertyValues === null || empty($propertyValues) || $propertyValues[0] === null) {
return $this;
}
- 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 fulltextMatchResult
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function fulltextMatchResult(string $searchword, int $resultTokens = 60, string $ellipsis = '...', string $beginModifier = '<b>', string $endModifier = '</b>'): string
Method fulltextMatchResult
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function fulltextMatchResult($searchword, $resultTokens = 200, $ellipsis = '...', $beginModifier = '<b>', $endModifier = '</b>'): string
Method extractSnippet
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function extractSnippet(int $resultTokens, string $ellipsis, int $matchLength, int $snippetLocation, string $matchContent): string
Function initializeObject
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function initializeObject(): void
{
$databaseFilePath = $this->storageFolder . md5($this->getIndexName()) . '.db';
$createDatabaseTables = false;
- 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 fulltextMatchResult
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function fulltextMatchResult(string $searchword, int $resultTokens = 60, string $ellipsis = '...', string $beginModifier = '<b>', string $endModifier = '</b>'): string
{
$query = $this->buildQueryString();
$results = $this->indexClient->executeStatement($query, $this->parameterMap);
// SQLite3 has a hard-coded limit of 999 query variables, so we split the $result in chunks
- 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 fulltextMatchResult
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function fulltextMatchResult($searchword, $resultTokens = 200, $ellipsis = '...', $beginModifier = '<b>', $endModifier = '</b>'): string
{
$searchword = trim($searchword);
$query = $this->buildQueryString();
- 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"