mambax7/wflinks

View on GitHub

Showing 155 of 201 total issues

Avoid too many return statements within this method.
Open

    return null;
Severity: Major
Found in include/notification.inc.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                            return false;
    Severity: Major
    Found in class/ThumbsNails.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return false;
      Severity: Major
      Found in class/ThumbsNails.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

            return null;
        Severity: Major
        Found in admin/main.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                              return $this->_source_url . "/{$this->_img_savepath}/{$savefile}";
          Severity: Major
          Found in class/ThumbsNails.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return $image;
            Severity: Major
            Found in class/ThumbsNails.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return round($laptime, 3);
              Severity: Major
              Found in admin/main.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return "{$this->_img_savepath}/{$savefile}";
                Severity: Major
                Found in class/ThumbsNails.php - About 30 mins to fix

                  Function loadSampleData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function loadSampleData()
                  {
                      global $xoopsConfig;
                      $moduleDirName      = basename(dirname(__DIR__));
                      $moduleDirNameUpper = mb_strtoupper($moduleDirName);
                  Severity: Minor
                  Found in testdata/index.php - About 25 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 getForum has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function getForum($forumid)
                      {
                          global $xoopsDB, $xoopsConfig;
                  
                          echo "<select name='forumid'>";
                  Severity: Minor
                  Found in class/Utility.php - About 25 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 xoops_module_install_wflinks has a Cognitive Complexity of 6 (exceeds 5 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 25 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 isNewImage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function isNewImage($published)
                      {
                          global $xoopsModule, $xoopsDB;
                  
                          $oneday    = (\time() - (86400 * 1));
                  Severity: Minor
                  Found in class/Utility.php - About 25 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 convertIPAddresses has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function convertIPAddresses($tableName, $columnName)
                      {
                          if ($this->tableHandler->useTable($tableName)) {
                              $attributes = $this->tableHandler->getColumnAttributes($tableName, $columnName);
                              if (false !== mb_strpos($attributes, ' int(')) {
                  Severity: Minor
                  Found in class/Common/Migrate.php - About 25 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 getLinkListBody has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function getLinkListBody($published)
                      {
                          global $myts, $imageArray, $xoopsModule;
                          /** @var Wflinks\Helper $helper */
                          $helper = Wflinks\Helper::getInstance();
                  Severity: Minor
                  Found in class/Utility.php - About 25 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 xoops_module_uninstall_wflinks has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function xoops_module_uninstall_wflinks(\XoopsModule $module)
                  {
                      //    return true;
                  
                      $moduleDirName = basename(dirname(__DIR__));
                  Severity: Minor
                  Found in include/onuninstall.php - About 25 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

                  Severity
                  Category
                  Status
                  Source
                  Language