XoopsModules25x/smallworld

View on GitHub

Showing 759 of 1,838 total issues

Method input_add has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function input_add($class, $name, $name2, $rel, $size, $textmore, $preset = null, $id = null)
Severity: Major
Found in class/Form.php - About 1 hr to fix

    Function smallworld_getImageSize has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    function smallworld_getImageSize($w, $h, $url)
    {
        $bn        = basename($url);
        $w         = (int)$w;
        $h         = (int)$h;
    Severity: Minor
    Found in include/functions.php - About 55 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 rmove has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function rmove($src, $dest)
        {
            // Only continue if user is a 'global' Admin
            if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
                return false;
    Severity: Minor
    Found in class/Common/FilesManagement.php - About 55 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 generate_response has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function generate_response($content, $print_response = true)
        {
            if ($print_response) {
                $json     = json_encode($content);
                $redirect = isset($_REQUEST['redirect']) ? stripslashes($_REQUEST['redirect']) : null;
    Severity: Minor
    Found in class/UploadHandler.php - About 55 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 post has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        public function post()
        {
            $upload = isset($_FILES[$this->field_name]) ? $_FILES[$this->field_name] : [
                'tmp_name' => null,
                'name'     => null,
    Severity: Minor
    Found in class/uploadclass.php - About 55 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 post has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        public function post()
        {
            $upload = isset($_FILES[$this->field_name]) ? $_FILES[$this->field_name] : [
                'tmp_name' => null,
                'name'     => null,
    Severity: Minor
    Found in class/SwUploadHandler.php - About 55 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 rcopy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function rcopy($src, $dest)
        {
            // Only continue if user is a 'global' Admin
            if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
                return false;
    Severity: Minor
    Found in class/Common/FilesManagement.php - About 55 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 getFriends has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getFriends($id, $action)
        {
            $id = (int)$id;
            $data   = [];
            if ($GLOBALS['xoopsUser'] && ($GLOBALS['xoopsUser'] instanceof \XoopsUser)) {
    Severity: Minor
    Found in class/Friends.php - About 55 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 recurseCopy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function recurseCopy($src, $dst)
        {
            $dir = opendir($src);
            //        @mkdir($dst);
            if (!@mkdir($dst) && !is_dir($dst)) {
    Severity: Minor
    Found in class/Common/FilesManagement.php - About 55 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 access has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
    Severity: Major
    Found in assets/js/jquery.min.js - About 50 mins to fix

      Function _addOneSite has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          _addOneSite: function(settings, list, display, icon, url, onclick, hint) {
      Severity: Major
      Found in assets/js/jquery.bookmark.js - About 50 mins to fix

        Function f has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            var f = function (a, b, d, e, f, g, h) {
        Severity: Major
        Found in assets/js/jquery.oembed.js - About 50 mins to fix

          Function e has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              var e = function (a, b, d, e, f, g, h) {
          Severity: Major
          Found in assets/js/jquery.oembed.js - About 50 mins to fix

            Function d has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                var d = function (a, b, d, e, f, g, h) {
            Severity: Major
            Found in assets/js/jquery.oembed.js - About 50 mins to fix

              Function g has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  var g = function (a, b, d, e, f, g, h) {
              Severity: Major
              Found in assets/js/jquery.oembed.js - About 50 mins to fix

                Method textarea has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public function textarea($name, $id, $title, $rows, $cols, $class, $preset = null)
                Severity: Major
                Found in class/Form.php - About 50 mins to fix

                  Method handle_file_upload has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          $uploaded_file,
                          $name,
                          $size,
                          $type,
                          $error,
                  Severity: Major
                  Found in class/UploadHandler.php - About 50 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                if (!isSubmit && (!opt.validate || validate(xoops_smallworldthis, size - 1, opt))) {
                                                    xoops_smallworldthis.submit();
                                                }
                    Severity: Major
                    Found in assets/js/jquery.stepy.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                  if (onSubmit) {
                                                      xoops_smallworldthis.attr('onsubmit', onSubmit);
                                                  } else {
                                                      xoops_smallworldthis.removeAttr('onsubmit');
                                                  }
                      Severity: Major
                      Found in assets/js/jquery.stepy.js - About 45 mins to fix

                        Function func has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            tmpl.func = function (s, p1, p2, p3, p4, p5) {
                        Severity: Minor
                        Found in assets/js/uploader/tmpl.js - About 45 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language