mambax7/wflinks

View on GitHub

Showing 155 of 201 total issues

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

function OnPreview(n, sUrl) {
    var prevID = n;
    var preview;
    if (!ns6) {
        preview = document.getElementById("id" + prevID).innerText;
Severity: Minor
Found in assets/js/quickview.js - 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

Avoid deeply nested control flow statements.
Open

                            if (is_file($templateFolder . $v)) {
                                unlink($templateFolder . $v);
                            }
Severity: Major
Found in include/onupdate.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if ($chcount > 5) {
                            $subcategories .= '...';
                            break;
                        }
    Severity: Major
    Found in index.php - About 45 mins to fix

      Method wfl_address has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function wfl_address($street1, $street2, $town, $state, $zip, $country = '')
      Severity: Minor
      Found in include/address.php - About 45 mins to fix

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

            public static function pagerank($url)
            {
                $pagerank = '';
                $ch       = '6' . static::googleCh(static::strord('info:' . $url));
                $fp       = \fsockopen('www.google.com', 80, $errno, $errstr, 30);
        Severity: Minor
        Found in class/Utility.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

        Consider simplifying this complex logical expression.
        Open

        if (!empty($_POST['fct']) && !empty($_POST['op']) && !empty($_POST['diranme']) && 'modulesadmin' === $_POST['fct']
            && 'update_ok' === $_POST['op']
            && $_POST['dirname'] == $modversion['dirname']) {
            require_once __DIR__ . '/include/onupdate.inc.php';
        }
        Severity: Major
        Found in xoops_version.php - About 40 mins to fix

          Method setName has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function setName($family = '', $first = '', $additional = '', $prefix = '', $suffix = '')
          Severity: Minor
          Found in class/VCard.php - About 35 mins to fix

            Method wflinks_search has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function wflinks_search($queryarray, $andor, $limit, $offset, $userid)
            Severity: Minor
            Found in include/search.inc.php - About 35 mins to fix

              Method createThumb has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      $img_width = null,
                      $img_height = null,
                      $img_quality = null,
                      $img_update = null,
                      $img_aspect = null
              Severity: Minor
              Found in class/ThumbsNails.php - About 35 mins to fix

                Function clb has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                function clb(u, a, t, p, n) {
                Severity: Minor
                Found in assets/js/quickview.js - About 35 mins to fix

                  Method truncateHtml has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
                  Severity: Minor
                  Found in class/Common/SysUtility.php - About 35 mins to fix

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

                    function wflinks_search($queryarray, $andor, $limit, $offset, $userid)
                    {
                        global $xoopsDB, $xoopsUser;
                    
                        $sql    = 'SELECT cid, pid FROM ' . $xoopsDB->prefix('wflinks_cat');
                    Severity: Minor
                    Found in include/search.inc.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 b_wflinks_banner_show has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function b_wflinks_banner_show($options)
                    {
                        $moduleDirName = basename(__DIR__);
                        global $xoopsDB;
                    
                    
                    Severity: Minor
                    Found in blocks/wflinks_banner.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 setLabel has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function setLabel(
                            $postoffice = '',
                            $extended = '',
                            $street = '',
                            $city = '',
                    Severity: Minor
                    Found in class/VCard.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 _renderOptionTree has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function _renderOptionTree(&$tree, $option, $prefix, $parentIds = [])
                        {
                            $tree .= $prefix . '<input type="checkbox" name="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" onclick="';
                            // If there are parent elements, add javascript that will
                            // make them selecteded when this element is checked to make
                    Severity: Minor
                    Found in admin/mygrouppermform.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 getEditor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function getEditor($helper = null, $options = null)
                        {
                            /** @var Helper $helper */
                            if (null === $options) {
                                $options           = [];
                    Severity: Minor
                    Found in class/Common/SysUtility.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 getHandler has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function getHandler($name, $optional = false)
                        {
                            global $handlers, $xoopsModule;
                    
                            $name = mb_strtolower(\trim($name));
                    Severity: Minor
                    Found in class/Utility.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 fetchURL has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function fetchURL($url, $timeout = 2)
                    {
                        /** @var Helper $helper */
                        $helper     = Helper::getInstance();
                        $url        = urldecode($url);
                    Severity: Minor
                    Found in admin/main.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 DEFAULT_PATH;
                    Severity: Major
                    Found in class/ThumbsNails.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return $item;
                      Severity: Major
                      Found in include/notification.inc.php - About 30 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language