mambax7/wflinks

View on GitHub

Showing 155 of 201 total issues

Method createCat has 140 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function createCat($cid = 0)
{
    // require_once  dirname(__DIR__) . '/class/wfllists.php';
    require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';

Severity: Major
Found in admin/category.php - About 5 hrs to fix

    Function displayIcons has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function displayIcons($time, $status = 0, $counter = 0)
        {
            global $xoopsModule;
            /** @var Wflinks\Helper $helper */
            $helper = Wflinks\Helper::getInstance();
    Severity: Minor
    Found in class/Utility.php - About 5 hrs 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

    File blocksadmin.inc.php has 357 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /*
     * You may not change or alter any portion of this comment or credits
     * of supporting developers from this source code or any supporting source code
     * which is considered copyrighted (c) material of the original comment or credit authors.
    Severity: Minor
    Found in include/blocksadmin.inc.php - About 4 hrs to fix

      Function getWysiwygForm has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function getWysiwygForm($caption, $name, $value)
          {
              global $xoopsUser, $xoopsModule;
              /** @var Wflinks\Helper $helper */
              $helper = Wflinks\Helper::getInstance();
      Severity: Minor
      Found in class/Utility.php - About 4 hrs 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 getSubstring has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function getSubstring($str, $start, $length, $trimmarker = '...')
          {
              $configHandler          = \xoops_getHandler('config');
              $im_multilanguageConfig = $configHandler->getConfigsByCat(IM_CONF_MULILANGUAGE);
      
      
      Severity: Minor
      Found in class/Utility.php - About 4 hrs 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 updateBlock has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

          function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
          {
              $myblock = new XoopsBlock($bid);
              $myblock->setVar('title', $btitle);
              $myblock->setVar('weight', $bweight);
      Severity: Minor
      Found in admin/blocksadmin.php - About 4 hrs 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 getWysiwygForm has 108 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function getWysiwygForm($caption, $name, $value)
          {
              global $xoopsUser, $xoopsModule;
              /** @var Wflinks\Helper $helper */
              $helper = Wflinks\Helper::getInstance();
      Severity: Major
      Found in class/Utility.php - About 4 hrs to fix

        File category.php has 343 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /**
         * Module: WF-Links
         * Version: v1.0.3
         * Release Date: 21 June 2005
        Severity: Minor
        Found in admin/category.php - About 4 hrs to fix

          Function myblocksadmin_update_block has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
          Open

          function myblocksadmin_update_block(
              $bid,
              $bside,
              $bweight,
              $bvisible,
          Severity: Minor
          Found in include/blocksadmin.inc.php - About 4 hrs 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

          File submit.php has 327 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /**
           * Module: WF-Links
           * Version: v1.0.3
           * Release Date: 21 June 2005
          Severity: Minor
          Found in submit.php - About 3 hrs to fix

            File myblocksadmin.php has 304 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            // ------------------------------------------------------------------------- //
            // myblocksadmin.php                              //
            // - XOOPS block admin for each modules -                     //
            // GIJOE <http://www.peak.ne.jp>                   //
            Severity: Minor
            Found in admin/myblocksadmin.php - About 3 hrs to fix

              Method resizeImage has 82 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function resizeImage()
                  {
                      /** @var Wflinks\Helper $helper */
                      $helper = Wflinks\Helper::getInstance();
              
              
              Severity: Major
              Found in class/ThumbsNails.php - About 3 hrs to fix

                Function checkVerModule has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function checkVerModule($helper, $source = 'github', $default = 'master')
                    {
                        $moduleDirName      = \basename(dirname(__DIR__, 2));
                        $moduleDirNameUpper = mb_strtoupper($moduleDirName);
                        $update             = '';
                Severity: Minor
                Found in class/Common/VersionChecks.php - About 2 hrs 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 resizeImage has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function resizeImage()
                    {
                        /** @var Wflinks\Helper $helper */
                        $helper = Wflinks\Helper::getInstance();
                
                
                Severity: Minor
                Found in class/ThumbsNails.php - About 2 hrs 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 isBlockCloned has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                Open

                    function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options)
                    {
                        xoops_loadLanguage('admin', 'system');
                        xoops_loadLanguage('admin/blocksadmin', 'system');
                        xoops_loadLanguage('admin/groups', 'system');
                Severity: Minor
                Found in admin/blocksadmin.php - About 2 hrs 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 getListTypeAsArray has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function getListTypeAsArray($dirname, $type = '', $prefix = '', $noselection = 1)
                    {
                        $filelist = [];
                        switch (\trim($type)) {
                            case 'images':
                Severity: Minor
                Found in class/Lists.php - About 2 hrs 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 edit has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                Open

                function edit($lid = 0)
                {
                    global $xoopsDB, $myts, $mytree, $imageArray, $xoopsConfig, $xoopsModule, $xoopsUser;
                    /** @var Helper $helper */
                    $helper = Helper::getInstance();
                Severity: Minor
                Found in admin/main.php - About 2 hrs 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 getTotalItems has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function getTotalItems($sel_id = 0, $get_child = 0, $return_sql = 0)
                    {
                        global $xoopsDB, $mytree, $_check_array;
                
                        if ($sel_id > 0) {
                Severity: Major
                Found in class/Utility.php - About 2 hrs to fix

                  Method truncateHtml has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
                      {
                          if ($considerHtml) {
                              // if the plain text is shorter than the maximum length, return the whole text
                              if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
                  Severity: Major
                  Found in class/Common/SysUtility.php - About 2 hrs to fix

                    Method myblocksadmin_update_block has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function myblocksadmin_update_block(
                        $bid,
                        $bside,
                        $bweight,
                        $bvisible,
                    Severity: Major
                    Found in include/blocksadmin.inc.php - About 2 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language