PHPSocialNetwork/phpfastcache

View on GitHub
lib/Phpfastcache/Drivers/Sqlite/Driver.php

Summary

Maintainability
B
5 hrs
Test Coverage

Showing 4 of 4 total issues

Method getDbIndex has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

public function getDbIndex(string $keyword)
{
if (!isset($this->indexing)) {
$tableCreated = false;
if (!file_exists($this->sqliteDir . '/indexing')) {
Severity: Major
Found in lib/Phpfastcache/Drivers/Sqlite/Driver.php - About 2 hrs to fix

    Function getDbIndex has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    public function getDbIndex(string $keyword)
    {
    if (!isset($this->indexing)) {
    $tableCreated = false;
    if (!file_exists($this->sqliteDir . '/indexing')) {
    Severity: Minor
    Found in lib/Phpfastcache/Drivers/Sqlite/Driver.php - About 1 hr to fix

    Method driverRead has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    protected function driverRead(ExtendedCacheItemInterface $item): ?array
    {
    try {
    $stm = $this->getDb($item->getEncodedKey())
    ->prepare("SELECT * FROM `caching` WHERE `keyword`=:keyword LIMIT 1");
    Severity: Minor
    Found in lib/Phpfastcache/Drivers/Sqlite/Driver.php - About 1 hr to fix

      Function getDb has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      public function getDb(string $keyword, bool $reset = false): PDO
      {
      /**
      * Default is phpfastcache
      */
      Severity: Minor
      Found in lib/Phpfastcache/Drivers/Sqlite/Driver.php - About 25 mins to fix

      There are no issues that match your filters.

      Category
      Status