XoopsModules25x/wfdownloads

View on GitHub
admin/import.php

Summary

Maintainability
F
1 wk
Test Coverage

File import.php has 613 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/*
 You may not change or alter any portion of this comment or credits
 of supporting developers from this source code or any supporting source code
 which is considered copyrighted (c) material of the original comment or credit authors.
Severity: Major
Found in admin/import.php - About 1 day to fix

    Method import_wfd_to_wfdownloads has 165 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function import_wfd_to_wfdownloads()
    {
        /** @var \XoopsModuleHandler $moduleHandler */
        $moduleHandler = xoops_getHandler('module');
        // Get destination module/handlers/configs
    Severity: Major
    Found in admin/import.php - About 6 hrs to fix

      Method import_wmpdownloads_to_wfdownloads has 72 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function import_wmpdownloads_to_wfdownloads()
      {
          echo '<br>';
          echo _AM_WFDOWNLOADS_IMPORT_IMPORTINGDATA;
          echo '<br>';
      Severity: Major
      Found in admin/import.php - About 2 hrs to fix

        Method import_mydownloads_to_wfdownloads has 71 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function import_mydownloads_to_wfdownloads()
        {
            echo '<br>';
            echo _AM_WFDOWNLOADS_IMPORT_IMPORTINGDATA;
            echo '<br>';
        Severity: Major
        Found in admin/import.php - About 2 hrs to fix

          Method import_pddownloads_to_wfdownloads has 69 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function import_pddownloads_to_wfdownloads()
          {
              echo '<br>';
              echo _AM_WFDOWNLOADS_IMPORT_IMPORTINGDATA;
              echo '<br>';
          Severity: Major
          Found in admin/import.php - About 2 hrs to fix

            Function import_wfd_to_wfdownloads has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
            Open

            function import_wfd_to_wfdownloads()
            {
                /** @var \XoopsModuleHandler $moduleHandler */
                $moduleHandler = xoops_getHandler('module');
                // Get destination module/handlers/configs
            Severity: Minor
            Found in admin/import.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 import_tdmdownloads_to_wfdownloads has 59 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function import_tdmdownloads_to_wfdownloads()
            {
                echo "<br><span style='font-weight: bold;'>Importing Data</span><br>";
                $destination = [
                    'cat'       => $GLOBALS['xoopsDB']->prefix('wfdownloads_cat'),
            Severity: Major
            Found in admin/import.php - About 2 hrs to fix

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

                      if (Utility::checkModule('mydownloads')) {
                          $moduleVersion = round(Utility::checkModule('mydownloads') / 100, 2);
                          $button        = new XoopsFormButton(_AM_WFDOWNLOADS_IMPORT_MYDOWNLOADS . '<br>' . $moduleVersion, 'myd_button', _AM_WFDOWNLOADS_IMPORT_BUTTON_IMPORT, 'submit');
                          $button->setExtra("onclick='document.forms.form.op.value=\"import.MyDownloads\"'");
                          $form->addElement($button);
              Severity: Major
              Found in admin/import.php and 3 other locations - About 2 hrs to fix
              admin/import.php on lines 172..182
              admin/import.php on lines 185..195
              admin/import.php on lines 198..208

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

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

                      if (Utility::checkModule('PDdownloads')) {
                          $moduleVersion = round(Utility::checkModule('PDdownloads') / 100, 2);
                          $button        = new XoopsFormButton(_AM_WFDOWNLOADS_IMPORT_PDDOWNLOADS . '<br>' . $moduleVersion, 'pd_button', _AM_WFDOWNLOADS_IMPORT_BUTTON_IMPORT, 'submit');
                          $button->setExtra("onclick='document.forms.form.op.value=\"import.PD-Downloads\"'");
                          $form->addElement($button);
              Severity: Major
              Found in admin/import.php and 3 other locations - About 2 hrs to fix
              admin/import.php on lines 159..169
              admin/import.php on lines 185..195
              admin/import.php on lines 198..208

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

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

                      if (Utility::checkModule('wmpdownloads')) {
                          $moduleVersion = round(Utility::checkModule('wmpdownloads') / 100, 2);
                          $button        = new XoopsFormButton(_AM_WFDOWNLOADS_IMPORT_WMPOWNLOADS . '<br>' . $moduleVersion, 'wmp_button', _AM_WFDOWNLOADS_IMPORT_BUTTON_IMPORT, 'submit');
                          $button->setExtra("onclick='document.forms.form.op.value=\"import.wmpownloads\"'");
                          $form->addElement($button);
              Severity: Major
              Found in admin/import.php and 3 other locations - About 2 hrs to fix
              admin/import.php on lines 159..169
              admin/import.php on lines 172..182
              admin/import.php on lines 198..208

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

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

                      if (Utility::checkModule('tdmdownloads')) {
                          $moduleVersion = round(Utility::checkModule('tdmdownloads') / 100, 2);
                          $button        = new XoopsFormButton(_AM_WFDOWNLOADS_IMPORT_TDMDOWNLOADS . '<br>' . $moduleVersion, 'wmp_button', _AM_WFDOWNLOADS_IMPORT_BUTTON_IMPORT, 'submit');
                          $button->setExtra("onclick='document.forms.form.op.value=\"import.TDMDownloads\"'");
                          $form->addElement($button);
              Severity: Major
              Found in admin/import.php and 3 other locations - About 2 hrs to fix
              admin/import.php on lines 159..169
              admin/import.php on lines 172..182
              admin/import.php on lines 185..195

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

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

                  if (Utility::checkModule('wf' . 'downloads') >= 320) {
                      $sql = "INSERT INTO {$destination['cat']} (";
                      $sql .= ' `old_cid`, `old_pid`, `title`, `imgurl`, `description`, `total`, `summary`, `spotlighttop`, `spotlighthis`, `dohtml`, `dosmiley`, `doxcode`, `doimage`, `dobr`, `weight`, `formulize_fid`';
                      $sql .= ' ) SELECT ';
                      $sql .= ' `cid`,     `pid`,     `title`, `imgurl`, `description`, `total`, `summary`, `spotlighttop`, `spotlighthis`, `dohtml`, `dosmiley`, `doxcode`, `doimage`, `dobr`, `weight`, `formulize_fid`';
              Severity: Major
              Found in admin/import.php and 2 other locations - About 2 hrs to fix
              admin/import.php on lines 360..372
              admin/import.php on lines 389..401

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

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

                  if (Utility::checkModule('wf' . 'downloads') >= 320) {
                      $sql = "INSERT INTO {$destination['downloads']} (";
                      $sql .= ' `cid`, `old_lid`, `old_cid`, `title`, `url`, `filename`, `filetype`, `homepage`, `version`, `size`, `platform`, `screenshot`, `screenshot2`, `screenshot3`, `screenshot4`, `submitter`, `publisher`, `status`, `date`, `hits`, `rating`, `votes`, `comments`, `license`, `mirror`, `price`, `paypalemail`, `features`, `requirements`, `homepagetitle`, `forumid`, `limitations`, `versiontypes`, `dhistory`, `published`, `expired`, `updated`, `offline`, `summary`, `description`, `ipaddress`, `notifypub`, `formulize_idreq`';
                      $sql .= ' ) SELECT ';
                      $sql .= ' 0,     `lid`,     `cid`,     `title`, `url`, `filename`, `filetype`, `homepage`, `version`, `size`, `platform`, `screenshot`, `screenshot2`, `screenshot3`, `screenshot4`, `submitter`, `publisher`, `status`, `date`, `hits`, `rating`, `votes`, `comments`, `license`, `mirror`, `price`, `paypalemail`, `features`, `requirements`, `homepagetitle`, `forumid`, `limitations`, `versiontypes`, `dhistory`, `published`, `expired`, `updated`, `offline`, `summary`, `description`, `ipaddress`, `notifypub`, `formulize_idreq`';
              Severity: Major
              Found in admin/import.php and 2 other locations - About 2 hrs to fix
              admin/import.php on lines 343..355
              admin/import.php on lines 389..401

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

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

                  if (Utility::checkModule('wf' . 'downloads') >= 320) {
                      $sql = "INSERT INTO {$destination['reviews']} (";
                      $sql .= ' `lid`, `title`, `review`, `submit`, `date`, `uid`, `rate`';
                      $sql .= ' ) SELECT';
                      $sql .= ' `lid`, `title`, `review`, `submit`, `date`, `uid`, `rate`';
              Severity: Major
              Found in admin/import.php and 2 other locations - About 2 hrs to fix
              admin/import.php on lines 343..355
              admin/import.php on lines 360..372

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

              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

                  case 'import.TDMDownloads':
                      $ok = Request::getBool('ok', false, 'POST');
                      if (true === $ok) {
                          // Import data from wfd322
                          Utility::getCpHeader();
              Severity: Major
              Found in admin/import.php and 1 other location - About 1 hr to fix
              admin/import.php on lines 95..110

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

              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

                  case 'import.wfd322':
                      $ok = Request::getBool('ok', false, 'POST');
                      if (true === $ok) {
                          // Import data from wfd322
                          Utility::getCpHeader();
              Severity: Major
              Found in admin/import.php and 1 other location - About 1 hr to fix
              admin/import.php on lines 111..126

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

              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

                  case 'import.PD-Downloads':
                      $ok = Request::getBool('ok', false, 'POST');
                      if (true === $ok) {
                          // Import data from PD-Downloads
                          import_pddownloads_to_wfdownloads();
              Severity: Major
              Found in admin/import.php and 1 other location - About 1 hr to fix
              admin/import.php on lines 80..94

              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

                  case 'import.wmpownloads':
                      $ok = Request::getBool('ok', false, 'POST');
                      if (true === $ok) {
                          // Import data from wmpownloads
                          import_wmpdownloads_to_wfdownloads();
              Severity: Major
              Found in admin/import.php and 1 other location - About 1 hr to fix
              admin/import.php on lines 65..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 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

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

                  if ($max_requestid) {
                      $GLOBALS['xoopsDB']->query('UPDATE ' . $destination['mod'] . ' m, ' . $destination['cat'] . ' c SET m.cid=c.cid' . ' WHERE m.requestid > ' . $max_requestid . ' AND c.old_cid=m.cid');
                      //Update lid values in mod table
                      $GLOBALS['xoopsDB']->query('UPDATE ' . $destination['mod'] . ' m, ' . $destination['downloads'] . ' d SET m.lid=d.lid' . ' WHERE m.requestid > ' . $max_requestid . ' AND m.lid=d.old_lid');
                  }
              Severity: Major
              Found in admin/import.php and 2 other locations - About 1 hr to fix
              admin/import.php on lines 546..550
              admin/import.php on lines 747..751

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

              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 ($max_requestid) {
                      $GLOBALS['xoopsDB']->query('UPDATE ' . $destination['mod'] . ' m, ' . $destination['cat'] . ' c SET m.cid=c.cid' . ' WHERE m.requestid > ' . $max_requestid . ' AND c.old_cid=m.cid');
                      //Update lid values in mod table
                      $GLOBALS['xoopsDB']->query('UPDATE ' . $destination['mod'] . ' m, ' . $destination['downloads'] . ' d SET m.lid=d.lid' . ' WHERE m.requestid > ' . $max_requestid . ' AND m.lid=d.old_lid');
                  }
              Severity: Major
              Found in admin/import.php and 2 other locations - About 1 hr to fix
              admin/import.php on lines 647..651
              admin/import.php on lines 747..751

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

              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 ($max_requestid) {
                      $GLOBALS['xoopsDB']->query('UPDATE ' . $destination['mod'] . ' m, ' . $destination['cat'] . ' c SET m.cid=c.cid' . ' WHERE m.requestid > ' . $max_requestid . ' AND c.old_cid=m.cid');
                      //Update lid values in mod table
                      $GLOBALS['xoopsDB']->query('UPDATE ' . $destination['mod'] . ' m, ' . $destination['downloads'] . ' d SET m.lid=d.lid' . ' WHERE m.requestid > ' . $max_requestid . ' AND m.lid=d.old_lid');
                  }
              Severity: Major
              Found in admin/import.php and 2 other locations - About 1 hr to fix
              admin/import.php on lines 546..550
              admin/import.php on lines 647..651

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

              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

                  $source = [
                      'cat'       => $GLOBALS['xoopsDB']->prefix('wmpdownloads_cat'),
                      'downloads' => $GLOBALS['xoopsDB']->prefix('wmpdownloads_downloads'),
                      'broken'    => $GLOBALS['xoopsDB']->prefix('wmpdownloads_broken'),
                      'mod'       => $GLOBALS['xoopsDB']->prefix('wmpdownloads_mod'),
              Severity: Minor
              Found in admin/import.php and 1 other location - About 55 mins to fix
              admin/import.php on lines 685..692

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

              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

                  $source = [
                      'cat'       => $GLOBALS['xoopsDB']->prefix('mydownloads_cat'),
                      'downloads' => $GLOBALS['xoopsDB']->prefix('mydownloads_downloads'),
                      'broken'    => $GLOBALS['xoopsDB']->prefix('mydownloads_broken'),
                      'mod'       => $GLOBALS['xoopsDB']->prefix('mydownloads_mod'),
              Severity: Minor
              Found in admin/import.php and 1 other location - About 55 mins to fix
              admin/import.php on lines 483..490

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

              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