XoopsModules25x/lexikon

View on GitHub

Showing 316 of 316 total issues

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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            public static function getUserForm($user)
            {
                global $xoopsDB, $xoopsConfig;
        
                echo "<select name='author'>";
        Severity: Major
        Found in class/Utility.php and 1 other location - About 1 hr to fix
        include/functions.php on lines 64..81

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 111.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        function lx_getuserForm($user)
        {
            global $xoopsDB, $xoopsConfig;
        
            echo "<select name='author'>";
        Severity: Major
        Found in include/functions.php and 1 other location - About 1 hr to fix
        class/Utility.php on lines 76..93

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 111.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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

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

                  public static function getAuthorProfile($uid)
                  {
                      require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
                      global $authortermstotal, $xoopsTpl, $xoopsDB, $xoopsUser;
              
              
              Severity: Minor
              Found in class/Utility.php - About 1 hr to fix

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

                    public static function convertHtml2text($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 class/Utility.php - About 1 hr to fix

                  Method b_lxspot_edit has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function b_lxspot_edit($options)
                  {
                      global $xoopsDB;
                      $myts      = MyTextSanitizer:: getInstance();
                      $resultcat = $xoopsDB->query('SELECT categoryID, name FROM ' . $xoopsDB->prefix('lxcategories') . ' ORDER BY categoryID');
                  Severity: Minor
                  Found in blocks/entries_spot.php - About 1 hr to fix

                    Method myblocksadmin_update_blockinstance has 36 lines of code (exceeds 25 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

                      Method makeMySelBox has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function makeMySelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = '')
                          {
                              if ('' == $sel_name) {
                                  $sel_name = $this->id;
                              }
                      Severity: Minor
                      Found in class/LexikonTree.php - About 1 hr to fix

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                            public static function meta_keywords($content)
                            {
                                global $xoopsTpl, $xoTheme;
                                $myts    = \MyTextSanitizer::getInstance();
                                $content = $myts->undoHtmlSpecialChars($myts->displayTarea($content));
                        Severity: Major
                        Found in class/Utility.php and 1 other location - About 1 hr to fix
                        class/Utility.php on lines 1535..1545

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 109.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                                    if ($display) {
                                        $ret[$i]['image'] = 'assets/images/lx.png';
                                        $ret[$i]['link']  = 'entry.php?entryID=' . $myrow['com_itemid'] . $hightlight_key;
                                        $ret[$i]['title'] = $myrow['com_title'];
                                        $ret[$i]['time']  = $myrow['com_created'];
                        Severity: Major
                        Found in include/search.inc.php and 1 other location - About 1 hr to fix
                        include/search.inc.php on lines 91..98

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 109.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                                if ($display) {
                                    $ret[$i]['image'] = 'assets/images/lx.png';
                                    $ret[$i]['link']  = 'entry.php?entryID=' . $myrow['entryID'] . $hightlight_key;
                                    $ret[$i]['title'] = $myrow['term'];
                                    $ret[$i]['time']  = $myrow['datesub'];
                        Severity: Major
                        Found in include/search.inc.php and 1 other location - About 1 hr to fix
                        include/search.inc.php on lines 140..147

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 109.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                            public static function meta_description($content)
                            {
                                global $xoopsTpl, $xoTheme;
                                $myts    = \MyTextSanitizer::getInstance();
                                $content = $myts->undoHtmlSpecialChars($myts->displayTarea($content));
                        Severity: Major
                        Found in class/Utility.php and 1 other location - About 1 hr to fix
                        class/Utility.php on lines 1520..1530

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 109.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Function lx_getLinkedUnameFromId has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function lx_getLinkedUnameFromId($userid = 0, $name = 0)
                        {
                            if (!is_numeric($userid)) {
                                return $userid;
                            }
                        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

                        Severity
                        Category
                        Status
                        Source
                        Language