XoopsModules25x/lexikon

View on GitHub

Showing 216 of 316 total issues

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

        function setPermissions($myArray, $permissionGroup, $categoryID, $grouppermHandler, $permissionName, $mid)
        {
            $permissionArray = $myArray;
            if ($categoryID > 0) {
                $sql = 'DELETE FROM `' . $GLOBALS['xoopsDB']->prefix('group_permission') . "` WHERE `gperm_name` = '" . $permissionName . "' AND `gperm_itemid`= $categoryID;";
Severity: Minor
Found in admin/categories.php - About 1 hr to fix

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

    function lx_getmoduleoption($option, $repmodule = 'lexikon')
    {
        global $xoopsModuleConfig, $xoopsModule;
        static $tbloptions = [];
        if (is_array($tbloptions) && array_key_exists($option, $tbloptions)) {
    Severity: Minor
    Found in include/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 lexikon_block_getAuthors has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    function lexikon_block_getAuthors($limit = 5, $sort = 'count', $name = 'uname', $compute_method = 'average')
    {
        $limit = (int)$limit;
        if ('uname' !== $name) {
            $name = 'name';
    Severity: Minor
    Found in include/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 myblocksadmin_update_blockinstance has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    function myblocksadmin_update_blockinstance(
        $id,
        $bside,
        $bweight,
        $bvisible,
    Severity: Minor
    Found in include/blocksadmin.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

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

    function lx_create_pagetitle($article = '', $topic = '')
    {
        global $xoopsModule, $xoopsTpl;
        $myts    = \MyTextSanitizer::getInstance();
        $content = '';
    Severity: Minor
    Found in include/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 lx_Statistics has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    function lx_Statistics()
    {
        global $xoopsModule, $xoopsConfig;
        $helper = Helper::getInstance();
        xoops_load('XoopsUserUtility');
    Severity: Minor
    Found in admin/statistics.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 getBlockAuthors has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function getBlockAuthors($limit = 5, $sort = 'count', $name = 'uname', $compute_method = 'average')
          {
              $limit = (int)$limit;
              if ('uname' !== $name) {
                  $name = 'name';
      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 getModuleOption has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function getModuleOption($option, $repmodule = 'lexikon')
          {
              global $xoopsModuleConfig, $xoopsModule;
              static $tbloptions = [];
              if (\is_array($tbloptions) && \array_key_exists($option, $tbloptions)) {
      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 createPageTitle has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function createPageTitle($article = '', $topic = '')
          {
              global $xoopsModule, $xoopsTpl;
              $myts    = \MyTextSanitizer::getInstance();
              $content = '';
      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 categoryDelete has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function categoryDelete($categoryID = '')
      {
          //global $xoopsDB, $xoopsConfig;
          global $xoopsConfig, $xoopsDB, $xoopsModule;
          $idc = Request::getInt('categoryID', '');
      Severity: Minor
      Found in admin/category.php - About 1 hr to fix

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

        function lx_html2text($document)
        {
            // PHP Manual:: function preg_replace $document should contain an HTML document.
            // This will remove HTML tags, javascript sections and white space. It will also
            // convert some common HTML entities to their text equivalent.
        Severity: Minor
        Found in include/functions.php - About 1 hr to fix

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

          function lexikon_tag_iteminfo(&$items)
          {
              if (empty($items) || !is_array($items)) {
                  return false;
              }
          Severity: Minor
          Found in class/plugins/plugin.tag.php - About 1 hr to fix

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

            function lexikon_tag_iteminfo(&$items)
            {
                if (empty($items) || !is_array($items)) {
                    return false;
                }
            Severity: Minor
            Found in include/plugin.tag.php - About 1 hr to fix

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

              function b_lxcategories_show($options)
              {
                  global $xoopsDB, $xoopsUser;
                  $myts = MyTextSanitizer:: getInstance();
              
              
              Severity: Minor
              Found in blocks/categories_block.php - About 1 hr to fix

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

                function lx_seemsUtf8($Str)
                { # by bmorel at ssi dot fr
                    for ($i = 0, $iMax = mb_strlen($Str); $i < $iMax; ++$i) {
                        if (ord($Str[$i]) < 0x80) {
                            continue;
                Severity: Minor
                Found in include/functions.php - About 1 hr to fix

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

                  function lexikon_summary()
                  {
                      global $xoopsDB;
                  
                      $summary = [];
                  Severity: Minor
                  Found in include/functions.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 getSummary has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function getSummary()
                          {
                              global $xoopsDB;
                      
                              $summary = [];
                      Severity: Minor
                      Found in class/Utility.php - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language