mambax7/publisher

View on GitHub

Showing 355 of 3,032 total issues

Method tryBrowserCache has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function tryBrowserCache()
    {
        if (BROWSER_CACHE_DISABLE) {
            $this->debug(3, 'Browser caching is disabled');

Severity: Minor
Found in thumb.php - About 1 hr to fix

    Method rtsp has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function rtsp(&$patterns, &$replacements): void
        {
            $patterns[] = "/\[rtsp=(['\"]?)([^\"']*),([^\"']*)\\1]([^\"]*)\[\/rtsp\]/sU";
            $rp         = "<object classid=\"clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA\" HEIGHT='\\3' ID=Player WIDTH='\\2' VIEWASTEXT>";
            $rp         .= '<param NAME="_ExtentX" VALUE="12726">';
    Severity: Minor
    Found in class/MyTextSanitizerExtension.php - About 1 hr to fix

      Function handleErrors has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function handleErrors()
          {
              if ($this->haveErrors()) {
                  if (NOT_FOUND_IMAGE && $this->is404()) {
                      if ($this->serveImg(NOT_FOUND_IMAGE)) {
      Severity: Minor
      Found in thumb.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 xcopy has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function xcopy($source, $dest)
          {
              // Check for symlinks
              if (\is_link($source)) {
                  return \symlink(\readlink($source), $dest);
      Severity: Minor
      Found in class/Common/FilesManagement.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 isBlockCloned has a Cognitive Complexity of 12 (exceeds 5 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: Minor
      Found in class/Common/Blocksadmin.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 copyr has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function copyr($source, $dest)
          {
              // Simple copy for a file
              if (\is_file($source)) {
                  return \copy($source, $dest);
      Severity: Minor
      Found in class/Utility.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 getCategoryPath has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getCategoryPath($withAllLink = true)
          {
              if (empty($this->categoryPath)) {
                  if ($withAllLink) {
                      $ret = $this->getCategoryLink();
      Severity: Minor
      Found in class/Category.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 getCategoriesCount has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getCategoriesCount($parentid = 0)
          {
              if (-1 == $parentid) {
                  return $this->getCount();
              }
      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 render has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public function render()
          {
              $ret = '<table border="0" width="100%">' . NWLINE;
              foreach ($this->getElements() as $ele) {
                  if (!$ele->isHidden()) {
      Severity: Minor
      Found in class/BlockForm.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 orderBlock has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function orderBlock(
              array $bid,
              array $oldtitle,
              array $oldside,
              array $oldweight,
      Severity: Minor
      Found in class/Common/Blocksadmin.php - About 1 hr to fix

        Method getBody has 35 lines of code (exceeds 25 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 1 hr to fix

          Method publisher_date_to_date_show has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function publisher_date_to_date_show($options)
          {
              $myts   = \MyTextSanitizer::getInstance();
              $helper = Helper::getInstance();
          
          
          Severity: Minor
          Found in blocks/date_to_date.php - About 1 hr to fix

            Method publisher_items_recent_edit has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function publisher_items_recent_edit($options)
            {
                // require_once PUBLISHER_ROOT_PATH . '/class/blockform.php';
                xoops_load('XoopsFormLoader');
            
            
            Severity: Minor
            Found in blocks/items_recent.php - About 1 hr to fix

              Method getCategoriesForSubmit has 34 lines of code (exceeds 25 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

                Method getCategoriesForSearch has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getCategoriesForSearch()
                    {
                        global $theresult;
                
                        $ret      = [];
                Severity: Minor
                Found in class/CategoryHandler.php - About 1 hr to fix

                  Method cloneBlock has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function cloneBlock(int $bid): void
                      {
                          //require __DIR__ . '/admin_header.php';
                          //        \xoops_cp_header();
                  
                  
                  Severity: Minor
                  Found in class/Common/Blocksadmin.php - About 1 hr to fix

                    Method createLogo has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static function createLogo($dirname)
                        {
                            if (!\extension_loaded('gd')) {
                                return false;
                            }
                    Severity: Minor
                    Found in class/Cloner.php - About 1 hr to fix

                      Method publisher_items_columns_edit has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function publisher_items_columns_edit($options)
                      {
                          // require_once PUBLISHER_ROOT_PATH . '/class/blockform.php';
                          xoops_load('XoopsFormLoader');
                      
                      
                      Severity: Minor
                      Found in blocks/items_columns.php - About 1 hr to fix

                        Method serveCacheFile has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function serveCacheFile()
                            {
                                $this->debug(3, "Serving {$this->cachefile}");
                                if (!is_file($this->cachefile)) {
                                    $this->error("serveCacheFile called in timthumb but we couldn't find the cached file.");
                        Severity: Minor
                        Found in thumb.php - About 1 hr to fix

                          Method editBlock has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function editBlock(int $bid): void
                              {
                                  //        require_once \dirname(__DIR__,2) . '/admin/admin_header.php';
                                  //        \xoops_cp_header();
                                  \xoops_loadLanguage('admin', 'system');
                          Severity: Minor
                          Found in class/Common/Blocksadmin.php - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language