mambax7/marquee

View on GitHub

Showing 100 of 100 total issues

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

    function setOrder($bid, $title, $weight, $visible, $side, $bcachetime, $bmodule = null)
Severity: Major
Found in admin/blocksadmin.php - About 50 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                if (is_file($templateFolder . $v)) {
                                    unlink($templateFolder . $v);
                                }
    Severity: Major
    Found in include/onupdate.php - About 45 mins to fix

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

      function b_marquee_tplleaguestats($limit, $dateFormat, $itemsSize)
      {
          //    require_once XOOPS_ROOT_PATH . '/modules/marquee/class/Utility.php';
          //######################## SETTINGS ######################
          $displaySeason  = false; // display season name?
      Severity: Minor
      Found in plugins/tplleaguestats.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 myglob has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function myglob($folder = '', $pattern = 'php')
      {
          $result = [];
          try {
              if (!($dir = opendir($folder))) {
      Severity: Minor
      Found in admin/functions.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 xoopspartners_random has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function xoopspartners_random($numberPartners, $random = true, $orden = '', $desc = '')
      {
          global $xoopsDB;
          $PartnersId  = [];
          $ArrayReturn = [];
      Severity: Minor
      Found in plugins/xoopspartners.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 b_marquee_smartfaq has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function b_marquee_smartfaq($limit, $dateFormat, $itemsSize)
      {
          require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php';
          $block             = [];
          $smartModule       = &sf_getModuleInfo();
      Severity: Minor
      Found in plugins/smartfaq.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

              $caption,
              $name,
              $value = '',
              $width = '100%',
              $height = '400px',
      Severity: Minor
      Found in class/Utility.php - About 45 mins to fix

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

        function b_marquee_smartclient($limit, $dateFormat, $itemsSize)
        {
            $block = [];
            if (!defined('SMARTCLIENT_DIRNAME')) {
                define('SMARTCLIENT_DIRNAME', 'smartclient');
        Severity: Minor
        Found in plugins/smartclient.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 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

          Function b_marquee_news has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          function b_marquee_news($limit, $dateFormat, $itemsSize)
          {
              //    require_once XOOPS_ROOT_PATH . '/modules/marquee/class/Utility.php';
              require_once XOOPS_ROOT_PATH . '/modules/news/class/class.newsstory.php';
              $block      = $stories = [];
          Severity: Minor
          Found in plugins/news.php - 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

          Function getEditor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function getEditor($helper = null, $options = null)
              {
                  /** @var Helper $helper */
                  if (null === $options) {
                      $options           = [];
          Severity: Minor
          Found in class/Common/SysUtility.php - 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

          Function b_marquee_wfdownloads has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          function b_marquee_wfdownloads($limit, $dateFormat, $itemsSize)
          {
              $block = [];
              global $xoopsUser;
              /** @var \XoopsModuleHandler $moduleHandler */
          Severity: Minor
          Found in plugins/wfdownloads.php - 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

          Function b_marquee_article has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          function b_marquee_article($limit, $dateFormat, $itemsSize)
          {
              global $xoopsDB;
              //    require_once XOOPS_ROOT_PATH . '/modules/marquee/class/Utility.php';
              require_once XOOPS_ROOT_PATH . '/modules/article/include/functions.php';
          Severity: Minor
          Found in plugins/article.php - 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

          Function b_marquee_smartsection has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          function b_marquee_smartsection($limit, $dateFormat, $itemsSize)
          {
              require_once XOOPS_ROOT_PATH . '/modules/smartsection/include/common.php';
              xoops_load('xoopsuserutility');
              $myts                    = \MyTextSanitizer::getInstance();
          Severity: Minor
          Found in plugins/smartsection.php - 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

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

                      $block[] = [
                          'date'     => formatTimestamp($myrow['published'], $dateFormat),
                          'category' => '',
                          'author'   => \XoopsUser::getUnameFromId($myrow['uid']),
                          'title'    => $title,
          Severity: Minor
          Found in plugins/xfsection.php and 1 other location - About 30 mins to fix
          plugins/wfsection.php on lines 56..62

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

          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[] = [
                              'date'     => formatTimestamp($myrow['published'], $dateFormat),
                              'category' => '',
                              'author'   => \XoopsUser::getUnameFromId($myrow['uid']),
                              'title'    => $title,
          Severity: Minor
          Found in plugins/wfsection.php and 1 other location - About 30 mins to fix
          plugins/xfsection.php on lines 51..57

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

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

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

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

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

          Refactorings

          Further Reading

          Function b_marquee_show has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          function b_marquee_show($options)
          {
              global $xoopsTpl;
              $marquee = null;
              //    require_once XOOPS_ROOT_PATH . '/modules/marquee/class/Utility.php';
          Severity: Minor
          Found in blocks/marquee_bloc.php - About 25 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 xoops_module_install_marquee has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          function xoops_module_install_marquee(\XoopsModule $module)
          {
              require_once \dirname(__DIR__, 3) . '/mainfile.php';
              $moduleDirName = \basename(\dirname(__DIR__));
              /** @var Marquee\Helper $helper */ /** @var Marquee\Utility $utility */
          Severity: Minor
          Found in include/oninstall.php - About 25 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 loadSampleData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          function loadSampleData()
          {
              global $xoopsConfig;
              $moduleDirName      = \basename(\dirname(__DIR__));
              $moduleDirNameUpper = mb_strtoupper($moduleDirName);
          Severity: Minor
          Found in testdata/index.php - About 25 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 xoops_module_uninstall_marquee has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          function xoops_module_uninstall_marquee(\XoopsModule $module)
          {
              //    return true;
              $moduleDirName      = \basename(\dirname(__DIR__));
              $moduleDirNameUpper = mb_strtoupper($moduleDirName);
          Severity: Minor
          Found in include/onuninstall.php - About 25 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