XoopsModules25x/lexikon

View on GitHub

Showing 216 of 316 total issues

Function b_scrolling_term_show has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

function b_scrolling_term_show($options)
{
    global $xoopsDB, $xoopsUser;
    $myts = MyTextSanitizer:: getInstance();
    $utility = new Utility();
Severity: Minor
Found in blocks/entries_scrolling.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 showTooltip has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function showTooltip(e, tooltipTxt) {

    var bodyWidth = Math.max(document.body.clientWidth, document.documentElement.clientWidth) - 20;

    if (!dhtmlgoodies_tooltip) {
Severity: Minor
Found in assets/js/shadowtooltip.js - About 1 hr to fix

    Method updateBlock has 46 lines of code (exceeds 25 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 1 hr to fix

      Method printPage has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function printPage($entryID)
      {
          global $xoopsConfig, $xoopsDB, $xoopsModule, $myts;
      
          $helper  = Helper::getInstance();
      Severity: Minor
      Found in print.php - About 1 hr to fix

        Method xoops_module_update_lexikon_v152 has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function xoops_module_update_lexikon_v152($xoopsModule)
        {
            /**
             * Create default upload directories
             */
        Severity: Minor
        Found in include/update_function.php - About 1 hr to fix

          Method getWysiwygForm has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function getWysiwygForm($caption, $name, $value = '', $width = '100%', $height = '400px', $supplemental = '')
              {
                  $editor_option            = mb_strtolower(static::getModuleOption('form_options'));
                  $editor                   = false;
                  $editor_configs           = [];
          Severity: Minor
          Found in class/Utility.php - About 1 hr to fix

            Function b_lxentries_random_show has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

            function b_lxentries_random_show()
            {
                global $xoopsDB, $xoopsUser, $xoopsConfig, $xoopsModule;
                $myts = \MyTextSanitizer::getInstance();
            
            
            Severity: Minor
            Found in blocks/random_term.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_close_tags has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

            function lx_close_tags($string)
            {
                // match opened tags
                if (preg_match_all('/<([a-z\:\-]+)[^\/]>/', $string, $start_tags)) {
                    $start_tags = $start_tags[1];
            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 closeTags has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function closeTags($string)
                {
                    // match opened tags
                    if (\preg_match_all('/<([a-z\:\-]+)[^\/]>/', $string, $start_tags)) {
                        $start_tags = $start_tags[1];
            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 getModuleHeader has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function getModuleHeader()
                {
                    global $xoopsTpl, $xoTheme, $xoopsModule, $lexikon_module_header;
            
                    $helper = Helper::getInstance();
            Severity: Minor
            Found in class/Utility.php - About 1 hr to fix

              Method checkVerModule has 42 lines of code (exceeds 25 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 1 hr to fix

                Method lx_module_header has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function lx_module_header()
                {
                    global $xoopsTpl, $xoTheme, $xoopsModule, $xoopsModuleConfig, $lexikon_module_header;
                    if (isset($xoTheme) && is_object($xoTheme)) {
                        $xoTheme->addStylesheet('modules/lexikon/assets/css/style.css');
                Severity: Minor
                Found in include/functions.php - About 1 hr to fix

                  Method cloneBlock has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function cloneBlock($bid)
                      {
                  
                          xoops_cp_header();
                  
                  
                  Severity: Minor
                  Found in admin/blocksadmin.php - About 1 hr to fix

                    Function loadTableFromArrayWithReplace has a Cognitive Complexity of 13 (exceeds 5 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

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

                    function categoryEdit($categoryID = '')
                    {
                        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
                        require_once XOOPS_ROOT_PATH . '/class/uploader.php';
                        require_once XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php';
                    Severity: Minor
                    Found in admin/category.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 lx_collapsableBar has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function lx_collapsableBar($tablename = '', $iconname = '')
                    {
                        ?>
                        <script type="text/javascript"><!--
                            function goto_URL(object) {
                    Severity: Minor
                    Found in admin/functions.php - About 1 hr to fix

                      Method editBlock has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function editBlock($bid)
                          {
                              xoops_cp_header();
                              /** @var \Xmf\Module\Admin $adminObject */
                              $adminObject = Admin::getInstance();
                      Severity: Minor
                      Found in admin/blocksadmin.php - About 1 hr to fix

                        Method lx_getWysiwygForm has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function &lx_getWysiwygForm($caption, $name, $value = '', $width = '100%', $height = '400px', $supplemental = '')
                        {
                            $editor_option            = mb_strtolower(lx_getmoduleoption('form_options'));
                            $editor                   = false;
                            $editor_configs           = [];
                        Severity: Minor
                        Found in include/functions.php - About 1 hr to fix

                          Method b_lxentries_top_show has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

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

                            Method b_lxentries_new_show has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function b_lxentries_new_show($options)
                            {
                                global $xoopsDB, $xoopsUser;
                            
                                $myts = MyTextSanitizer:: getInstance();
                            Severity: Minor
                            Found in blocks/entries_new.php - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language