mambax7/publisher

View on GitHub

Showing 355 of 3,032 total issues

Method getAllOffline has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

    Method getAllSubmitted has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

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

      Method getAllExpired has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

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

        Method getAllRejected has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

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

          Method isBlockCloned has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function isBlockCloned(int $bid, 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

            Function calcDocRoot has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function calcDocRoot()
                {
                    $docRoot = @$_SERVER['DOCUMENT_ROOT'];
                    if (defined('LOCAL_FILE_BASE_DIRECTORY')) {
                        $docRoot = LOCAL_FILE_BASE_DIRECTORY;
            Severity: Minor
            Found in thumb.php - About 55 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 apply has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                apply: function () {
                    for (h = 0; sheet = Behaviour.list[h]; h++) {
                        for (selector in sheet) {
                            list = document.getElementsBySelector(selector);
            
            
            Severity: Minor
            Found in assets/js/behavior.js - About 55 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 rmove has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function rmove($src, $dest)
                {
                    // Only continue if user is a 'global' Admin
                    if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
                        return false;
            Severity: Minor
            Found in class/Common/FilesManagement.php - About 55 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 recurseCopy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function recurseCopy(string $src, string $dst): void
                {
                    $dir = \opendir($src);
                    if (!\mkdir($dst) && !\is_dir($dst)) {
                        throw new \RuntimeException(\sprintf('Directory "%s" was not created', $dst));
            Severity: Minor
            Found in class/Common/FilesManagement.php - About 55 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 rcopy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function rcopy($src, $dest)
                {
                    // Only continue if user is a 'global' Admin
                    if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
                        return false;
            Severity: Minor
            Found in class/Common/FilesManagement.php - About 55 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 insert has a Cognitive Complexity of 9 (exceeds 5 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 55 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 getItemsCriteria has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                private function getItemsCriteria($categoryid = -1, $status = '', $notNullFields = null, $criteriaPermissions = null)
                {
                    //        $notNullFields = (null !== $notNullFields) ?: '';
                    //        global $publisherIsAdmin;
                    //        $ret = 0;
            Severity: Minor
            Found in class/ItemHandler.php - About 55 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 store has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public function store($force = true)
                {
                    $isNew = $this->isNew();
                    if (!$this->helper->getHandler('Item')
                                      ->insert($this, $force)) {
            Severity: Minor
            Found in class/Item.php - About 55 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 getAllFiles has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function getAllFiles($itemId = 0, $status = -1, $limit = 0, $start = 0, $sort = 'datesub', $order = 'DESC', $category = [])
            Severity: Major
            Found in class/FileHandler.php - About 50 mins to fix

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

                  public function setOrder(string $bid, string $title, string $weight, string $visible, string $side, string $bcachetime, ?array $bmodule = null): void
              Severity: Major
              Found in class/Common/Blocksadmin.php - About 50 mins to fix

                Function easeInOutBack has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        easeInOutBack: function (x, t, b, c, d, s) {
                Severity: Minor
                Found in assets/js/jquery.easing.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                  if (file_exists($pagewrap_filename)) {
                                      if (copy($pagewrap_filename, PUBLISHER_UPLOAD_PATH . '/content/' . $arrArticle['htmlpage'])) {
                                          $itemObj->setVar('body', '[pagewrap=' . $arrArticle['htmlpage'] . ']');
                                          echo sprintf('&nbsp;&nbsp;&nbsp;&nbsp;' . _AM_PUBLISHER_IMPORT_ARTICLE_WRAP, $arrArticle['htmlpage']) . '<br>';
                                      }
                  Severity: Major
                  Found in admin/import/wfsection.php - About 45 mins to fix

                    Function easeOutBack has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            easeOutBack: function (x, t, b, c, d, s) {
                    Severity: Minor
                    Found in assets/js/jquery.easing.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                      if (file_exists($filename)) {
                                          if (copy($filename, $GLOBALS['xoops']->path('uploads/publisher/' . $arrFile['filerealname']))) {
                                              /** @var File $fileObj */
                                              $fileObj = $helper->getHandler('File')
                                                                ->create();
                      Severity: Major
                      Found in admin/import/xnews.php - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                        if (file_exists($filename)) {
                                            if (copy($filename, PUBLISHER_UPLOAD_PATH . '/' . $arrFile['filerealname'])) {
                                                /** @var File $fileObj */
                                                $fileObj = $helper->getHandler('File')
                                                                  ->create();
                        Severity: Major
                        Found in admin/import/xfsection.php - About 45 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language