XoopsModules25x/lexikon

View on GitHub
include/functions.php

Summary

Maintainability
F
1 wk
Test Coverage

File functions.php has 984 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * $Id: functions.php v 1.0 8 May 2004 hsalazar Exp $
 * Module: Lexikon
 * Author: hsalazar
Severity: Major
Found in include/functions.php - About 2 days to fix

    Method lx_extract_keywords has 115 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function lx_extract_keywords($content)
    {
        global $xoopsTpl, $xoTheme, $xoopsModule, $xoopsModuleConfig;
        require_once XOOPS_ROOT_PATH . '/modules/lexikon/include/common.inc.php';
        $keywords_count = $helper->getConfig('metakeywordsnum');
    Severity: Major
    Found in include/functions.php - About 4 hrs to fix

      Method lx_removeAccents has 105 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function lx_removeAccents($string)
      {
          $chars['in']  = chr(128)
                          . chr(131)
                          . chr(138)
      Severity: Major
      Found in include/functions.php - About 4 hrs to fix

        Function lx_extract_keywords has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

        function lx_extract_keywords($content)
        {
            global $xoopsTpl, $xoTheme, $xoopsModule, $xoopsModuleConfig;
            require_once XOOPS_ROOT_PATH . '/modules/lexikon/include/common.inc.php';
            $keywords_count = $helper->getConfig('metakeywordsnum');
        Severity: Minor
        Found in include/functions.php - About 3 hrs 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_module_header has a Cognitive Complexity of 19 (exceeds 5 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 2 hrs 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_serviceLinks has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function lx_serviceLinks($variable)
        {
            global $xoopsUser, $xoopsDB, $xoopsModule, $xoopsModuleConfig, $xoopsConfig, $entrytype;
        
            /** @var \XoopsModuleHandler $moduleHandler */
        Severity: Major
        Found in include/functions.php - About 2 hrs to fix

          Function lx_seemsUtf8 has a Cognitive Complexity of 17 (exceeds 5 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 2 hrs 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

          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 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

              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

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

                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 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

                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 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 lx_serviceLinksnew has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function lx_serviceLinksnew($variable)
                      {
                          global $xoopsUser, $xoopsDB, $xoopsModule, $xoopsModuleConfig, $xoopsConfig, $myts;
                          $srvlinks2 = '<a title="'
                                       . _MD_LEXIKON_PRINTTERM
                      Severity: Minor
                      Found in include/functions.php - About 1 hr to fix

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

                        function lx_AuthorProfile($uid)
                        {
                            require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
                            global $authortermstotal, $xoopsTpl, $xoopsDB, $xoopsUser, $xoopsModuleConfig;
                            $myts = \MyTextSanitizer::getInstance();
                        Severity: Minor
                        Found in include/functions.php - About 1 hr to fix

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

                          function lx_showSearchForm()
                          {
                              global $xoopsUser, $xoopsDB, $xoopsModule, $xoopsModuleConfig, $xoopsConfig;
                              /** @var \XoopsGroupPermHandler $grouppermHandler */
                              $grouppermHandler = xoops_getHandler('groupperm');
                          Severity: Minor
                          Found in include/functions.php - About 1 hr to fix

                            Method lx_CatsArray has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function lx_CatsArray()
                            {
                                global $xoopsDB, $xoopsModuleConfig, $xoopsUser, $xoopsModule;
                                $myts   = \MyTextSanitizer::getInstance();
                                $groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
                            Severity: Minor
                            Found in include/functions.php - About 1 hr to fix

                              Method lx_getWysiwygForm has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              function &lx_getWysiwygForm($caption, $name, $value = '', $width = '100%', $height = '400px', $supplemental = '')
                              Severity: Minor
                              Found in include/functions.php - About 45 mins to fix

                                Function lx_serviceLinks has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function lx_serviceLinks($variable)
                                {
                                    global $xoopsUser, $xoopsDB, $xoopsModule, $xoopsModuleConfig, $xoopsConfig, $entrytype;
                                
                                    /** @var \XoopsModuleHandler $moduleHandler */
                                Severity: Minor
                                Found in include/functions.php - About 45 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 lx_CatsArray has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function lx_CatsArray()
                                {
                                    global $xoopsDB, $xoopsModuleConfig, $xoopsUser, $xoopsModule;
                                    $myts   = \MyTextSanitizer::getInstance();
                                    $groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
                                Severity: Minor
                                Found in include/functions.php - About 45 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 lx_getWysiwygForm has a Cognitive Complexity of 8 (exceeds 5 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 45 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 lx_getHTMLHighlight has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function lx_getHTMLHighlight($needle, $haystack, $hlS, $hlE)
                                {
                                    $parts = explode('>', $haystack);
                                    foreach ($parts as $key => $part) {
                                        $pL = '';
                                Severity: Minor
                                Found in include/functions.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 lx_showSearchForm has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function lx_showSearchForm()
                                {
                                    global $xoopsUser, $xoopsDB, $xoopsModule, $xoopsModuleConfig, $xoopsConfig;
                                    /** @var \XoopsGroupPermHandler $grouppermHandler */
                                    $grouppermHandler = xoops_getHandler('groupperm');
                                Severity: Minor
                                Found in include/functions.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

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

                                function lexikon_summary()
                                {
                                    global $xoopsDB;
                                
                                    $summary = [];
                                Severity: Major
                                Found in include/functions.php and 1 other location - About 1 day to fix
                                class/Utility.php on lines 1418..1460

                                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 251.

                                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

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

                                    if (isset($xoTheme) && is_object($xoTheme)) {
                                        $xoTheme->addStylesheet('modules/lexikon/assets/css/style.css');
                                        if (3 == $helper->getConfig('linkterms')) {
                                            $xoTheme->addStylesheet('modules/lexikon/assets/css/linkterms.css');
                                            $xoTheme->addScript('/modules/lexikon/assets/js/tooltipscript2.js', ['type' => 'text/javascript']);
                                Severity: Major
                                Found in include/functions.php and 1 other location - About 4 hrs to fix
                                class/Utility.php on lines 898..937

                                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 169.

                                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

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

                                    if ($xoopsUser) {
                                        if ($xoopsUser->isAdmin()) {
                                            $srvlinks .= '<a title="'
                                                         . _EDIT
                                                         . '" href="admin/entry.php?op=mod&entryID='
                                Severity: Major
                                Found in include/functions.php and 1 other location - About 1 hr to fix
                                class/Utility.php on lines 316..336

                                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 104.

                                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

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

                                function lx_getAuthors($limit = 0, $start = 0)
                                {
                                    global $xoopsDB;
                                
                                    $ret    = [];
                                Severity: Minor
                                Found in include/functions.php and 1 other location - About 30 mins to fix
                                class/Utility.php on lines 1028..1041

                                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 90.

                                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

                                There are no issues that match your filters.

                                Category
                                Status