bnomei/kirby3-redis-cachedriver

View on GitHub

Showing 10 of 10 total issues

File Redis.php has 284 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
 
declare(strict_types=1);
 
namespace Bnomei;
Severity: Minor
Found in classes/Redis.php - About 2 hrs to fix

    Function benchmark has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    public function benchmark(int $count = 10): void
    {
    $prefix = 'redis-benchmark-';
    $redis = $this;
    $file = kirby()->cache('bnomei.redis-cachedriver'); // neat, right? ;-)
    Severity: Minor
    Found in classes/Redis.php - About 2 hrs to fix

    Function preload has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    private function preload(): void
    {
    $this->preload = [];
    $expire = $this->options['preload'];
    if ($expire === false) {
    Severity: Minor
    Found in classes/Redis.php - About 1 hr to fix

    Method preload has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    private function preload(): void
    {
    $this->preload = [];
    $expire = $this->options['preload'];
    if ($expire === false) {
    Severity: Minor
    Found in classes/Redis.php - About 1 hr to fix

      Method benchmark has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      public function benchmark(int $count = 10): void
      {
      $prefix = 'redis-benchmark-';
      $redis = $this;
      $file = kirby()->cache('bnomei.redis-cachedriver'); // neat, right? ;-)
      Severity: Minor
      Found in classes/Redis.php - About 1 hr to fix

        Method __construct has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        public function __construct(array $options = [], array $optionsClient = [])
        {
        $this->options = array_merge([
        'debug' => \option('debug'),
        'store' => \option('bnomei.redis-cachedriver.store'),
        Severity: Minor
        Found in classes/Redis.php - About 1 hr to fix

          Method set has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          public function set(string $key, mixed $value, int $minutes = 0): bool
          {
          /* SHOULD SET EVEN IN DEBUG
          if ($this->options['debug')) {
          return true;
          Severity: Minor
          Found in classes/Redis.php - About 1 hr to fix

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

            public function __construct(array $options = [], array $optionsClient = [])
            {
            $this->options = array_merge([
            'debug' => \option('debug'),
            'store' => \option('bnomei.redis-cachedriver.store'),
            Severity: Minor
            Found in classes/Redis.php - About 25 mins to fix

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

            public function __destruct()
            {
            foreach ($this->shutdownCallbacks as $callback) {
            if (! is_string($callback) && is_callable($callback)) {
            $callback();
            Severity: Minor
            Found in classes/Redis.php - About 25 mins to fix

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

            public function set(string $key, mixed $value, int $minutes = 0): bool
            {
            /* SHOULD SET EVEN IN DEBUG
            if ($this->options['debug')) {
            return true;
            Severity: Minor
            Found in classes/Redis.php - About 25 mins to fix
            Severity
            Category
            Status
            Source
            Language