kai-jacobsen/kontentblocks

View on GitHub
core/Utils/Utilities.php

Summary

Maintainability
D
2 days
Test Coverage

File Utilities.php has 428 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace Kontentblocks\Utils;

use Kontentblocks\Backend\Environment\EnvironmentInterface;
Severity: Minor
Found in core/Utils/Utilities.php - About 6 hrs to fix

    Utilities has 30 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Utilities
    {
    
        protected static $postEnvironments = array();
        protected static $termEnvironments = array();
    Severity: Minor
    Found in core/Utils/Utilities.php - About 3 hrs to fix

      The class Utilities has an overall complexity of 104 which is very high. The configured complexity threshold is 50.
      Open

      class Utilities
      {
      
          protected static $postEnvironments = array();
          protected static $termEnvironments = array();
      Severity: Minor
      Found in core/Utils/Utilities.php by phpmd

      The class Utilities has 15 public methods. Consider refactoring Utilities to keep number of public methods under 10.
      Open

      class Utilities
      {
      
          protected static $postEnvironments = array();
          protected static $termEnvironments = array();
      Severity: Minor
      Found in core/Utils/Utilities.php by phpmd

      TooManyPublicMethods

      Since: 0.1

      A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

      By default it ignores methods starting with 'get' or 'set'.

      Example

      Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

      Function arrayMergeRecursive has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function arrayMergeRecursive($new, $old)
          {
              $merged = $new;
              if (!is_array($merged)) {
                  return $old;
      Severity: Minor
      Found in core/Utils/Utilities.php - About 2 hrs 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 editorDefaultSettings has 63 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function editorDefaultSettings()
          {
              global $wp_version;
      
              // introduced in 4.3
      Severity: Major
      Found in core/Utils/Utilities.php - About 2 hrs to fix

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

            public static function strposa($haystack, $needle, $offset = 0)
            {
                if (!is_array($needle)) {
                    $needle = array($needle);
                }
        Severity: Minor
        Found in core/Utils/Utilities.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 remoteConcatGet has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function remoteConcatGet($postId = null, $blocking = false, $host = null, $args = array())
            {
        
                if (apply_filters('kb.remote.concat.get.disable', false)) {
                    return null;
        Severity: Minor
        Found in core/Utils/Utilities.php - About 1 hr to fix

          Function remoteConcatGet has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function remoteConcatGet($postId = null, $blocking = false, $host = null, $args = array())
              {
          
                  if (apply_filters('kb.remote.concat.get.disable', false)) {
                      return null;
          Severity: Minor
          Found in core/Utils/Utilities.php - About 45 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 getPostEnvironment has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function getPostEnvironment($storageId = null, $actualPostId = null)
              {
                  $cacheKey = get_current_blog_id() . ':' . $storageId;
                  if ($storageId && is_numeric($storageId) && $storageId !== -1) {
                      if (isset(self::$postEnvironments[$cacheKey])) {
          Severity: Minor
          Found in core/Utils/Utilities.php - About 45 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

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

              static public function editor($id, $data, $name = null, $media = false, $args = array())
          Severity: Minor
          Found in core/Utils/Utilities.php - About 35 mins to fix

            Avoid too many return statements within this method.
            Open

                        return $response;
            Severity: Major
            Found in core/Utils/Utilities.php - About 30 mins to fix

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

                  public static function validateBoolRecursive($array)
                  {
                      foreach ($array as $k => $v) {
              
                          if (is_array($v)) {
              Severity: Minor
              Found in core/Utils/Utilities.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

              The method arrayMergeRecursive() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10.
              Open

                  public static function arrayMergeRecursive($new, $old)
                  {
                      $merged = $new;
                      if (!is_array($merged)) {
                          return $old;
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              CyclomaticComplexity

              Since: 0.1

              Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

              Example

              // Cyclomatic Complexity = 11
              class Foo {
              1   public function example() {
              2       if ($a == $b) {
              3           if ($a1 == $b1) {
                              fiddle();
              4           } elseif ($a2 == $b2) {
                              fiddle();
                          } else {
                              fiddle();
                          }
              5       } elseif ($c == $d) {
              6           while ($c == $d) {
                              fiddle();
                          }
              7        } elseif ($e == $f) {
              8           for ($n = 0; $n < $h; $n++) {
                              fiddle();
                          }
                      } else {
                          switch ($z) {
              9               case 1:
                                  fiddle();
                                  break;
              10              case 2:
                                  fiddle();
                                  break;
              11              case 3:
                                  fiddle();
                                  break;
                              default:
                                  fiddle();
                                  break;
                          }
                      }
                  }
              }

              Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

              The method remoteConcatGet has a boolean flag argument $blocking, which is a certain sign of a Single Responsibility Principle violation.
              Open

                  public static function remoteConcatGet($postId = null, $blocking = false, $host = null, $args = array())
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

              A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

              Example

              class Foo {
                  public function bar($flag = true) {
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

              The method editor has a boolean flag argument $media, which is a certain sign of a Single Responsibility Principle violation.
              Open

                  static public function editor($id, $data, $name = null, $media = false, $args = array())
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

              A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

              Example

              class Foo {
                  public function bar($flag = true) {
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

              Avoid using static access to class 'Kontentblocks\Utils_K' in method 'getPostEnvironment'.
              Open

                                  _K::info("new PostEnvironment built for post ID {$cacheKey}");
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              StaticAccess

              Since: 1.4.0

              Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

              Example

              class Foo
              {
                  public function bar()
                  {
                      Bar::baz();
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#staticaccess

              The method getTermEnvironment uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                          } else {
                              $termObj = get_term($termId, $taxonomy);
                              _K::info("new TermEnvironment built for post ID {$termId}");
                              return self::$termEnvironments[$termId] = new TermEnvironment($termId, $termObj);
                          }
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              ElseExpression

              Since: 1.4.0

              An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

              Example

              class Foo
              {
                  public function bar($flag)
                  {
                      if ($flag) {
                          // one branch
                      } else {
                          // another branch
                      }
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#elseexpression

              The method getPostEnvironment uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                          } else {
                              $realId = (is_null($actualPostId)) ? $storageId : $actualPostId;
                              $postObj = get_post($realId);
                              if (!is_null($postObj)) {
                                  _K::info("new PostEnvironment built for post ID {$cacheKey}");
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              ElseExpression

              Since: 1.4.0

              An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

              Example

              class Foo
              {
                  public function bar($flag)
                  {
                      if ($flag) {
                          // one branch
                      } else {
                          // another branch
                      }
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#elseexpression

              The method arrayMergeRecursive uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                              } else {
                                  if (array_key_exists($key, $merged) && $merged[$key] === null) {
                                      // key was set to null on purpose, and gets removed finally
                                      unset($merged[$key]);
                                  } elseif (!isset($merged[$key])) {
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              ElseExpression

              Since: 1.4.0

              An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

              Example

              class Foo
              {
                  public function bar($flag)
                  {
                      if ($flag) {
                          // one branch
                      } else {
                          // another branch
                      }
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#elseexpression

              The method getTemplateFile uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                      } else {
                          return 'generic';
                      }
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              ElseExpression

              Since: 1.4.0

              An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

              Example

              class Foo
              {
                  public function bar($flag)
                  {
                      if ($flag) {
                          // one branch
                      } else {
                          // another branch
                      }
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#elseexpression

              Avoid using static access to class 'Kontentblocks\Utils_K' in method 'getTermEnvironment'.
              Open

                              _K::info("new TermEnvironment built for post ID {$termId}");
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              StaticAccess

              Since: 1.4.0

              Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

              Example

              class Foo
              {
                  public function bar()
                  {
                      Bar::baz();
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#staticaccess

              Avoid using static access to class 'Kontentblocks\Utils_K' in method 'getPostEnvironment'.
              Open

                              _K::info("cached PostEnvironment found for post ID {$cacheKey}");
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              StaticAccess

              Since: 1.4.0

              Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

              Example

              class Foo
              {
                  public function bar()
                  {
                      Bar::baz();
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#staticaccess

              The method arrayMergeRecursive uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                                  } else {
                                      // preserve the old value
                                      $merged[$key] = self::arrayMergeRecursive($old[$key], $old[$key]);
                                  }
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              ElseExpression

              Since: 1.4.0

              An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

              Example

              class Foo
              {
                  public function bar($flag)
                  {
                      if ($flag) {
                          // one branch
                      } else {
                          // another branch
                      }
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#elseexpression

              Avoid using static access to class '\Symfony\Component\HttpFoundation\Request' in method 'getRequest'.
              Open

                          self::$request = Request::createFromGlobals();
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              StaticAccess

              Since: 1.4.0

              Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

              Example

              class Foo
              {
                  public function bar()
                  {
                      Bar::baz();
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#staticaccess

              The method getUserEnvironment uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                          } else {
                              return self::$userEnvironments[$userId] = new UserEnvironment($userId, $user);
                          }
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              ElseExpression

              Since: 1.4.0

              An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

              Example

              class Foo
              {
                  public function bar($flag)
                  {
                      if ($flag) {
                          // one branch
                      } else {
                          // another branch
                      }
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#elseexpression

              The method strposa uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                          } else {
                              if (strpos($haystack, $query, $offset) !== false) {
                                  return true;
                              } // stop on first true result
              
              
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              ElseExpression

              Since: 1.4.0

              An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

              Example

              class Foo
              {
                  public function bar($flag)
                  {
                      if ($flag) {
                          // one branch
                      } else {
                          // another branch
                      }
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#elseexpression

              Avoid using static access to class 'Kontentblocks\Utils\Utilities' in method 'editor'.
              Open

                          $settings = Utilities::arrayMergeRecursive($args, $settings);
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              StaticAccess

              Since: 1.4.0

              Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

              Example

              class Foo
              {
                  public function bar()
                  {
                      Bar::baz();
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#staticaccess

              The method getHighestId uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                      } else {
                          return absint(max($collect));
                      }
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              ElseExpression

              Since: 1.4.0

              An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

              Example

              class Foo
              {
                  public function bar($flag)
                  {
                      if ($flag) {
                          // one branch
                      } else {
                          // another branch
                      }
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#elseexpression

              The method isPreview uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                      } else {
                          return is_preview();
                      }
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              ElseExpression

              Since: 1.4.0

              An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

              Example

              class Foo
              {
                  public function bar($flag)
                  {
                      if ($flag) {
                          // one branch
                      } else {
                          // another branch
                      }
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#elseexpression

              Avoid using static access to class 'Kontentblocks\Utils_K' in method 'getTermEnvironment'.
              Open

                              _K::info("cached TermEnvironment found for post ID {$termId}");
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              StaticAccess

              Since: 1.4.0

              Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

              Example

              class Foo
              {
                  public function bar()
                  {
                      Bar::baz();
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#staticaccess

              The method getBaseIdField uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                      } else {
                          $base_id = 0;
                      }
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              ElseExpression

              Since: 1.4.0

              An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

              Example

              class Foo
              {
                  public function bar($flag)
                  {
                      if ($flag) {
                          // one branch
                      } else {
                          // another branch
                      }
                  }
              }

              Source https://phpmd.org/rules/cleancode.html#elseexpression

              Avoid variables with short names like $id. Configured minimum length is 3.
              Open

                  public static function adminMenuExists($id)
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              ShortVariable

              Since: 0.2

              Detects when a field, local, or parameter has a very short name.

              Example

              class Something {
                  private $q = 15; // VIOLATION - Field
                  public static function main( array $as ) { // VIOLATION - Formal
                      $r = 20 + $this->q; // VIOLATION - Local
                      for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                          $r += $this->q;
                      }
                  }
              }

              Source https://phpmd.org/rules/naming.html#shortvariable

              Avoid variables with short names like $id. Configured minimum length is 3.
              Open

                  static public function editor($id, $data, $name = null, $media = false, $args = array())
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              ShortVariable

              Since: 0.2

              Detects when a field, local, or parameter has a very short name.

              Example

              class Something {
                  private $q = 15; // VIOLATION - Field
                  public static function main( array $as ) { // VIOLATION - Formal
                      $r = 20 + $this->q; // VIOLATION - Local
                      for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                          $r += $this->q;
                      }
                  }
              }

              Source https://phpmd.org/rules/naming.html#shortvariable

              Avoid variables with short names like $id. Configured minimum length is 3.
              Open

                              $id = str_replace('_', '', $count);
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              ShortVariable

              Since: 0.2

              Detects when a field, local, or parameter has a very short name.

              Example

              class Something {
                  private $q = 15; // VIOLATION - Field
                  public static function main( array $as ) { // VIOLATION - Formal
                      $r = 20 + $this->q; // VIOLATION - Local
                      for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                          $r += $this->q;
                      }
                  }
              }

              Source https://phpmd.org/rules/naming.html#shortvariable

              The variable $base_id is not named in camelCase.
              Open

                  public static function getBaseIdField($index)
                  {
                      // prepare base id for new blocks
                      if (!empty($index)) {
                          $base_id = self::getHighestId($index);
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              CamelCaseVariableName

              Since: 0.2

              It is considered best practice to use the camelCase notation to name variables.

              Example

              class ClassName {
                  public function doSomething() {
                      $data_module = new DataModule();
                  }
              }

              Source

              The variable $page_templates is not named in camelCase.
              Open

                  public static function getPageTemplates()
                  {
              
                      $page_templates = get_page_templates();
                      $page_templates['Default (page.php)'] = 'default';
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              CamelCaseVariableName

              Since: 0.2

              It is considered best practice to use the camelCase notation to name variables.

              Example

              class ClassName {
                  public function doSomething() {
                      $data_module = new DataModule();
                  }
              }

              Source

              The variable $XHProfRuns is not named in camelCase.
              Open

                  public static function disableXhprf($app = 'Kontentblocks')
                  {
                      if (function_exists('xhprof_disable')) {
                          if (filter_input(INPUT_GET, 'xhprof', FILTER_SANITIZE_STRING)) {
                              $XHProfData = xhprof_disable();
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              CamelCaseVariableName

              Since: 0.2

              It is considered best practice to use the camelCase notation to name variables.

              Example

              class ClassName {
                  public function doSomething() {
                      $data_module = new DataModule();
                  }
              }

              Source

              The variable $XHProfRuns is not named in camelCase.
              Open

                  public static function disableXhprf($app = 'Kontentblocks')
                  {
                      if (function_exists('xhprof_disable')) {
                          if (filter_input(INPUT_GET, 'xhprof', FILTER_SANITIZE_STRING)) {
                              $XHProfData = xhprof_disable();
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              CamelCaseVariableName

              Since: 0.2

              It is considered best practice to use the camelCase notation to name variables.

              Example

              class ClassName {
                  public function doSomething() {
                      $data_module = new DataModule();
                  }
              }

              Source

              The variable $wp_version is not named in camelCase.
              Open

                  public static function editorDefaultSettings()
                  {
                      global $wp_version;
              
                      // introduced in 4.3
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              CamelCaseVariableName

              Since: 0.2

              It is considered best practice to use the camelCase notation to name variables.

              Example

              class ClassName {
                  public function doSomething() {
                      $data_module = new DataModule();
                  }
              }

              Source

              The variable $wp_version is not named in camelCase.
              Open

                  public static function editorDefaultSettings()
                  {
                      global $wp_version;
              
                      // introduced in 4.3
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              CamelCaseVariableName

              Since: 0.2

              It is considered best practice to use the camelCase notation to name variables.

              Example

              class ClassName {
                  public function doSomething() {
                      $data_module = new DataModule();
                  }
              }

              Source

              The variable $base_id is not named in camelCase.
              Open

                  public static function getBaseIdField($index)
                  {
                      // prepare base id for new blocks
                      if (!empty($index)) {
                          $base_id = self::getHighestId($index);
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              CamelCaseVariableName

              Since: 0.2

              It is considered best practice to use the camelCase notation to name variables.

              Example

              class ClassName {
                  public function doSomething() {
                      $data_module = new DataModule();
                  }
              }

              Source

              The variable $wp_version is not named in camelCase.
              Open

                  public static function editorDefaultSettings()
                  {
                      global $wp_version;
              
                      // introduced in 4.3
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              CamelCaseVariableName

              Since: 0.2

              It is considered best practice to use the camelCase notation to name variables.

              Example

              class ClassName {
                  public function doSomething() {
                      $data_module = new DataModule();
                  }
              }

              Source

              The variable $base_id is not named in camelCase.
              Open

                  public static function getBaseIdField($index)
                  {
                      // prepare base id for new blocks
                      if (!empty($index)) {
                          $base_id = self::getHighestId($index);
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              CamelCaseVariableName

              Since: 0.2

              It is considered best practice to use the camelCase notation to name variables.

              Example

              class ClassName {
                  public function doSomething() {
                      $data_module = new DataModule();
                  }
              }

              Source

              The variable $page_templates is not named in camelCase.
              Open

                  public static function getPageTemplates()
                  {
              
                      $page_templates = get_page_templates();
                      $page_templates['Default (page.php)'] = 'default';
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              CamelCaseVariableName

              Since: 0.2

              It is considered best practice to use the camelCase notation to name variables.

              Example

              class ClassName {
                  public function doSomething() {
                      $data_module = new DataModule();
                  }
              }

              Source

              The variable $wp_version is not named in camelCase.
              Open

                  public static function editorDefaultSettings()
                  {
                      global $wp_version;
              
                      // introduced in 4.3
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              CamelCaseVariableName

              Since: 0.2

              It is considered best practice to use the camelCase notation to name variables.

              Example

              class ClassName {
                  public function doSomething() {
                      $data_module = new DataModule();
                  }
              }

              Source

              The variable $wp_version is not named in camelCase.
              Open

                  public static function editorDefaultSettings()
                  {
                      global $wp_version;
              
                      // introduced in 4.3
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              CamelCaseVariableName

              Since: 0.2

              It is considered best practice to use the camelCase notation to name variables.

              Example

              class ClassName {
                  public function doSomething() {
                      $data_module = new DataModule();
                  }
              }

              Source

              The variable $XHProfData is not named in camelCase.
              Open

                  public static function disableXhprf($app = 'Kontentblocks')
                  {
                      if (function_exists('xhprof_disable')) {
                          if (filter_input(INPUT_GET, 'xhprof', FILTER_SANITIZE_STRING)) {
                              $XHProfData = xhprof_disable();
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              CamelCaseVariableName

              Since: 0.2

              It is considered best practice to use the camelCase notation to name variables.

              Example

              class ClassName {
                  public function doSomething() {
                      $data_module = new DataModule();
                  }
              }

              Source

              The variable $XHProfData is not named in camelCase.
              Open

                  public static function disableXhprf($app = 'Kontentblocks')
                  {
                      if (function_exists('xhprof_disable')) {
                          if (filter_input(INPUT_GET, 'xhprof', FILTER_SANITIZE_STRING)) {
                              $XHProfData = xhprof_disable();
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              CamelCaseVariableName

              Since: 0.2

              It is considered best practice to use the camelCase notation to name variables.

              Example

              class ClassName {
                  public function doSomething() {
                      $data_module = new DataModule();
                  }
              }

              Source

              The variable $page_templates is not named in camelCase.
              Open

                  public static function getPageTemplates()
                  {
              
                      $page_templates = get_page_templates();
                      $page_templates['Default (page.php)'] = 'default';
              Severity: Minor
              Found in core/Utils/Utilities.php by phpmd

              CamelCaseVariableName

              Since: 0.2

              It is considered best practice to use the camelCase notation to name variables.

              Example

              class ClassName {
                  public function doSomething() {
                      $data_module = new DataModule();
                  }
              }

              Source

              There are no issues that match your filters.

              Category
              Status