Showing 651 of 651 total issues

The parameter $add_suffix is not named in camelCase.
Open

    public function load($langfile, $lang = '', $return = false, $add_suffix = true, $alt_path = '', $_module = '')
    {
        if (is_array($langfile)) {
            foreach ($langfile as $_lang) {
                $this->load($_lang);
Severity: Minor
Found in third_party/MX/Lang.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The property $_module is not named in camelCase.
Open

class MX_Loader extends CI_Loader
{
    protected $_module;

    public $_ci_plugins = [];
Severity: Minor
Found in third_party/MX/Loader.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The parameter $add_suffix is not named in camelCase.
Open

    public function language($langfile, $idiom = '', $return = false, $add_suffix = true, $alt_path = '')
    {
        CI::$APP->lang->load($langfile, $idiom, $return, $add_suffix, $alt_path, $this->_module);
        return $this;
    }
Severity: Minor
Found in third_party/MX/Loader.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $alt_path is not named in camelCase.
Open

    public function language($langfile, $idiom = '', $return = false, $add_suffix = true, $alt_path = '')
    {
        CI::$APP->lang->load($langfile, $idiom, $return, $add_suffix, $alt_path, $this->_module);
        return $this;
    }
Severity: Minor
Found in third_party/MX/Loader.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

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

            if (!$db = CI::$APP->config->item('database') && in_array('database', $autoload['libraries'])) {
Severity: Minor
Found in third_party/MX/Loader.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 parameter $_ci_data is not named in camelCase.
Open

    public function _ci_load($_ci_data)
    {
        extract($_ci_data);

        if (isset($_ci_view)) {
Severity: Minor
Found in third_party/MX/Loader.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $object_name is not named in camelCase.
Open

    public function model($model, $object_name = null, $connect = false)
    {
        if (is_array($model)) {
            return $this->models($model);
        }
Severity: Minor
Found in third_party/MX/Loader.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The class MY_Loader is not named in CamelCase.
Open

class MY_Loader extends MX_Loader
{
}
Severity: Minor
Found in core/MY_Loader.php by phpmd

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The class MY_Router is not named in CamelCase.
Open

class MY_Router extends MX_Router
{
}
Severity: Minor
Found in core/MY_Router.php by phpmd

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The parameter $object_name is not named in camelCase.
Open

    public function library($library, $params = null, $object_name = null)
    {
        if (is_array($library)) {
            return $this->libraries($library);
        }
Severity: Minor
Found in third_party/MX/Loader.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The class MX_Router is not named in CamelCase.
Open

class MX_Router extends CI_Router
{
    public $module;
    private $located = 0;

Severity: Minor
Found in third_party/MX/Router.php by phpmd

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The parameter $_route is not named in camelCase.
Open

    protected function _set_module_path(&$_route)
    {
        if (! empty($_route)) {
            // Are module/directory/controller/method segments being specified?
            $sgs = sscanf($_route, '%[^/]/%[^/]/%[^/]/%s', $module, $directory, $class, $method);
Severity: Minor
Found in third_party/MX/Router.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

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

    protected function _set_module_path(&$_route)
    {
        if (! empty($_route)) {
            // Are module/directory/controller/method segments being specified?
            $sgs = sscanf($_route, '%[^/]/%[^/]/%[^/]/%s', $module, $directory, $class, $method);
Severity: Minor
Found in third_party/MX/Router.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 load has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function load($langfile, $lang = '', $return = false, $add_suffix = true, $alt_path = '', $_module = '')
Severity: Minor
Found in third_party/MX/Lang.php - About 45 mins to fix

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

        protected function _set_request($segments = [])
        {
            if ($this->translate_uri_dashes === true) {
                foreach (range(0, 2) as $v) {
                    isset($segments[$v]) && $segments[$v] = str_replace('-', '_', $segments[$v]);
    Severity: Minor
    Found in third_party/MX/Router.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 language has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function language($langfile, $idiom = '', $return = false, $add_suffix = true, $alt_path = '')
    Severity: Minor
    Found in third_party/MX/Loader.php - About 35 mins 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

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

          public function initialize($controller = null)
          {
              // set the module name
              $this->_module = CI::$APP->router->fetch_module();
      
      
      Severity: Minor
      Found in third_party/MX/Loader.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

      Property name "$_module" should not be prefixed with an underscore to indicate visibility
      Open

          protected $_module;
      Severity: Minor
      Found in third_party/MX/Loader.php by phpcodesniffer
      Severity
      Category
      Status
      Source
      Language