kitsunet/Flowpack.SimpleSearch

View on GitHub

Showing 24 of 24 total issues

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
Severity: Minor
Found in Classes/Search/SqLiteQueryBuilder.php - About 35 mins to fix

    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
    Severity: Minor
    Found in Classes/Search/SqLiteQueryBuilder.php - About 25 mins to fix

    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 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;
    
    
    Severity: Minor
    Found in Classes/Domain/Service/SqLiteIndex.php - About 25 mins to fix

    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();
    Severity: Minor
    Found in Classes/Search/MysqlQueryBuilder.php - About 25 mins to fix

    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

    Severity
    Category
    Status
    Source
    Language