mambax7/publisher

View on GitHub

Showing 355 of 3,032 total issues

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/ams.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if ($fileObj->storeUpload('item_upload_file', $allowedMimetypes, $errors)) {
                            unlink($oldfile);
                        }
    Severity: Major
    Found in file.php - About 45 mins to fix

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

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

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

        function setCookie(name, value, expires, path, domain, secure) {
        Severity: Minor
        Found in assets/js/cookies.js - About 45 mins to fix

          Function getIP has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function getIP()
              {
                  $rem = @$_SERVER['REMOTE_ADDR'];
                  $ff  = @$_SERVER['HTTP_X_FORWARDED_FOR'];
                  $ci  = @$_SERVER['HTTP_CLIENT_IP'];
          Severity: Minor
          Found in thumb.php - About 45 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

          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/xfsection.php - 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

              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/wfsection.php - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                            if (is_file($templateFolder . $v)) {
                                                unlink($templateFolder . $v);
                                            }
                Severity: Major
                Found in include/onupdate.php - 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['filename']))) {
                                          /** @var File $fileObj */
                                          $fileObj = $helper->getHandler('File')
                                                            ->create();
                  Severity: Major
                  Found in admin/import/smartsection.php - About 45 mins to fix

                    Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public function __construct($caption, $name, $size = 15, $value = 0, $showtime = true, $formatTimestamp = true)
                    Severity: Minor
                    Found in class/FormDateTime.php - About 45 mins to fix

                      Function recurseCopy has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static function recurseCopy($src, $dst): void
                          {
                              $dir = \opendir($src);
                              //    @mkdir($dst);
                              while (false !== ($file = \readdir($dir))) {
                      Severity: Minor
                      Found in class/Utility.php - About 45 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 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function store($allowedMimetypes = null, $force = true, $doupload = true)
                          {
                              if ($this->isNew()) {
                                  $errors = [];
                                  $ret    = true;
                      Severity: Minor
                      Found in class/File.php - About 45 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 __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public function __construct($title, $name, $action, $method = 'post', $addtoken = false, $summary = '')
                      Severity: Minor
                      Found in class/Form/ThemeTabForm.php - About 45 mins to fix

                        Function mkdir has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static function mkdir($target)
                            {
                                // https://www.php.net/manual/en/function.mkdir.php
                                // saint at corenova.com
                                // bart at cdasites dot com
                        Severity: Minor
                        Found in class/Utility.php - About 45 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 addElement has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function addElement($formElement, $required = false): void
                            {
                                if (\is_string($formElement)) {
                                    $this->elements[] = &$formElement;
                                } elseif (\is_subclass_of($formElement, 'xoopsformelement')) {
                        Severity: Minor
                        Found in class/Form/ThemeTabForm.php - About 45 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 generateUrl has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static function generateUrl($op, $id, $shortUrl = '')
                            {
                                $helper = Helper::getInstance();
                                if ('none' !== $helper->getConfig('seo_url_rewrite')) {
                                    if (!empty($shortUrl)) {
                        Severity: Minor
                        Found in class/Seo.php - About 45 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 publisher_items_menu_show has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function publisher_items_menu_show($options)
                        {
                            $block = [];
                        
                            $helper = Helper::getInstance();
                        Severity: Minor
                        Found in blocks/items_menu.php - About 45 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 getCategories has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            public function &getCategories($limit = 0, $start = 0, $parentid = 0, $sort = 'weight', $order = 'ASC', $idAsKey = true)
                        Severity: Minor
                        Found in class/CategoryHandler.php - About 45 mins to fix

                          Function convertForJapanese has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              protected function convertForJapanese($str)
                              {
                                  // no action, if not flag
                                  if (!\defined('_PUBLISHER_FLAG_JP_CONVERT')) {
                                      return $str;
                          Severity: Minor
                          Found in class/Item.php - About 45 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

                          Severity
                          Category
                          Status
                          Source
                          Language