third_party/MX/Modules.php

Summary

Maintainability
C
1 day
Test Coverage

parse_routes accesses the super-global variable $_SERVER.
Open

    public static function parse_routes($module, $uri)
    {
        // load the route file
        if (! isset(self::$routes[$module])) {
            // Backward function
Severity: Minor
Found in third_party/MX/Modules.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

parse_routes accesses the super-global variable $_SERVER.
Open

    public static function parse_routes($module, $uri)
    {
        // load the route file
        if (! isset(self::$routes[$module])) {
            // Backward function
Severity: Minor
Found in third_party/MX/Modules.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

Function parse_routes has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public static function parse_routes($module, $uri)
    {
        // load the route file
        if (! isset(self::$routes[$module])) {
            // Backward function
Severity: Minor
Found in third_party/MX/Modules.php - About 3 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

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

    public static function find($file, $module, $base)
    {
        $segments = explode('/', $file);

        $file = array_pop($segments);
Severity: Minor
Found in third_party/MX/Modules.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 parse_routes has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function parse_routes($module, $uri)
    {
        // load the route file
        if (! isset(self::$routes[$module])) {
            // Backward function
Severity: Minor
Found in third_party/MX/Modules.php - About 1 hr to fix

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

        public static function load($module)
        {
            // Backward function
            // The function each() has been DEPRECATED as of PHP 7.2.0. Relying on this function is highly discouraged
            // Before PHP 7.1.0, list() only worked on numerical arrays and assumes the numerical indices start at 0.
    Severity: Minor
    Found in third_party/MX/Modules.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 load has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function load($module)
        {
            // Backward function
            // The function each() has been DEPRECATED as of PHP 7.2.0. Relying on this function is highly discouraged
            // Before PHP 7.1.0, list() only worked on numerical arrays and assumes the numerical indices start at 0.
    Severity: Minor
    Found in third_party/MX/Modules.php - About 1 hr to fix

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

          public static function autoload($class)
          {
              // don't autoload CI_ prefixed classes or those using the config subclass_prefix
              if (strstr($class, 'CI_') || strstr($class, config_item('subclass_prefix'))) {
                  return;
      Severity: Minor
      Found in third_party/MX/Modules.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 load_file has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function load_file($file, $path, $type = 'other', $result = true)
          {
              $file = str_replace(EXT, '', $file);
              $location = $path.$file.EXT;
      
      
      Severity: Minor
      Found in third_party/MX/Modules.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

      The method parse_routes() has an NPath complexity of 260. The configured NPath complexity threshold is 200.
      Open

          public static function parse_routes($module, $uri)
          {
              // load the route file
              if (! isset(self::$routes[$module])) {
                  // Backward function
      Severity: Minor
      Found in third_party/MX/Modules.php by phpmd

      NPathComplexity

      Since: 0.1

      The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

      Example

      class Foo {
          function bar() {
              // lots of complicated code
          }
      }

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

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

          public static function find($file, $module, $base)
          {
              $segments = explode('/', $file);
      
              $file = array_pop($segments);
      Severity: Minor
      Found in third_party/MX/Modules.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 parse_routes() has a Cyclomatic Complexity of 15. The configured cyclomatic complexity threshold is 10.
      Open

          public static function parse_routes($module, $uri)
          {
              // load the route file
              if (! isset(self::$routes[$module])) {
                  // Backward function
      Severity: Minor
      Found in third_party/MX/Modules.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 load_file has a boolean flag argument $result, which is a certain sign of a Single Responsibility Principle violation.
      Open

          public static function load_file($file, $path, $type = 'other', $result = true)
      Severity: Minor
      Found in third_party/MX/Modules.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 load uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                  } else {
                      [$class] = CI::$APP->router->locate(explode('/', $module));
                  }
      Severity: Minor
      Found in third_party/MX/Modules.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 assigning values to variables in if clauses and the like (line '292', column '21').
      Open

          public static function parse_routes($module, $uri)
          {
              // load the route file
              if (! isset(self::$routes[$module])) {
                  // Backward function
      Severity: Minor
      Found in third_party/MX/Modules.php by phpmd

      IfStatementAssignment

      Since: 2.7.0

      Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($foo = 'bar') { // possible typo
                  // ...
              }
              if ($baz = 0) { // always false
                  // ...
              }
          }
      }

      Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

      Avoid assigning values to variables in if clauses and the like (line '167', column '25').
      Open

          public static function autoload($class)
          {
              // don't autoload CI_ prefixed classes or those using the config subclass_prefix
              if (strstr($class, 'CI_') || strstr($class, config_item('subclass_prefix'))) {
                  return;
      Severity: Minor
      Found in third_party/MX/Modules.php by phpmd

      IfStatementAssignment

      Since: 2.7.0

      Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($foo = 'bar') { // possible typo
                  // ...
              }
              if ($baz = 0) { // always false
                  // ...
              }
          }
      }

      Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

      Avoid assigning values to variables in if clauses and the like (line '175', column '21').
      Open

          public static function autoload($class)
          {
              // don't autoload CI_ prefixed classes or those using the config subclass_prefix
              if (strstr($class, 'CI_') || strstr($class, config_item('subclass_prefix'))) {
                  return;
      Severity: Minor
      Found in third_party/MX/Modules.php by phpmd

      IfStatementAssignment

      Since: 2.7.0

      Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($foo = 'bar') { // possible typo
                  // ...
              }
              if ($baz = 0) { // always false
                  // ...
              }
          }
      }

      Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

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

                  } else {
                      if ([$path] = self::find('routes', $module, 'config/')) {
                          $path && self::$routes[$module] = self::load_file('routes', $path, 'route');
                      }
                  }
      Severity: Minor
      Found in third_party/MX/Modules.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 assigning values to variables in if clauses and the like (line '72', column '13').
      Open

          public static function run($module)
          {
              $method = 'index';
      
              if (($pos = strrpos($module, '/')) !== false) {
      Severity: Minor
      Found in third_party/MX/Modules.php by phpmd

      IfStatementAssignment

      Since: 2.7.0

      Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($foo = 'bar') { // possible typo
                  // ...
              }
              if ($baz = 0) { // always false
                  // ...
              }
          }
      }

      Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

      Avoid assigning values to variables in if clauses and the like (line '181', column '21').
      Open

          public static function autoload($class)
          {
              // don't autoload CI_ prefixed classes or those using the config subclass_prefix
              if (strstr($class, 'CI_') || strstr($class, config_item('subclass_prefix'))) {
                  return;
      Severity: Minor
      Found in third_party/MX/Modules.php by phpmd

      IfStatementAssignment

      Since: 2.7.0

      Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($foo = 'bar') { // possible typo
                  // ...
              }
              if ($baz = 0) { // always false
                  // ...
              }
          }
      }

      Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

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

                      } else {
                          continue;
                      }
      Severity: Minor
      Found in third_party/MX/Modules.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 assigning values to variables in if clauses and the like (line '288', column '21').
      Open

          public static function parse_routes($module, $uri)
          {
              // load the route file
              if (! isset(self::$routes[$module])) {
                  // Backward function
      Severity: Minor
      Found in third_party/MX/Modules.php by phpmd

      IfStatementAssignment

      Since: 2.7.0

      Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($foo = 'bar') { // possible typo
                  // ...
              }
              if ($baz = 0) { // always false
                  // ...
              }
          }
      }

      Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

      Avoid assigning values to variables in if clauses and the like (line '67', column '14').
      Open

          public static function run($module)
          {
              $method = 'index';
      
              if (($pos = strrpos($module, '/')) !== false) {
      Severity: Minor
      Found in third_party/MX/Modules.php by phpmd

      IfStatementAssignment

      Since: 2.7.0

      Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($foo = 'bar') { // possible typo
                  // ...
              }
              if ($baz = 0) { // always false
                  // ...
              }
          }
      }

      Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

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

                  } else {
                      $keys = array_keys($module);
      
                      $params = $module[$keys[0]];
      
      
      Severity: Minor
      Found in third_party/MX/Modules.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 load uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  if (!is_array($module)) {
                      $params = null;
                  } else {
                      $keys = array_keys($module);
      Severity: Minor
      Found in third_party/MX/Modules.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 load_file uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  // load config or language array
                  include $location;
      
                  if (! isset($$type) || ! is_array($$type)) {
      Severity: Minor
      Found in third_party/MX/Modules.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 unused local variables such as '$offset'.
      Open

              foreach (self::$locations as $location => $offset) {
      Severity: Minor
      Found in third_party/MX/Modules.php by phpmd

      UnusedLocalVariable

      Since: 0.2

      Detects when a local variable is declared and/or assigned, but not used.

      Example

      class Foo {
          public function doSomething()
          {
              $i = 5; // Unused
          }
      }

      Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

      Saw unextractable annotation for comment '* @method load'
      Open

           * @method load
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      Call to undeclared function \config_item()
      Open

              if (strstr($class, 'CI_') || strstr($class, config_item('subclass_prefix'))) {
      Severity: Critical
      Found in third_party/MX/Modules.php by phan

      Call to undeclared function \log_message()
      Open

              log_message('debug', "File loaded: {$location}");
      Severity: Critical
      Found in third_party/MX/Modules.php by phan

      Variable $modules was undeclared, but array fields are being added to it.
      Open

              $module ? $modules[$module] = $path : $modules = [];
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      Reference to undeclared constant \APPPATH
      Open

              if (is_file($location = APPPATH.'libraries/'.ucfirst($class).EXT)) {
      Severity: Minor
      Found in third_party/MX/Modules.php by phan

      The phpdoc comment for @method cannot occur on a method
      Open

           * @method parse_routes
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      Reference to undeclared property \CI->router
      Open

                      list($class) = CI::$APP->router->locate(explode('/', $module));
      Severity: Minor
      Found in third_party/MX/Modules.php by phan

      Call to undeclared function \show_error()
      Open

                      show_error("{$location} does not contain a valid {$type} array");
      Severity: Critical
      Found in third_party/MX/Modules.php by phan

      Reference to undeclared property \CI->router
      Open

                  $path = APPPATH.'controllers/'.CI::$APP->router->directory;
      Severity: Minor
      Found in third_party/MX/Modules.php by phan

      Reference to undeclared property \CI->config
      Open

                  $class .= CI::$APP->config->item('controller_suffix');
      Severity: Minor
      Found in third_party/MX/Modules.php by phan

      Saw unextractable annotation for comment '* @param [type] $class [description]'
      Open

           * @param  [type]   $class [description]
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      Reference to undeclared constant \APPPATH
      Open

              if (is_file($location = APPPATH.'core/'.ucfirst($class).EXT)) {
      Severity: Minor
      Found in third_party/MX/Modules.php by phan

      The phpdoc comment for @method cannot occur on a method
      Open

           * @method load_file
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      Saw unextractable annotation for comment '* @return [type] [description]'
      Open

           * @return [type]            [description]
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      Reference to undeclared constant \APPPATH
      Open

          APPPATH.'modules/' => '../modules/',
      Severity: Minor
      Found in third_party/MX/Modules.php by phan

      The phpdoc comment for @method cannot occur on a method
      Open

           * @method autoload
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      Saw unextractable annotation for comment '* @param [type] $path [description]'
      Open

           * @param  [type]    $path   [description]
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      Saw unextractable annotation for comment '* @param [type] $module [description]'
      Open

           * @param  [type] $module [description]
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      Saw unextractable annotation for comment '* @return [type] [description]'
      Open

           * @return [type]         [description]
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      Saw unextractable annotation for comment '* @method run'
      Open

           * @method run
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      Saw unextractable annotation for comment '* @return [type] [description]'
      Open

           * @return [type]         [description]
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      The phpdoc comment for @method cannot occur on a method
      Open

           * @method load
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      Saw unextractable annotation for comment '* @return [type] [description]'
      Open

           * @return [type]               [description]
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      Call to undeclared function \log_message()
      Open

                      log_message('debug', "File already loaded: {$location}");
      Severity: Critical
      Found in third_party/MX/Modules.php by phan

      Saw unextractable annotation for comment '* @param [type] $module [description]'
      Open

           * @param  [type]       $module [description]
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      Saw unextractable annotation for comment '* @param [type] $uri [description]'
      Open

           * @param  [type]       $uri    [description]
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      The phpdoc comment for @method cannot occur on a method
      Open

           * @method run
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      Call to undeclared function \log_message()
      Open

              log_message('error', "Module controller failed to run: {$module}/{$method}");
      Severity: Critical
      Found in third_party/MX/Modules.php by phan

      Saw unextractable annotation for comment '* @param [type] $file [description]'
      Open

           * @param  [type]    $file   [description]
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      Saw unextractable annotation for comment '* @param [type] $base [description]'
      Open

           * @param  [type] $base   [description]
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      Reference to undeclared constant \APPPATH
      Open

                  $path = APPPATH.'controllers/'.CI::$APP->router->directory;
      Severity: Minor
      Found in third_party/MX/Modules.php by phan

      Saw unextractable annotation for comment '* @return [type] [description]'
      Open

           * @return [type]          [description]
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      Call to undeclared function \show_error()
      Open

                  show_error('Failed to load MX core class: '.$class);
      Severity: Critical
      Found in third_party/MX/Modules.php by phan

      Saw unextractable annotation for comment '* @param [type] $module [description]'
      Open

           * @param  [type] $module [description]
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      Saw unextractable annotation for comment '* @param [type] $module [description]'
      Open

           * @param  [type] $module [description]
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      Saw unextractable annotation for comment '* @method load_file'
      Open

           * @method load_file
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      Saw unextractable annotation for comment '* @method parse_routes'
      Open

           * @method parse_routes
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      Saw unextractable annotation for comment '* @method autoload'
      Open

           * @method autoload
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      Saw unextractable annotation for comment '* @param [type] $file [description]'
      Open

           * @param  [type] $file   [description]
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      Reference to undeclared property \CI->router
      Open

                      [$class] = CI::$APP->router->locate(explode('/', $module));
      Severity: Minor
      Found in third_party/MX/Modules.php by phan

      The phpdoc comment for @method cannot occur on a method
      Open

           * @method find
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      Saw unextractable annotation for comment '* @method find'
      Open

           * @method find
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      Saw unextractable annotation for comment '* @return [type] [description]'
      Open

           * @return [type]         [description]
      Severity: Info
      Found in third_party/MX/Modules.php by phan

      Each class must be in a namespace of at least one level (a top-level vendor name)
      Open

      class Modules
      Severity: Minor
      Found in third_party/MX/Modules.php by phpcodesniffer

      A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 3 and the first side effect is on line 1.
      Open

      <?php defined('BASEPATH') or exit('No direct script access allowed');
      Severity: Minor
      Found in third_party/MX/Modules.php by phpcodesniffer

      Method name "Modules::parse_routes" is not in camel caps format
      Open

          public static function parse_routes($module, $uri)
      Severity: Minor
      Found in third_party/MX/Modules.php by phpcodesniffer

      Method name "Modules::load_file" is not in camel caps format
      Open

          public static function load_file($file, $path, $type = 'other', $result = true)
      Severity: Minor
      Found in third_party/MX/Modules.php by phpcodesniffer

      The variable $file_ext is not named in camelCase.
      Open

          public static function find($file, $module, $base)
          {
              $segments = explode('/', $file);
      
              $file = array_pop($segments);
      Severity: Minor
      Found in third_party/MX/Modules.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 $http_verb is not named in camelCase.
      Open

          public static function parse_routes($module, $uri)
          {
              // load the route file
              if (! isset(self::$routes[$module])) {
                  // Backward function
      Severity: Minor
      Found in third_party/MX/Modules.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 $http_verb is not named in camelCase.
      Open

          public static function parse_routes($module, $uri)
          {
              // load the route file
              if (! isset(self::$routes[$module])) {
                  // Backward function
      Severity: Minor
      Found in third_party/MX/Modules.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 $http_verb is not named in camelCase.
      Open

          public static function parse_routes($module, $uri)
          {
              // load the route file
              if (! isset(self::$routes[$module])) {
                  // Backward function
      Severity: Minor
      Found in third_party/MX/Modules.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 $file_ext is not named in camelCase.
      Open

          public static function find($file, $module, $base)
          {
              $segments = explode('/', $file);
      
              $file = array_pop($segments);
      Severity: Minor
      Found in third_party/MX/Modules.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 $file_ext is not named in camelCase.
      Open

          public static function find($file, $module, $base)
          {
              $segments = explode('/', $file);
      
              $file = array_pop($segments);
      Severity: Minor
      Found in third_party/MX/Modules.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 method parse_routes is not named in camelCase.
      Open

          public static function parse_routes($module, $uri)
          {
              // load the route file
              if (! isset(self::$routes[$module])) {
                  // Backward function
      Severity: Minor
      Found in third_party/MX/Modules.php by phpmd

      CamelCaseMethodName

      Since: 0.2

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

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method load_file is not named in camelCase.
      Open

          public static function load_file($file, $path, $type = 'other', $result = true)
          {
              $file = str_replace(EXT, '', $file);
              $location = $path.$file.EXT;
      
      
      Severity: Minor
      Found in third_party/MX/Modules.php by phpmd

      CamelCaseMethodName

      Since: 0.2

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

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      There are no issues that match your filters.

      Category
      Status