mambax7/publisher

View on GitHub

Showing 355 of 3,032 total issues

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

    public function getBody($maxLength = 0, $format = 'S', $stripTags = '')
    {
        $ret     = $this->getVar('body', $format);
        $wrapPos = \mb_strpos($ret, self::PAGEWRAP);
        if (!(false === $wrapPos)) {
Severity: Minor
Found in class/Item.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

File ThemeTabForm.php has 265 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php declare(strict_types=1);

namespace XoopsModules\Publisher\Form;

/*
Severity: Minor
Found in class/Form/ThemeTabForm.php - About 2 hrs to fix

    Method publisher_search has 58 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function publisher_search($queryArray, $andor, $limit, $offset, $userid, $categories = [], $sortby = 0, $searchin = '', $extra = '')
    {
        $helper        = Helper::getInstance();
        $ret           = $item = [];
        $hightlightKey = '';
    Severity: Major
    Found in include/search.inc.php - About 2 hrs to fix

      Method smarty_modifier_rewrite_url has 58 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function smarty_modifier_rewrite_url($url, $insert_param, $param_value = null, $remove_params_arr = '')
      {
          //parse $insert_param if it is a query string
          if (preg_match('/.+=([\w%,-])*/', $insert_param)) {
              parse_str($insert_param, $insert_arr);
      Severity: Major
      Found in extra/modifier.rewrite_url.php - About 2 hrs to fix

        File item.php has 261 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php declare(strict_types=1);
        /*
         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: Minor
        Found in item.php - About 2 hrs to fix

          Function render has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

              public function render(?array $block = null)
              {
                  \xoops_load('XoopsFormLoader');
                  \xoops_loadLanguage('common', $this->moduleDirNameUpper);
          
          
          Severity: Minor
          Found in class/Common/Blocksadmin.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

          Function toArraySimple has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

              public function toArraySimple($display = 'default', $maxCharTitle = 0, $maxCharSummary = 300, $fullSummary = false)
              {
                  $itemPageId = -1;
                  if (\is_numeric($display)) {
                      $itemPageId = $display;
          Severity: Minor
          Found in class/Item.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

          Function cloneFileFolder has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function cloneFileFolder($path): void
              {
                  global $patKeys;
                  global $patValues;
          
          
          Severity: Minor
          Found in class/Cloner.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

          Function lofSidernews has 56 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              $.lofSidernews = function (obj, settings) {
                  this.settings = {
                      direction: '',
                      mainItemSelector: 'li',
                      navInnerSelector: 'ul',
          Severity: Major
          Found in assets/js/script.easing.js - About 2 hrs to fix

            Method publisher_items_random_item_show has 56 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function publisher_items_random_item_show($options)
            {
                $block = [];
            
                $helper = Helper::getInstance();
            Severity: Major
            Found in blocks/items_random_item.php - About 2 hrs to fix

              Method getURL has 55 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function getURL($url, $tempfile)
                  {
                      $this->lastURLError = false;
                      $url                = preg_replace('/ /', '%20', $url);
                      if (function_exists('curl_init')) {
              Severity: Major
              Found in thumb.php - About 2 hrs to fix

                Method resizeImage has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function resizeImage()
                    {
                        // check file extension
                        switch ($this->imageMimetype) {
                            case 'image/png':
                Severity: Major
                Found in class/Resizer.php - About 2 hrs to fix

                  Method uploadFile has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function uploadFile($another, $withRedirect, &$itemObj = null)
                      {
                          \xoops_load('XoopsMediaUploader');
                          //        require_once PUBLISHER_ROOT_PATH . '/class/uploader.php';
                  
                  
                  Severity: Major
                  Found in class/Utility.php - About 2 hrs to fix

                    Function selectAll has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function selectAll(formObj, fieldname, isInverse) {
                        if (fieldname.length == 0) {
                            for (var i = 0; i < formObj.length; i++) {
                                fldObj = formObj.elements[i];
                                if (fldObj.type == 'checkbox') {
                    Severity: Minor
                    Found in assets/js/funcs.js - 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

                    Function getURL has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function getURL($url, $tempfile)
                        {
                            $this->lastURLError = false;
                            $url                = preg_replace('/ /', '%20', $url);
                            if (function_exists('curl_init')) {
                    Severity: Minor
                    Found in thumb.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

                    Function cleanCache has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function cleanCache()
                        {
                            if (FILE_CACHE_TIME_BETWEEN_CLEANS < 0) {
                                return null;
                            }
                    Severity: Minor
                    Found in thumb.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

                    Function uploadFile has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function uploadFile($another, $withRedirect, &$itemObj = null)
                        {
                            \xoops_load('XoopsMediaUploader');
                            //        require_once PUBLISHER_ROOT_PATH . '/class/uploader.php';
                    
                    
                    Severity: Minor
                    Found in class/Utility.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

                    Function _createInput has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            _createInput: function () {
                                var self = this;
                    
                                var input = document.createElement("input");
                                input.setAttribute('type', 'file');
                    Severity: Major
                    Found in assets/js/ajaxupload.3.9.js - About 2 hrs to fix

                      Method isBlockCloned has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function isBlockCloned(int $bid, string $bside, string $bweight, string $bvisible, string $bcachetime, ?array $bmodule, ?array $options, ?array $groups): void
                          {
                              \xoops_loadLanguage('admin', 'system');
                              \xoops_loadLanguage('admin/blocksadmin', 'system');
                              \xoops_loadLanguage('admin/groups', 'system');
                      Severity: Major
                      Found in class/Common/Blocksadmin.php - About 2 hrs to fix

                        Method mergeImage has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function mergeImage(): void
                            {
                                $dest = \imagecreatefromjpeg($this->endFile);
                                $src  = \imagecreatefromjpeg($this->sourceFile);
                                if (4 == $this->mergeType) {
                        Severity: Major
                        Found in class/Resizer.php - About 2 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language