mambax7/gwiki

View on GitHub

Showing 181 of 181 total issues

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 b_gwiki_linkshere_show has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function b_gwiki_linkshere_show($options)
{
    global $xoTheme, $xoopsDB;

    $block = false;
Severity: Minor
Found in blocks/blocks.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 b_gwiki_recentblock_show has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function b_gwiki_recentblock_show($options)
{
    global $xoopsDB, $xoTheme;

    $block = false;
Severity: Minor
Found in blocks/blocks.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 b_gwiki_pagesettoc_show has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function b_gwiki_pagesettoc_show($options)
{
    global $xoTheme;

    $block = false;
Severity: Minor
Found in blocks/blocks.php - About 1 hr to fix

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

    function showPage($page, $id)
    {
        global $xoopsDB, $wikiPage, $xoTheme;
        $helper = Helper::getInstance();
    
    
    Severity: Minor
    Found in admin/pages.php - About 1 hr to fix

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

          protected function resetPage()
          {
              $this->gwiki_id         = null;
              $this->keyword          = '';
              $this->display_keyword  = '';
      Severity: Minor
      Found in class/GwikiPage.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 galleryForm has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function galleryForm()
          {
              global $wikiPage, $xoopsTpl;
              $helper = Helper::getInstance();
          
          
          Severity: Minor
          Found in wizard.php - About 1 hr to fix

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

            function b_gwiki_teaserblock_edit($options)
            {
                $form = '';
                $form .= _MB_GWIKI_SHOW_FULL_PAGE . ' <input type="radio" name="options[0]" value="1" ';
                if ($options[0]) {
            Severity: Minor
            Found in blocks/blocks.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 getPlain has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function getPlain($count, $loremipsum, $returnStr = true)
                    {
                        $words = [];
                        $this->getWords($words, $count, $loremipsum);
                        //print_r($words);
                Severity: Minor
                Found in testing/LoremIpsumGenerator.php - About 1 hr to fix

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

                  function doImportText($page, $dir)
                  {
                      $import   = '';
                      $pathname = XOOPS_ROOT_PATH . '/uploads/' . $dir . '/';
                      if (isset($_POST['xoops_upload_file'][0])) {
                  Severity: Minor
                  Found in wizard.php - About 1 hr to fix

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

                    function prefixForm($row, $action)
                    {
                        if (empty($row)) {
                            return false;
                        }
                    Severity: Minor
                    Found in admin/prefixes.php - About 1 hr to fix

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

                          private function convertEntities($body)
                          {
                              // convert some entites
                              $sym   = [];
                              $ent   = [];
                      Severity: Minor
                      Found in class/GwikiPage.php - About 1 hr to fix

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

                            private function renderBox($matches)
                            {
                                $type  = $matches[1];
                                $title = $matches[2];
                                $body  = $matches[3];
                        Severity: Minor
                        Found in class/GwikiPage.php - About 1 hr to fix

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

                          function adminTableEnd($links)
                          {
                              echo '</table>';
                          
                              if (!empty($links)) {
                          Severity: Minor
                          Found in admin/functions.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 _printDiff has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                              protected function _printDiff($c, $s1, $s2, $i, $j)
                              {
                                  $diff = '';
                                  if ($i >= 0 && $j >= 0 && $s1[$i] === $s2[$j]) {
                                      $diff .= $this->_printDiff($c, $s1, $s2, $i - 1, $j - 1);
                          Severity: Minor
                          Found in include/Diff.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 _lsm has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                              protected function _lsm($s1, $s2)
                              {
                                  $mStart = 0;
                                  $mEnd   = \count($s1) - 1;
                                  $nStart = 0;
                          Severity: Minor
                          Found in class/Library/Diff.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 fetchPageSet has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function fetchPageSet($page)
                          {
                              global $xoopsDB, $wikiPage, $page_set_home, $display_keyword;
                          
                              $q_page = $wikiPage->escapeForDB($page);
                          Severity: Minor
                          Found in sortpageset.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 gwiki_search has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function gwiki_search($queryarray, $andor, $limit, $offset, $userid, $prefix = null)
                          {
                              global $xoopsDB;
                          
                              $dir = \basename(\dirname(__DIR__));
                          Severity: Minor
                          Found in include/search.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

                          Severity
                          Category
                          Status
                          Source
                          Language