XoopsModules25x/lexikon

View on GitHub

Showing 316 of 316 total issues

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

    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

    Avoid deeply nested control flow statements.
    Open

                        switch ($helper->getConfig('linkterms')) {
                            default:
                                $replace_term = '<span><b><a style="cursor:help;border-bottom: 1px dotted #000;color: #2F5376;" href="' . $staticURL . '" >' . $term . '</a></b></span>';
                                break;
                            case 3: //tooltip
    Severity: Major
    Found in entry.php - About 45 mins to fix

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

              if ($ret1) {
                  if ($uid) {
                      /** @var \XoopsMemberHandler $memberHandler */
                      $memberHandler = xoops_getHandler('member');
                      $submitter     = $memberHandler->getUser($uid);
      Severity: Major
      Found in admin/importglossaire.php and 4 other locations - About 40 mins to fix
      admin/importdictionary.php on lines 169..180
      admin/importwiwimod.php on lines 157..168
      admin/importwordbook.php on lines 179..190
      admin/importxwords.php on lines 176..187

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

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

              if ($ret1) {
                  if ($uid) {
                      /** @var \XoopsMemberHandler $memberHandler */
                      $memberHandler = xoops_getHandler('member');
                      $submitter     = $memberHandler->getUser($uid);
      Severity: Major
      Found in admin/importwiwimod.php and 4 other locations - About 40 mins to fix
      admin/importdictionary.php on lines 169..180
      admin/importglossaire.php on lines 154..165
      admin/importwordbook.php on lines 179..190
      admin/importxwords.php on lines 176..187

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

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

                  if ($ret1) {
                      if ($uid) {
                          /** @var \XoopsMemberHandler $memberHandler */
                          $memberHandler = xoops_getHandler('member');
                          $submitter     = $memberHandler->getUser($uid);
      Severity: Major
      Found in admin/importwordbook.php and 4 other locations - About 40 mins to fix
      admin/importdictionary.php on lines 169..180
      admin/importglossaire.php on lines 154..165
      admin/importwiwimod.php on lines 157..168
      admin/importxwords.php on lines 176..187

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

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

                  if ($ret1) {
                      if ($uid) {
                          /** @var \XoopsMemberHandler $memberHandler */
                          $memberHandler = xoops_getHandler('member');
                          $submitter     = $memberHandler->getUser($uid);
      Severity: Major
      Found in admin/importxwords.php and 4 other locations - About 40 mins to fix
      admin/importdictionary.php on lines 169..180
      admin/importglossaire.php on lines 154..165
      admin/importwiwimod.php on lines 157..168
      admin/importwordbook.php on lines 179..190

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

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

                  if ($ret1) {
                      if ($uid) {
                          /** @var \XoopsMemberHandler $memberHandler */
                          $memberHandler = xoops_getHandler('member');
                          $submitter     = $memberHandler->getUser($uid);
      Severity: Major
      Found in admin/importdictionary.php and 4 other locations - About 40 mins to fix
      admin/importglossaire.php on lines 154..165
      admin/importwiwimod.php on lines 157..168
      admin/importwordbook.php on lines 179..190
      admin/importxwords.php on lines 176..187

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

      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 domticker has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function domticker(content, divId, divClass, delay, fadeornot) {
      Severity: Minor
      Found in assets/js/domticker.js - About 35 mins to fix

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

        function lx_search($queryarray, $andor, $limit, $offset, $userid)
        Severity: Minor
        Found in include/search.inc.php - About 35 mins to fix

          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

            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/Common/SysUtility.php - About 35 mins to fix

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

                      var bottomedge = ie && !window.opera ? winheight - event.clientY - offsetfromcursorY : winheight - e.clientY - offsetfromcursorY;
              Severity: Minor
              Found in assets/js/tooltipscript2.js and 1 other location - About 35 mins to fix
              assets/js/tooltipscript2.js on lines 47..47

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

              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

                      var rightedge = ie && !window.opera ? winwidth - event.clientX - offsetfromcursorX : winwidth - e.clientX - offsetfromcursorX;
              Severity: Minor
              Found in assets/js/tooltipscript2.js and 1 other location - About 35 mins to fix
              assets/js/tooltipscript2.js on lines 48..48

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

              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) {
                      if (uchr($a) == $init) {
                          $opt_selected = 'selected';
                      } else {
                          $opt_selected = '';
              Severity: Minor
              Found in admin/functions.php and 1 other location - About 35 mins to fix
              admin/functions.php on lines 392..399

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

              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) {
                      if (uchr($a) == $init) {
                          $opt_selected = 'selected';
                      } else {
                          $opt_selected = '';
              Severity: Minor
              Found in admin/functions.php and 1 other location - About 35 mins to fix
              admin/functions.php on lines 400..407

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

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

              function ddrivetip(thetext, thewidth, thecolor) {
                  if (ns6 || ie) {
                      if (typeof thewidth != "undefined") tipobj.style.width = thewidth + "px";
                      if (typeof thecolor != "undefined" && thecolor != "") tipobj.style.backgroundColor = thecolor;
                      tipobj.innerHTML = thetext;
              Severity: Minor
              Found in assets/js/tooltipscript2.js - 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

              Severity
              Category
              Status
              Source
              Language