Showing 34 of 651 total issues

Method load has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function load($file = '', $use_sections = false, $fail_gracefully = false, $_module = '')
    {
        if (in_array($file, $this->is_loaded, true)) {
            return $this->item($file);
        }
Severity: Minor
Found in third_party/MX/Config.php - About 1 hr to fix

    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

        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, 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 $segments;
              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

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

                      public function plugin($plugin)
                      {
                          if (is_array($plugin)) {
                              return $this->plugins($plugin);
                          }
                  Severity: Minor
                  Found in third_party/MX/Loader.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

                  Severity
                  Category
                  Status
                  Source
                  Language