e107inc/e107

View on GitHub
e107_handlers/cache_handler.php

Summary

Maintainability
A
2 hrs
Test Coverage
C
72%

Consider simplifying this complex logical expression.
Open

        if(($ForceCache != false ) || ($syscache == false && $this->UserCacheActive) || ($syscache == true && $this->SystemCacheActive) && !e107::getParser()->checkHighlighting())
        {
            $cache_file = (isset($this) && $this instanceof ecache ? $this->cache_fname($CacheTag, $syscache) : self::cache_fname($CacheTag, $syscache));
            @file_put_contents($cache_file, ($bRaw? $Data : self::CACHE_PREFIX.$Data) );
            @chmod($cache_file, 0755); //Cache should not be world-writeable
Severity: Major
Found in e107_handlers/cache_handler.php - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

            if(($ForcedCheck != false ) || ($syscache == false && $this->UserCacheActive) || ($syscache == true && $this->SystemCacheActive) && !e107::getParser()->checkHighlighting())
            {
                $cache_file = (isset($this) && $this instanceof ecache ? $this->cache_fname($CacheTag, $syscache) : self::cache_fname($CacheTag, $syscache));
    
                if(file_exists($cache_file))
    Severity: Major
    Found in e107_handlers/cache_handler.php - About 1 hr to fix

      Suspicious type bool|false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
      Open

              e107::getEvent()->triggerAdminEvent('cache_clear', "cachetag=$CacheTag&file=$file&syscache=$syscache");
      Severity: Minor
      Found in e107_handlers/cache_handler.php by phan

      Returning type false but retrieve() is declared to return string
      Open

                      return false;
      Severity: Minor
      Found in e107_handlers/cache_handler.php by phan

      Returning type false but retrieve() is declared to return string
      Open

                          return false;
      Severity: Minor
      Found in e107_handlers/cache_handler.php by phan

      Returning type false but retrieve() is declared to return string
      Open

              return false;
      Severity: Minor
      Found in e107_handlers/cache_handler.php by phan

      Default value for bool $bRaw can't be int
      Open

          function set_sys($CacheTag, $Data, $ForceCache = false, $bRaw=0)
      Severity: Minor
      Found in e107_handlers/cache_handler.php by phan

      Default value for bool $bRaw can't be int
      Open

          public function set($CacheTag, $Data, $ForceCache = false, $bRaw=0, $syscache = false)
      Severity: Minor
      Found in e107_handlers/cache_handler.php by phan

      There are no issues that match your filters.

      Category
      Status