mambax7/publisher

View on GitHub

Showing 355 of 3,032 total issues

Method publisher_search has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

function publisher_search($queryArray, $andor, $limit, $offset, $userid, $categories = [], $sortby = 0, $searchin = '', $extra = '')
Severity: Major
Found in include/search.inc.php - About 1 hr to fix

    Method getAllPublished has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function getAllPublished($limit = 0, $start = 0, $categoryid = -1, $sort = 'datesub', $order = 'DESC', $notNullFields = null, $asObject = true, $idKey = 'none', $excludeExpired = true)
    Severity: Major
    Found in class/ItemHandler.php - About 1 hr to fix

      Method getItemsFromSearch has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function getItemsFromSearch($queryArray = [], $andor = 'AND', $limit = 0, $offset = 0, $userid = 0, $categories = [], $sortby = 0, $searchin = '', $extra = '')
      Severity: Major
      Found in class/ItemHandler.php - About 1 hr to fix

        Method updateBlock has 9 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function updateBlock(int $bid, string $btitle, string $bside, string $bweight, string $bvisible, string $bcachetime, ?array $bmodule, ?array $options, ?array $groups): void
        Severity: Major
        Found in class/Common/Blocksadmin.php - About 1 hr to fix

          Method serveExternalImage has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function serveExternalImage()
              {
                  if (!preg_match('/^https?:\/\/[a-zA-Z0-9\-\.]+/i', $this->src)) {
                      $this->error('Invalid URL supplied.');
          
          
          Severity: Minor
          Found in thumb.php - About 1 hr to fix

            Method xoops_module_install_publisher has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function xoops_module_install_publisher(\XoopsModule $module)
            {
                require \dirname(__DIR__) . '/preloads/autoloader.php';
            
                $helper       = Helper::getInstance();
            Severity: Minor
            Found in include/oninstall.php - About 1 hr to fix

              Method insert has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function insert(\XoopsObject $obj, $force = false)// insert($obj, $force = false)
                  {
                      // Make sure object is of correct type
                      if (0 != \strcasecmp($this->className, \get_class($obj))) {
                          return false;
              Severity: Minor
              Found in class/BaseObjectHandler.php - About 1 hr to fix

                Method getGrantedGroupsById has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getGrantedGroupsById($gpermName, $id)
                    {
                        static $items;
                        if (isset($items[$gpermName][$id])) {
                            return $items[$gpermName][$id];
                Severity: Minor
                Found in class/PermissionHandler.php - About 1 hr to fix

                  Function publisher_tag_iteminfo has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function publisher_tag_iteminfo(&$items)
                  {
                      if (empty($items) || !is_array($items)) {
                          return false;
                      }
                  Severity: Minor
                  Found in include/plugin.tag.php - About 1 hr 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_publisher has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function xoops_module_install_publisher(\XoopsModule $module)
                  {
                      require \dirname(__DIR__) . '/preloads/autoloader.php';
                  
                      $helper       = Helper::getInstance();
                  Severity: Minor
                  Found in include/oninstall.php - About 1 hr 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 setTitle has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function setTitle($title): void
                      {
                          $this->title         = $this->html2text($title);
                          $this->originalTitle = $this->title;
                          $titleTag            = [];
                  Severity: Minor
                  Found in class/Metagen.php - About 1 hr 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 getCountsByCat has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getCountsByCat($catId, $status, $inSubCat = false)
                      {
                          //        global $resultCatCounts;
                  
                          $ret       = [];
                  Severity: Minor
                  Found in class/ItemHandler.php - About 1 hr 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 findMetaKeywords has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function findMetaKeywords($text, $minChar)
                      {
                          $keywords         = [];
                          $text             = $this->purifyText($text);
                          $text             = $this->html2text($text);
                  Severity: Minor
                  Found in class/Metagen.php - About 1 hr 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 getArray has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getArray($mimeExt = null)
                      {
                          //        global $publisherIsAdmin;
                          $ret = [];
                          if ($GLOBALS['xoopsUser'] && !$this->publisherIsAdmin) {
                  Severity: Minor
                  Found in class/MimetypeHandler.php - About 1 hr 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 getCategoriesForSubmit has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function &getCategoriesForSubmit()
                      {
                          global $theresult;
                          $ret      = [];
                          $criteria = new \CriteriaCompo();
                  Severity: Minor
                  Found in class/CategoryHandler.php - About 1 hr 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 getCategoriesForSearch has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getCategoriesForSearch()
                      {
                          global $theresult;
                  
                          $ret      = [];
                  Severity: Minor
                  Found in class/CategoryHandler.php - About 1 hr 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 getGrantedItems has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getGrantedItems($gpermName)
                      {
                          static $items;
                          if (isset($items[$gpermName])) {
                              return $items[$gpermName];
                  Severity: Minor
                  Found in class/PermissionHandler.php - About 1 hr to fix

                    Method editFile has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static function editFile($showmenu = false, $fileid = 0, $itemId = 0): void
                        {
                            $helper = Helper::getInstance();
                            require_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
                    
                    
                    Severity: Minor
                    Found in class/Utility.php - About 1 hr to fix

                      Method cloneFileFolder has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function cloneFileFolder($path): void
                          {
                              global $patKeys;
                              global $patValues;
                      
                      
                      Severity: Minor
                      Found in class/Cloner.php - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                                if ('png' === $imgType && OPTIPNG_ENABLED && OPTIPNG_PATH && @is_file(OPTIPNG_PATH)) {
                                    $exec = OPTIPNG_PATH;
                                    $this->debug(3, "optipng'ing $tempfile");
                                    $presize = filesize($tempfile);
                                    $out     = shell_exec('$exec -o1 $tempfile'); //you can use up to -o7 but it really slows things down
                        Severity: Major
                        Found in thumb.php - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language