XoopsModules25x/lexikon

View on GitHub
class/Utility.php

Summary

Maintainability
F
2 wks
Test Coverage

File Utility.php has 1187 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace XoopsModules\Lexikon;

/*
Severity: Major
Found in class/Utility.php - About 3 days to fix

    Function truncateHtml has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
        {
            if ($considerHtml) {
                // if the plain text is shorter than the maximum length, return the whole text
                if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
    Severity: Minor
    Found in class/Utility.php - About 1 day 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

    Utility has 43 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Utility extends Common\SysUtility
    {
        //--------------- Custom module methods -----------------------------
        /**
         * static::getLinkedUnameFromId()
    Severity: Minor
    Found in class/Utility.php - About 5 hrs to fix

      Method extractKeywords has 116 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function extractKeywords($content)
          {
              global $xoopsTpl, $xoTheme, $xoopsModule;
      
              $helper = Helper::getInstance();
      Severity: Major
      Found in class/Utility.php - About 4 hrs to fix

        Method removeAccents has 93 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function removeAccents($string)
            {
                $chars['in']  = \chr(128)
                                . \chr(131)
                                . \chr(138)
        Severity: Major
        Found in class/Utility.php - About 3 hrs to fix

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

              public static function extractKeywords($content)
              {
                  global $xoopsTpl, $xoTheme, $xoopsModule;
          
                  $helper = Helper::getInstance();
          Severity: Minor
          Found in class/Utility.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 getModuleHeader has a Cognitive Complexity of 19 (exceeds 5 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 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 truncateHtml has 63 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
              {
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
                      if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
          Severity: Major
          Found in class/Utility.php - About 2 hrs to fix

            Method getServiceLinks has 60 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function getServiceLinks($variable)
                {
                    global $xoopsUser, $xoopsDB, $xoopsModule, $xoopsConfig, $entrytype;
            
                    $helper = Helper::getInstance();
            Severity: Major
            Found in class/Utility.php - About 2 hrs to fix

              Function isUtf8 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function isUtf8($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 class/Utility.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 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 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 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

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

                          public static function getLinkedUnameFromId($userid = 0, $name = 0)
                          {
                              if (!\is_numeric($userid)) {
                                  return $userid;
                              }
                      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 getAlphaArray has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function getAlphaArray()
                          {
                              global $xoopsUser, $xoopsDB, $xoopsModule;
                              $grouppermHandler = \xoops_getHandler('groupperm');
                              $groups           = \is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
                      Severity: Minor
                      Found in class/Utility.php - About 1 hr to fix

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

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

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

                                public static function getServiceLinksNew($variable)
                                {
                                    global $xoopsUser, $xoopsDB, $xoopsModule, $xoopsConfig, $myts;
                            
                                    $helper    = Helper::getInstance();
                            Severity: Minor
                            Found in class/Utility.php - About 1 hr to fix

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

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

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

                                    public static function getFormSearch($type = '3', $categoryID = '0', $term = '')
                                    {
                                        global $xoopsUser, $xoopsDB, $xoopsModule, $xoopsConfig;
                                
                                        $helper = Helper::getInstance();
                                Severity: Minor
                                Found in class/Utility.php - About 1 hr to fix

                                  Method getCategoryArray has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

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

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

                                        public static function getCategoryArray()
                                        {
                                            global $xoopsDB, $xoopsUser, $xoopsModule;
                                    
                                            $helper           = Helper::getInstance();
                                    Severity: Minor
                                    Found in class/Utility.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 getWysiwygForm has a Cognitive Complexity of 8 (exceeds 5 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 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 getServiceLinks has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        public static function getServiceLinks($variable)
                                        {
                                            global $xoopsUser, $xoopsDB, $xoopsModule, $xoopsConfig, $entrytype;
                                    
                                            $helper = Helper::getInstance();
                                    Severity: Minor
                                    Found in class/Utility.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

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

                                        public static function getWysiwygForm($caption, $name, $value = '', $width = '100%', $height = '400px', $supplemental = '')
                                    Severity: Minor
                                    Found in class/Utility.php - About 45 mins to fix

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

                                          public static function getAlphaArray()
                                          {
                                              global $xoopsUser, $xoopsDB, $xoopsModule;
                                              $grouppermHandler = \xoops_getHandler('groupperm');
                                              $groups           = \is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
                                      Severity: Minor
                                      Found in class/Utility.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

                                      Method truncateHtml has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
                                      Severity: Minor
                                      Found in class/Utility.php - About 35 mins to fix

                                        Function getEditor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            public static function getEditor($helper = null, $options = null)
                                            {
                                        
                                                if (null === $options) {
                                                    $options           = [];
                                        Severity: Minor
                                        Found in class/Utility.php - About 35 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 getFormSearch has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            public static function getFormSearch($type = '3', $categoryID = '0', $term = '')
                                            {
                                                global $xoopsUser, $xoopsDB, $xoopsModule, $xoopsConfig;
                                        
                                                $helper = Helper::getInstance();
                                        Severity: Minor
                                        Found in class/Utility.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 getHTMLHighlight has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            public static function getHTMLHighlight($needle, $haystack, $hlS, $hlE)
                                            {
                                                $parts = \explode('>', $haystack);
                                                foreach ($parts as $key => $part) {
                                                    $pL = '';
                                        Severity: Minor
                                        Found in class/Utility.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

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

                                            public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
                                            {
                                                if ($considerHtml) {
                                                    // if the plain text is shorter than the maximum length, return the whole text
                                                    if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
                                        Severity: Major
                                        Found in class/Utility.php and 1 other location - About 3 days to fix
                                        class/Common/SysUtility.php on lines 64..153

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

                                        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

                                            public static function getFormSearch($type = '3', $categoryID = '0', $term = '')
                                            {
                                                global $xoopsUser, $xoopsDB, $xoopsModule, $xoopsConfig;
                                        
                                                $helper = Helper::getInstance();
                                        Severity: Major
                                        Found in class/Utility.php and 1 other location - About 2 days to fix
                                        class/Entries.php on lines 90..129

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

                                        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

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

                                        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 class/Utility.php and 1 other location - About 4 hrs to fix
                                        include/functions.php on lines 783..822

                                        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

                                                for ($a = 65; $a < (65 + 26); ++$a) {
                                                    $letterlinks             = [];
                                                    $initial                 = unichr($a);
                                                    $sql                     = $xoopsDB->query('SELECT entryID FROM ' . $xoopsDB->prefix('lxentries') . " WHERE init = '$initial' AND submit = '0' AND offline ='0' AND request = '0' " . $catperms . '');
                                                    $howmany                 = $xoopsDB->getRowsNum($sql);
                                        Severity: Major
                                        Found in class/Utility.php and 1 other location - About 3 hrs to fix
                                        class/Utility.php on lines 231..241

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

                                        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

                                                for ($a = 48; $a < (48 + 10); ++$a) {
                                                    $letterlinks             = [];
                                                    $initial                 = unichr($a);
                                                    $sql                     = $xoopsDB->query('SELECT entryID FROM ' . $xoopsDB->prefix('lxentries') . " WHERE init = '$initial' AND submit = '0' AND offline ='0' AND request = '0' " . $catperms . '');
                                                    $howmany                 = $xoopsDB->getRowsNum($sql);
                                        Severity: Major
                                        Found in class/Utility.php and 1 other location - About 3 hrs to fix
                                        class/Utility.php on lines 242..252

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

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

                                            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

                                            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

                                        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 class/Utility.php and 1 other location - About 1 hr to fix
                                        include/functions.php on lines 273..293

                                        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

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

                                        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