mambax7/wflinks

View on GitHub

Showing 201 of 201 total issues

Method __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

        $path = 'uploads',
        $value = null,
        $selected = '',
        $size = 1,
        $emptyselect = 0,
Severity: Major
Found in class/Lists.php - About 1 hr to fix

    Method setLabel has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            $postoffice = '',
            $extended = '',
            $street = '',
            $city = '',
            $region = '',
    Severity: Major
    Found in class/VCard.php - About 1 hr to fix

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

      $modversion['config'][] = [
          'name'        => 'perpage',
          'title'       => '_MI_WFL_PERPAGE',
          'description' => '_MI_WFL_PERPAGEDSC',
          'formtype'    => 'select',
      Severity: Minor
      Found in xoops_version.php and 1 other location - About 1 hr to fix
      xoops_version.php on lines 298..317

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

      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

      $modversion['config'][] = [
          'name'        => 'admin_perpage',
          'title'       => '_MI_WFL_ADMINPAGE',
          'description' => '_MI_WFL_AMDMINPAGEDSC',
          'formtype'    => 'select',
      Severity: Minor
      Found in xoops_version.php and 1 other location - About 1 hr to fix
      xoops_version.php on lines 278..297

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

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

          public static function rmove($src, $dest)
          {
              // Only continue if user is a 'global' Admin
              if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
                  return false;
      Severity: Minor
      Found in class/Common/FilesManagement.php - About 55 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 recurseCopy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function recurseCopy($src, $dst)
          {
              $dir = \opendir($src);
              //        @mkdir($dst);
              if (!@\mkdir($dst) && !\is_dir($dst)) {
      Severity: Minor
      Found in class/Common/FilesManagement.php - About 55 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 rcopy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function rcopy($src, $dest)
          {
              // Only continue if user is a 'global' Admin
              if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
                  return false;
      Severity: Minor
      Found in class/Common/FilesManagement.php - About 55 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 uploadFiles has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              $FILES,
              $uploaddir = 'uploads',
              $allowed_mimetypes = '',
              $redirecturl = 'index.php',
              $num = 0,
      Severity: Major
      Found in class/Utility.php - About 50 mins to fix

        Method isBlockCloned has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options)
        Severity: Major
        Found in admin/blocksadmin.php - About 50 mins to fix

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

          if (is_object($xoTheme)) {
              $xoTheme->addMeta('meta', 'keywords', $myrow['keywords']);
              $xoTheme->addMeta('meta', 'title', $myrow['title']);
              $xoTheme->addMeta('meta', 'description', $link_meta_description);
          } else {
          Severity: Minor
          Found in print.php and 1 other location - About 45 mins to fix
          singlelink.php on lines 171..178

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

          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 (is_object($xoTheme)) {
              $xoTheme->addMeta('meta', 'keywords', $link_arr['keywords']);
              $xoTheme->addMeta('meta', 'title', $link_arr['title']);
              $xoTheme->addMeta('meta', 'description', $link_meta_description);
          } else {
          Severity: Minor
          Found in singlelink.php and 1 other location - About 45 mins to fix
          print.php on lines 126..133

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

          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

          Avoid deeply nested control flow statements.
          Open

                          if (false !== $all_ok || in_array($modversion['category'], $ok_syscats)) {
                              echo "<td class='$class' class='txtcenter;' valign='bottom' width='19%'>";
                              echo "<a href='" . XOOPS_URL . '/modules/system/admin.php?fct=' . $file . "'><b>" . trim($modversion['name']) . "</b></a>\n";
                              echo '</td>';
                              ++$counter;
          Severity: Major
          Found in admin/admin.php - About 45 mins to fix

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

            function wflinks_tag_iteminfo(&$items)
            {
                $moduleDirName = basename(dirname(__DIR__));
            
                if (empty($items) || !is_array($items)) {
            Severity: Minor
            Found in class/plugins/plugin.tag.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

                            if ($counter > 4) {
                                $counter = 0;
                                echo '</tr>';
                                echo '<tr>';
                            }
            Severity: Major
            Found in admin/admin.php - About 45 mins to fix

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

                  public static function getForum($type, $selected)
                  {
                      global $xoopsDB;
                      switch (\xoops_trim($type)) {
                          case 2:
              Severity: Minor
              Found in class/Lists.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 makeMySelBox has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function makeMySelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = '')
              Severity: Minor
              Found in class/Tree.php - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if ($chcount > 5) {
                                        $subcategories .= '...';
                                        break;
                                    }
                Severity: Major
                Found in index.php - About 45 mins to fix

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

                      function setOrder($bid, $title, $weight, $visible, $side, $bcachetime)
                  Severity: Minor
                  Found in admin/blocksadmin.php - About 45 mins to fix

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

                        public function __construct($img_name = null, $img_path = null, $img_savepath = null)
                        {
                            if (!\preg_match("/\.(jpg|gif|png|jpeg)$/i", $img_name)) {
                                //            return false;
                            }
                    Severity: Minor
                    Found in class/ThumbsNails.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

                                        if ($space > 0) {
                                            $subcategories .= "<a href='" . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewcat.php?cid=' . $ele['cid'] . "'>" . $chtitle . '</a><br>';
                                        }
                    Severity: Major
                    Found in index.php - About 45 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language