wikimedia/mediawiki-core

View on GitHub
includes/libs/objectcache/BagOStuff.php

Summary

Maintainability
C
1 day
Test Coverage

BagOStuff has 37 functions (exceeds 20 allowed). Consider refactoring.
Open

abstract class BagOStuff implements
    ExpirationAwareness,
    StorageAwareness,
    IStoreKeyEncoder,
    LoggerAwareInterface
Severity: Minor
Found in includes/libs/objectcache/BagOStuff.php - About 4 hrs to fix

    Method proxyCall has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function proxyCall(
            string $method,
            int $arg0Sig,
            int $resSig,
            array $genericArgs,
    Severity: Minor
    Found in includes/libs/objectcache/BagOStuff.php - About 1 hr to fix

      Function proxyCall has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function proxyCall(
              string $method,
              int $arg0Sig,
              int $resSig,
              array $genericArgs,
      Severity: Minor
      Found in includes/libs/objectcache/BagOStuff.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 incrWithInit has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          abstract public function incrWithInit( $key, $exptime, $step = 1, $init = null, $flags = 0 );
      Severity: Minor
      Found in includes/libs/objectcache/BagOStuff.php - About 35 mins to fix

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

                $key,
                callable $callback,
                $exptime = 0,
                $attempts = 10,
                $flags = 0
        Severity: Minor
        Found in includes/libs/objectcache/BagOStuff.php - About 35 mins to fix

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

                  string $method,
                  int $arg0Sig,
                  int $resSig,
                  array $genericArgs,
                  BagOStuff $wrapper
          Severity: Minor
          Found in includes/libs/objectcache/BagOStuff.php - About 35 mins to fix

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

                final protected function mergeFlagMaps( array $bags ) {
                    $map = [];
                    foreach ( $bags as $bag ) {
                        foreach ( $bag->attrMap as $attr => $rank ) {
                            if ( isset( $map[$attr] ) ) {
            Severity: Minor
            Found in includes/libs/objectcache/BagOStuff.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

            There are no issues that match your filters.

            Category
            Status