modxcms/revolution

View on GitHub
core/model/smarty/sysplugins/smarty_cacheresource_keyvaluestore.php

Summary

Maintainability
C
1 day
Test Coverage

File smarty_cacheresource_keyvaluestore.php has 269 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Smarty Internal Plugin
 *
 * @package    Smarty
Severity: Minor
Found in core/model/smarty/sysplugins/smarty_cacheresource_keyvaluestore.php - About 2 hrs to fix

    Smarty_CacheResource_KeyValueStore has 22 functions (exceeds 20 allowed). Consider refactoring.
    Open

    abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource
    {
        /**
         * cache for contents
         *
    Severity: Minor
    Found in core/model/smarty/sysplugins/smarty_cacheresource_keyvaluestore.php - About 2 hrs to fix

      Function invalidate has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function invalidate(
              $cid = null,
              $resource_name = null,
              $cache_id = null,
              $compile_id = null,
      Severity: Minor
      Found in core/model/smarty/sysplugins/smarty_cacheresource_keyvaluestore.php - About 1 hr 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

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

          protected function listInvalidationKeys(
              $cid,
              $resource_name = null,
              $cache_id = null,
              $compile_id = null,
      Severity: Minor
      Found in core/model/smarty/sysplugins/smarty_cacheresource_keyvaluestore.php - About 1 hr to fix

        Method fetch has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                $cid,
                $resource_name = null,
                $cache_id = null,
                $compile_id = null,
                &$content = null,
        Severity: Major
        Found in core/model/smarty/sysplugins/smarty_cacheresource_keyvaluestore.php - About 50 mins to fix

          Method listInvalidationKeys has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  $cid,
                  $resource_name = null,
                  $cache_id = null,
                  $compile_id = null,
                  $resource_uid = null
          Severity: Minor
          Found in core/model/smarty/sysplugins/smarty_cacheresource_keyvaluestore.php - About 35 mins to fix

            Method clear has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)
            Severity: Minor
            Found in core/model/smarty/sysplugins/smarty_cacheresource_keyvaluestore.php - About 35 mins to fix

              Method getLatestInvalidationTimestamp has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      $cid,
                      $resource_name = null,
                      $cache_id = null,
                      $compile_id = null,
                      $resource_uid = null
              Severity: Minor
              Found in core/model/smarty/sysplugins/smarty_cacheresource_keyvaluestore.php - About 35 mins to fix

                Method invalidate has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        $cid = null,
                        $resource_name = null,
                        $cache_id = null,
                        $compile_id = null,
                        $resource_uid = null
                Severity: Minor
                Found in core/model/smarty/sysplugins/smarty_cacheresource_keyvaluestore.php - About 35 mins to fix

                  Function listInvalidationKeys has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function listInvalidationKeys(
                          $cid,
                          $resource_name = null,
                          $cache_id = null,
                          $compile_id = null,
                  Severity: Minor
                  Found in core/model/smarty/sysplugins/smarty_cacheresource_keyvaluestore.php - About 35 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 process has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function process(
                          Smarty_Internal_Template $_smarty_tpl,
                          Smarty_Template_Cached $cached = null,
                          $update = false
                      ) {
                  Severity: Minor
                  Found in core/model/smarty/sysplugins/smarty_cacheresource_keyvaluestore.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

                  There are no issues that match your filters.

                  Category
                  Status