Showing 651 of 651 total issues

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

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

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

Method name "_add_module_paths" should not be prefixed with an underscore to indicate visibility
Open

    public function _add_module_paths($module = '')
Severity: Minor
Found in third_party/MX/Loader.php by phpcodesniffer

Method name "MX_Loader::_ci_load" is not in camel caps format
Open

    public function _ci_load($_ci_data)
Severity: Minor
Found in third_party/MX/Loader.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

Method name "MX_Router::_set_404override_controller" is not in camel caps format
Open

    protected function _set_404override_controller()
Severity: Minor
Found in third_party/MX/Router.php by phpcodesniffer

The CASE body must start on the line following the statement
Open

                    case 3: $_route = ($this->located == 2) ? $directory.'/'.$class : $class.'/index';
Severity: Minor
Found in third_party/MX/Router.php by phpcodesniffer

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if (version_compare(phpversion(), '7.1', '<')) {
            // php version isn't high enough
            list($path, $_helper) = Modules::find($helper.'_helper', $this->_module, 'helpers/');
        } else {
            [$path, $_helper] = Modules::find($helper.'_helper', $this->_module, 'helpers/');
Severity: Minor
Found in third_party/MX/Loader.php and 1 other location - About 30 mins to fix
third_party/MX/Loader.php on lines 443..448

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 91.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if (version_compare(phpversion(), '7.1', '<')) {
            // php version isn't high enough
            list($path, $_plugin) = Modules::find($plugin.'_pi', $this->_module, 'plugins/');
        } else {
            [$path, $_plugin] = Modules::find($plugin.'_pi', $this->_module, 'plugins/');
Severity: Minor
Found in third_party/MX/Loader.php and 1 other location - About 30 mins to fix
third_party/MX/Loader.php on lines 164..169

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 91.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Avoid too many return statements within this method.
Open

                return array_slice($segments, 2);
Severity: Major
Found in third_party/MX/Router.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return $this->language;
    Severity: Major
    Found in third_party/MX/Lang.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return array_slice($segments, 1);
      Severity: Major
      Found in third_party/MX/Router.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return array_slice($segments, 1);
        Severity: Major
        Found in third_party/MX/Router.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return $segments;
          Severity: Major
          Found in third_party/MX/Router.php - About 30 mins to fix

            Missing class import via use statement (line '61', column '24').
            Open

                        $CFG = new MX_Config;
            Severity: Minor
            Found in third_party/MX/Ci.php by phpmd

            MissingImport

            Since: 2.7.0

            Importing all external classes in a file through use statements makes them clearly visible.

            Example

            function make() {
                return new \stdClass();
            }

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

            Missing class import via use statement (line '59', column '25').
            Open

                        $LANG = new MX_Lang;
            Severity: Minor
            Found in third_party/MX/Base.php by phpmd

            MissingImport

            Since: 2.7.0

            Importing all external classes in a file through use statements makes them clearly visible.

            Example

            function make() {
                return new \stdClass();
            }

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

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

                public function load($file = '', $use_sections = false, $fail_gracefully = false, $_module = '')
            Severity: Minor
            Found in third_party/MX/Config.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 has a boolean flag argument $fail_gracefully, which is a certain sign of a Single Responsibility Principle violation.
            Open

                public function load($file = '', $use_sections = false, $fail_gracefully = false, $_module = '')
            Severity: Minor
            Found in third_party/MX/Config.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 has a boolean flag argument $return, which is a certain sign of a Single Responsibility Principle violation.
            Open

                public function load($langfile, $lang = '', $return = false, $add_suffix = true, $alt_path = '', $_module = '')
            Severity: Minor
            Found in third_party/MX/Lang.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 config has a boolean flag argument $use_sections, which is a certain sign of a Single Responsibility Principle violation.
            Open

                public function config($file, $use_sections = false, $fail_gracefully = false)
            Severity: Minor
            Found in third_party/MX/Loader.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

            Severity
            Category
            Status
            Source
            Language