mambax7/publisher

View on GitHub

Showing 3,032 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 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 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 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 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 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 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 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

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

                          if (MenuDom != null) {
                              for (var i = 0; i < MenuDom.options.length; i++) {
                                  MenuDom.options[i].selected = true;
                              }
                          }
                      Severity: Major
                      Found in assets/js/publisher.js and 1 other location - About 1 hr to fix
                      assets/js/publisher.js on lines 27..31

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

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

                          if (MenuDom != null) {
                              for (var i = 0; i < MenuDom.options.length; i++) {
                                  MenuDom.options[i].selected = true;
                              }
                          }
                      Severity: Major
                      Found in assets/js/publisher.js and 1 other location - About 1 hr to fix
                      assets/js/publisher.js on lines 9..13

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

                      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

                      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
                        Severity
                        Category
                        Status
                        Source
                        Language