mambax7/wflinks

View on GitHub

Showing 155 of 201 total issues

Method xoops_module_install_wflinks has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function xoops_module_install_wflinks(\XoopsModule $module)
{
    require_once dirname(__DIR__, 3) . '/mainfile.php';

    // require_once  dirname(__DIR__) . '/class/Utility.php';
Severity: Minor
Found in include/oninstall.php - About 1 hr to fix

    Method wflinks_search has 33 lines of code (exceeds 25 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 1 hr to fix

      Method convertOrderByIn has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function convertOrderByIn($orderby)
          {
              switch (\trim($orderby)) {
                  case 'titleA':
                      $orderby = 'title ASC';
      Severity: Minor
      Found in class/Utility.php - About 1 hr to fix

        Method vcard_quoted_printable_encode has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function vcard_quoted_printable_encode($input, $line_max = 76)
        {
            $hex       = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'];
            $lines     = \preg_split("/(?:\r\n|\r|\n)/", $input);
            $eol       = "\r\n";
        Severity: Minor
        Found in class/VCard.php - About 1 hr to fix

          Function createCat has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          function createCat($cid = 0)
          {
              // require_once  dirname(__DIR__) . '/class/wfllists.php';
              require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
          
          
          Severity: Minor
          Found in admin/category.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 myblocksadmin_update_block has 10 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              $bid,
              $bside,
              $bweight,
              $bvisible,
              $btitle,
          Severity: Major
          Found in include/blocksadmin.inc.php - About 1 hr to fix

            Function convertOrderByOut has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function convertOrderByOut($orderby)
                {
                    if ('title ASC' === $orderby) {
                        $orderby = 'titleA';
                    }
            Severity: Minor
            Found in class/Utility.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 rrmdir has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function rrmdir($src)
                {
                    // 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 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 convertOrderByIn has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function convertOrderByIn($orderby)
                {
                    switch (\trim($orderby)) {
                        case 'titleA':
                            $orderby = 'title ASC';
            Severity: Minor
            Found in class/Utility.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 fetchURL has 31 lines of code (exceeds 25 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 1 hr to fix

              Method convertOrderByTrans has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function convertOrderByTrans($orderby)
                  {
                      if ('hits ASC' === $orderby) {
                          $orderbyTrans = _MD_WFL_POPULARITYLTOM;
                      }
              Severity: Minor
              Found in class/Utility.php - About 1 hr to fix

                Method loadTableFromArrayWithReplace has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function loadTableFromArrayWithReplace($table, $data, $search, $replace)
                {
                    /** @var \XoopsMySQLDatabase $db */
                    $db = \XoopsDatabaseFactory::getDatabaseConnection();
                
                
                Severity: Minor
                Found in testdata/index.php - About 1 hr to fix

                  Method getForum has 30 lines of code (exceeds 25 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 1 hr to fix

                    Method uploadFiles has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static function uploadFiles(
                            $FILES,
                            $uploaddir = 'uploads',
                            $allowed_mimetypes = '',
                            $redirecturl = 'index.php',
                    Severity: Minor
                    Found in class/Utility.php - About 1 hr to fix

                      Method getServerStats has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function getServerStats()
                          {
                              //mb    $wfdownloads = WfdownloadsWfdownloads::getInstance();
                              $moduleDirName      = \basename(dirname(__DIR__, 2));
                              $moduleDirNameUpper = mb_strtoupper($moduleDirName);
                      Severity: Minor
                      Found in class/Common/ServerStats.php - About 1 hr to fix

                        Method updateBlock has 9 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
                        Severity: Major
                        Found in admin/blocksadmin.php - About 1 hr to fix

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

                              public static function mix($a, $b, $c)
                              {
                                  $a -= $b;
                                  $a -= $c;
                                  $a ^= static::fillZeroes($c, 13);
                          Severity: Minor
                          Found in class/Utility.php - About 1 hr to fix

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

                                public static function uploadFiles(
                                    $FILES,
                                    $uploaddir = 'uploads',
                                    $allowed_mimetypes = '',
                                    $redirecturl = 'index.php',
                            Severity: Minor
                            Found in class/Utility.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 createThumb has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function createThumb(
                                    $img_width = null,
                                    $img_height = null,
                                    $img_quality = null,
                                    $img_update = null,
                            Severity: Minor
                            Found in class/ThumbsNails.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 convertOrderByTrans has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public static function convertOrderByTrans($orderby)
                                {
                                    if ('hits ASC' === $orderby) {
                                        $orderbyTrans = _MD_WFL_POPULARITYLTOM;
                                    }
                            Severity: Minor
                            Found in class/Utility.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

                            Severity
                            Category
                            Status
                            Source
                            Language