mambax7/wflinks

View on GitHub

Showing 155 of 201 total issues

Function _loadAllChildItemIds has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _loadAllChildItemIds($itemId, &$childIds)
    {
        if (!empty($this->_itemTree[$itemId]['children'])) {
            $first_child = $this->_itemTree[$itemId]['children'];
            foreach ($first_child as $fcid) {
Severity: Minor
Found in admin/mygrouppermform.php - About 1 hr 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 wflinks_notify_iteminfo has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function wflinks_notify_iteminfo($category, $item_id)
{
    $moduleDirName = basename(dirname(__DIR__));
    global $xoopsModule, $xoopsModuleConfig, $xoopsConfig;

Severity: Minor
Found in include/notification.inc.php - About 1 hr 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 loadSampleData has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function loadSampleData()
{
    global $xoopsConfig;
    $moduleDirName      = basename(dirname(__DIR__));
    $moduleDirNameUpper = mb_strtoupper($moduleDirName);
Severity: Minor
Found in testdata/index.php - About 1 hr to fix

    Method b_waiting_wflinks has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function b_waiting_wflinks()
    {
        $xoopsDB = \XoopsDatabaseFactory::getDatabaseConnection();
        $ret     = [];
    
    
    Severity: Minor
    Found in EXTRA/htdocs/modules/waiting/plugins/wflinks.php - About 1 hr to fix

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

              $postoffice = '',
              $extended = '',
              $street = '',
              $city = '',
              $region = '',
      Severity: Major
      Found in class/VCard.php - About 1 hr to fix

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

                $postoffice = '',
                $extended = '',
                $street = '',
                $city = '',
                $region = '',
        Severity: Major
        Found in class/VCard.php - About 1 hr to fix

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

                  $path = 'uploads',
                  $value = null,
                  $selected = '',
                  $size = 1,
                  $emptyselect = 0,
          Severity: Major
          Found in class/Lists.php - About 1 hr to fix

            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 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 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

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

                function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options)
            Severity: Major
            Found in admin/blocksadmin.php - About 50 mins to fix

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

                      $FILES,
                      $uploaddir = 'uploads',
                      $allowed_mimetypes = '',
                      $redirecturl = 'index.php',
                      $num = 0,
              Severity: Major
              Found in class/Utility.php - About 50 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                if (false !== $all_ok || in_array($modversion['category'], $ok_syscats)) {
                                    echo "<td class='$class' class='txtcenter;' valign='bottom' width='19%'>";
                                    echo "<a href='" . XOOPS_URL . '/modules/system/admin.php?fct=' . $file . "'><b>" . trim($modversion['name']) . "</b></a>\n";
                                    echo '</td>';
                                    ++$counter;
                Severity: Major
                Found in admin/admin.php - About 45 mins to fix

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

                      public static function getForum($type, $selected)
                      {
                          global $xoopsDB;
                          switch (\xoops_trim($type)) {
                              case 2:
                  Severity: Minor
                  Found in class/Lists.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 makeMySelBox has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public function makeMySelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = '')
                  Severity: Minor
                  Found in class/Tree.php - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                    if ($counter > 4) {
                                        $counter = 0;
                                        echo '</tr>';
                                        echo '<tr>';
                                    }
                    Severity: Major
                    Found in admin/admin.php - About 45 mins to fix

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

                          function setOrder($bid, $title, $weight, $visible, $side, $bcachetime)
                      Severity: Minor
                      Found in admin/blocksadmin.php - About 45 mins to fix

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

                            public function __construct($img_name = null, $img_path = null, $img_savepath = null)
                            {
                                if (!\preg_match("/\.(jpg|gif|png|jpeg)$/i", $img_name)) {
                                    //            return false;
                                }
                        Severity: Minor
                        Found in class/ThumbsNails.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

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

                        function wflinks_tag_iteminfo(&$items)
                        {
                            $moduleDirName = basename(dirname(__DIR__));
                        
                            if (empty($items) || !is_array($items)) {
                        Severity: Minor
                        Found in class/plugins/plugin.tag.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

                        Avoid deeply nested control flow statements.
                        Open

                                            if ($space > 0) {
                                                $subcategories .= "<a href='" . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewcat.php?cid=' . $ele['cid'] . "'>" . $chtitle . '</a><br>';
                                            }
                        Severity: Major
                        Found in index.php - About 45 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language