XoopsModules25x/lexikon

View on GitHub

Showing 316 of 316 total issues

Method DefinitionImport has 145 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function DefinitionImport($delete)
{
    global $xoopsConfig, $xoopsDB, $xoopsModule;
    $myts     = \MyTextSanitizer::getInstance();
    $sqlQuery = $xoopsDB->query('SELECT count(entryID) AS count FROM ' . $xoopsDB->prefix('xwords_ent'));
Severity: Major
Found in admin/importxwords.php - About 5 hrs to fix

    Function lx_search has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
    Open

    function lx_search($queryarray, $andor, $limit, $offset, $userid)
    {
        global $xoopsDB, $xoopsUser;
        // -- search comments + highlighter
        $highlight        = false;
    Severity: Minor
    Found in include/search.inc.php - About 5 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 entrySave has 137 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function entrySave($entryID = '')
    {
        global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsDB;
        $helper  = Helper::getInstance();
        $utility = new Utility();
    Severity: Major
    Found in admin/entry.php - About 5 hrs to fix

      Function entryEdit has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
      Open

      function entryEdit($entryID = '')
      {
          global $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $init;
          $helper = Helper::getInstance();
      
      
      Severity: Minor
      Found in admin/entry.php - About 5 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 b_lxspot_show has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
      Open

      function b_lxspot_show($options)
      {
          global $xoopsDB, $xoopsUser;
          $myts = MyTextSanitizer:: getInstance();
          xoops_load('XoopsUserUtility');
      Severity: Minor
      Found in blocks/entries_spot.php - About 5 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

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

          for ($a = 65; $a < (65 + 26); ++$a) {
              $letterlinks             = [];
              $initial                 = uchr($a);
              $sql                     = $xoopsDB->query('SELECT init FROM ' . $xoopsDB->prefix('lxentries') . " WHERE init = '$initial' AND datesub < '" . time() . "' AND datesub > '0' AND offline= '0' AND submit='0' AND request='0' " . $catperms . ' ');
              $howmany                 = $xoopsDB->getRowsNum($sql);
      Severity: Major
      Found in blocks/entries_initial.php and 1 other location - About 4 hrs to fix
      blocks/entries_initial.php on lines 68..79

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

      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                 = uchr($a);
              $sql                     = $xoopsDB->query('SELECT init FROM ' . $xoopsDB->prefix('lxentries') . " WHERE init = '$initial' AND datesub < '" . time() . "' AND datesub > '0' AND offline= '0' AND submit='0' AND request='0' " . $catperms . ' ');
              $howmany                 = $xoopsDB->getRowsNum($sql);
      Severity: Major
      Found in blocks/entries_initial.php and 1 other location - About 4 hrs to fix
      blocks/entries_initial.php on lines 80..91

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

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

      function myblocksadmin_update_block(
          $bid,
          $bside,
          $bweight,
          $bvisible,
      Severity: Minor
      Found in include/blocksadmin.inc.php - About 4 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 DefinitionImport has 118 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function DefinitionImport($delete)
      {
          global $xoopsConfig, $xoopsDB, $xoopsModule, $myts;
          $sqlQuery = $xoopsDB->query('SELECT count(id) AS count FROM ' . $xoopsDB->prefix('dictionary'));
          [$count] = $xoopsDB->fetchRow($sqlQuery);
      Severity: Major
      Found in admin/importdictionary.php - About 4 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 lx_extract_keywords has 115 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

            Function categorySave has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
            Open

            function categorySave($categoryID = '')
            {
                require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
                require_once XOOPS_ROOT_PATH . '/class/uploader.php';
                global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsDB, $myts, $categoryID;
            Severity: Minor
            Found in admin/category.php - About 4 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

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

                $block     = [
                    'form_title'    => _AM_EDITBLOCK,
                    'name'          => $myblock->getVar('name'),
                    'side'          => $myblock->getVar('side'),
                    'weight'        => $myblock->getVar('weight'),
            Severity: Major
            Found in include/blocksadmin.inc.php and 1 other location - About 4 hrs to fix
            include/blocksadmin.inc.php on lines 378..396

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

            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

                $block     = [
                    'form_title'    => _AM_CLONEBLOCK,
                    'name'          => $myblock->getVar('name'),
                    'side'          => $myblock->getVar('side'),
                    'weight'        => $myblock->getVar('weight'),
            Severity: Major
            Found in include/blocksadmin.inc.php and 1 other location - About 4 hrs to fix
            include/blocksadmin.inc.php on lines 337..355

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

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

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

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

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

            Refactorings

            Further Reading

            Method lx_Statistics has 112 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function lx_Statistics()
            {
                global $xoopsModule, $xoopsConfig;
                $helper = Helper::getInstance();
                xoops_load('XoopsUserUtility');
            Severity: Major
            Found in admin/statistics.php - About 4 hrs to fix

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

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

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 169.

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

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

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

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

              Refactorings

              Further Reading

              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

              Method lx_search has 107 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function lx_search($queryarray, $andor, $limit, $offset, $userid)
              {
                  global $xoopsDB, $xoopsUser;
                  // -- search comments + highlighter
                  $highlight        = false;
              Severity: Major
              Found in include/search.inc.php - About 4 hrs to fix

                File admin.php has 343 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                
                /**
                 * Module: Lexikon - glossary module
                 * Version: v 1.00
                Severity: Minor
                Found in language/english/admin.php - About 4 hrs to fix

                  File admin.php has 343 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  /**
                   * Module: Lexikon - glossary module
                   * Version: v 1.00
                  Severity: Minor
                  Found in language/german/admin.php - About 4 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language