XoopsModules25x/lexikon

View on GitHub

Showing 316 of 316 total issues

Method b_lxentries_alpha_show has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function b_lxentries_alpha_show($options)
{
    global $xoopsDB, $xoopsUser, $xoopsModule;
    $myts = \MyTextSanitizer::getInstance();

Severity: Major
Found in blocks/entries_initial.php - About 2 hrs to fix

    Method b_scrolling_term_edit has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function b_scrolling_term_edit($options)
    {
        global $xoopsDB;
        $myts = MyTextSanitizer:: getInstance();
        $form = "<table style='width:100%' class='bg2'>";
    Severity: Minor
    Found in blocks/entries_scrolling.php - About 1 hr to fix

      Method render has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function render()
          {
              // load all child ids for javascript codes
              foreach (\array_keys($this->_itemTree) as $item_id) {
                  $this->_itemTree[$item_id]['allchild'] = [];
      Severity: Minor
      Found in class/GroupPermForm.php - About 1 hr to fix

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

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

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function showTooltip has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function showTooltip(e, tooltipTxt) {
        
            var bodyWidth = Math.max(document.body.clientWidth, document.documentElement.clientWidth) - 20;
        
            if (!dhtmlgoodies_tooltip) {
        Severity: Minor
        Found in assets/js/shadowtooltip.js - About 1 hr to fix

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

              function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
              {
                  $myblock = new \XoopsBlock($bid);
                  $myblock->setVar('title', $btitle);
                  $myblock->setVar('weight', $bweight);
          Severity: Minor
          Found in admin/blocksadmin.php - About 1 hr to fix

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

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

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

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

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

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

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

                  <?php
                  
                  return [
                      '0',
                      '1',
                  Severity: Major
                  Found in language/english/alphabet.php and 1 other location - About 1 hr to fix
                  language/german/alphabet.php on lines 1..41

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

                  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

                  <?php
                  
                  return [
                      '0',
                      '1',
                  Severity: Major
                  Found in language/german/alphabet.php and 1 other location - About 1 hr to fix
                  language/english/alphabet.php on lines 1..41

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

                  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 3 locations. Consider refactoring.
                  Open

                  if (!function_exists('mb_ucfirst') && function_exists('mb_substr')) {
                      /**
                       * @param $string
                       * @return string
                       */
                  Severity: Major
                  Found in letter.php and 2 other locations - About 1 hr to fix
                  index.php on lines 53..65
                  submit.php on lines 43..55

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

                  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 3 locations. Consider refactoring.
                  Open

                  if (!function_exists('mb_ucfirst') && function_exists('mb_substr')) {
                      /**
                       * @param $string
                       * @return string
                       */
                  Severity: Major
                  Found in index.php and 2 other locations - About 1 hr to fix
                  letter.php on lines 48..60
                  submit.php on lines 43..55

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

                  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 3 locations. Consider refactoring.
                  Open

                  if (!function_exists('mb_ucfirst') && function_exists('mb_substr')) {
                      /**
                       * @param $string
                       * @return string
                       */
                  Severity: Major
                  Found in submit.php and 2 other locations - About 1 hr to fix
                  index.php on lines 53..65
                  letter.php on lines 48..60

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                  function b_lxentries_random_show()
                  {
                      global $xoopsDB, $xoopsUser, $xoopsConfig, $xoopsModule;
                      $myts = \MyTextSanitizer::getInstance();
                  
                  
                  Severity: Minor
                  Found in blocks/random_term.php - About 1 hr to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

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

                  function lx_close_tags($string)
                  {
                      // match opened tags
                      if (preg_match_all('/<([a-z\:\-]+)[^\/]>/', $string, $start_tags)) {
                          $start_tags = $start_tags[1];
                  Severity: Minor
                  Found in include/functions.php - About 1 hr to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

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

                      public static function closeTags($string)
                      {
                          // match opened tags
                          if (\preg_match_all('/<([a-z\:\-]+)[^\/]>/', $string, $start_tags)) {
                              $start_tags = $start_tags[1];
                  Severity: Minor
                  Found in class/Utility.php - About 1 hr to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Method getModuleHeader has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

                    Method checkVerModule has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static function checkVerModule($helper, $source = 'github', $default = 'master')
                        {
                            $moduleDirName      = \basename(\dirname(__DIR__, 2));
                            $moduleDirNameUpper = mb_strtoupper($moduleDirName);
                            $update             = '';
                    Severity: Minor
                    Found in class/Common/VersionChecks.php - About 1 hr to fix

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

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