mambax7/wflinks

View on GitHub

Showing 155 of 201 total issues

Function wfl_address has a Cognitive Complexity of 768 (exceeds 5 allowed). Consider refactoring.
Open

function wfl_address($street1, $street2, $town, $state, $zip, $country = '')
{
    if ('Albania' === $country) {
        if ($street2) {
            $address = $street1 . '<br>' . $street2 . '<br>' . $town;
Severity: Minor
Found in include/address.php - About 2 wks 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 wfl_address has 1133 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function wfl_address($street1, $street2, $town, $state, $zip, $country = '')
{
    if ('Albania' === $country) {
        if ($street2) {
            $address = $street1 . '<br>' . $street2 . '<br>' . $town;
Severity: Major
Found in include/address.php - About 5 days to fix

    File Utility.php has 1387 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace XoopsModules\Wflinks;
    
    /*
    Severity: Major
    Found in class/Utility.php - About 3 days to fix

      Method wflinks_sbmarks has 706 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function wflinks_sbmarks($lid)
      {
          global $xoopsDB, $xoopsModule, $myts;
      
          $sbmark_arr          = $xoopsDB->fetchArray($xoopsDB->query('SELECT title FROM ' . $xoopsDB->prefix('wflinks_links') . ' WHERE lid=' . (int)$lid . ''));
      Severity: Major
      Found in sbookmarks.php - About 3 days to fix

        File address.php has 1137 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        /**
         * Module: WF-Links
         * Developer: McDonald
        Severity: Major
        Found in include/address.php - About 2 days to fix

          File xoops_version.php has 727 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          /**
           * Module: WF-Links
           * Version: v1.0.9
          Severity: Major
          Found in xoops_version.php - About 1 day to fix

            File sbookmarks.php has 710 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            /**
             * Module: WF-Links
             * Developer: McDonald
            Severity: Major
            Found in sbookmarks.php - About 1 day to fix

              File modinfo.php has 642 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /**
               * Module: WF-links
               * Version: v1.0.3
               * Release Date: 21 June 2005
              Severity: Major
              Found in language/english/modinfo.php - About 1 day to fix

                Method getCountryName has 260 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function getCountryName($countryn)
                    {
                        $country_array = [
                            ''   => 'Unknown',
                            '-'  => 'Unknown',
                Severity: Major
                Found in class/Utility.php - About 1 day to fix

                  Method edit has 255 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function edit($lid = 0)
                  {
                      global $xoopsDB, $myts, $mytree, $imageArray, $xoopsConfig, $xoopsModule, $xoopsUser;
                      /** @var Helper $helper */
                      $helper = Helper::getInstance();
                  Severity: Major
                  Found in admin/main.php - About 1 day to fix

                    File main.php has 586 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    /**
                     * Module: WF-Links
                     * Version: v1.0.3
                     * Release Date: 21 June 2005
                    Severity: Major
                    Found in admin/main.php - About 1 day to fix

                      Method listBlocks has 213 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function listBlocks()
                          {
                              global $xoopsModule, $pathIcon16;
                              require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                              $moduleDirName      = basename(dirname(__DIR__));
                      Severity: Major
                      Found in admin/blocksadmin.php - About 1 day to fix

                        Function xoops_module_update_wflinks has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function xoops_module_update_wflinks(\XoopsModule $module, $previousVersion = null)
                        {
                            $moduleDirName      = basename(dirname(__DIR__));
                            $moduleDirNameUpper = mb_strtoupper($moduleDirName);
                        
                        
                        Severity: Minor
                        Found in include/onupdate.php - About 1 day 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 truncateHtml has a Cognitive Complexity of 53 (exceeds 5 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: Minor
                        Found in class/Common/SysUtility.php - About 1 day 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 list_blocks has 204 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function list_blocks()
                        {
                            global $query4redirect, $block_arr;
                            // cachetime options
                            $cachetimes = [
                        Severity: Major
                        Found in admin/myblocksadmin.php - About 1 day to fix

                          File blocksadmin.php has 491 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 admin/blocksadmin.php - About 7 hrs to fix

                            Function list_blocks has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function list_blocks()
                            {
                                global $query4redirect, $block_arr;
                                // cachetime options
                                $cachetimes = [
                            Severity: Minor
                            Found in admin/myblocksadmin.php - About 7 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 admin.php has 441 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            <?php
                            
                            /**
                             * Module: WF-links
                             * Version: v1.0.3
                            Severity: Minor
                            Found in language/english/admin.php - About 6 hrs to fix

                              Function listBlocks has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  function listBlocks()
                                  {
                                      global $xoopsModule, $pathIcon16;
                                      require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                                      $moduleDirName      = basename(dirname(__DIR__));
                              Severity: Minor
                              Found in admin/blocksadmin.php - About 6 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

                              Utility has 42 functions (exceeds 20 allowed). Consider refactoring.
                              Open

                              class Utility extends Common\SysUtility
                              {
                                  //--------------- Custom module methods -----------------------------
                                  /**
                                   * getHandler()
                              Severity: Minor
                              Found in class/Utility.php - About 5 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language