mambax7/publisher

View on GitHub

Showing 355 of 3,032 total issues

Method publisher_category_items_sel_show has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function publisher_category_items_sel_show($options)
{
    $helper = Helper::getInstance();

    $block = $item = [];
Severity: Minor
Found in blocks/category_items_sel.php - About 1 hr to fix

    Method html2text has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function html2text($document)
        {
            if (empty($document)) {
                return '';
            }
    Severity: Minor
    Found in class/Metagen.php - About 1 hr to fix

      Function _getResponse has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              _getResponse: function (iframe, file) {
                  // getting response
                  var toDeleteFlag = false, self = this, settings = this._settings;
      
                  addEvent(iframe, 'load', function () {
      Severity: Minor
      Found in assets/js/ajaxupload.3.9.js - About 1 hr to fix

        Method updateBlock has 41 lines of code (exceeds 25 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
            {
                $myblock = new \XoopsBlock($bid);
                $myblock->setVar('title', $btitle);
                $myblock->setVar('weight', $bweight);
        Severity: Minor
        Found in class/Common/Blocksadmin.php - About 1 hr to fix

          Method displayCategory has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function displayCategory(Category $categoryObj, $level = 0): void
              {
                  $helper       = Helper::getInstance();
                  $configurator = new Common\Configurator();
                  $icons        = $configurator->icons;
          Severity: Minor
          Found in class/Utility.php - About 1 hr to fix

            Method createDir has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function createDir(): void
                {
                    // auto crate folders
                    //        $thePath = static::getUploadDir();
            
            
            Severity: Minor
            Found in class/Utility.php - About 1 hr to fix

              Function loadTableFromArrayWithReplace has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

              function loadTableFromArrayWithReplace($table, $data, $search, $replace)
              {
                  /** @var \XoopsMySQLDatabase $db */
                  $db = \XoopsDatabaseFactory::getDatabaseConnection();
              
              
              Severity: Minor
              Found in testdata/index.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 publisher_latest_news_edit has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

              function publisher_latest_news_edit($options)
              {
                  $tabletag1 = '<tr><td style="padding:3px;" width="37%">';
                  $tabletag2 = '</td><td style="padding:3px;">';
                  $tabletag3 = '<tr><td style="padding-top:20px;border-bottom:1px solid #000;" colspan="2">';
              Severity: Minor
              Found in blocks/latest_news.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 tryBrowserCache has a Cognitive Complexity of 13 (exceeds 5 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

              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 tryServerCache has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function tryServerCache()
                  {
                      $this->debug(3, 'Trying server cache');
                      if (is_file($this->cachefile)) {
                          $this->debug(3, "Cachefile {$this->cachefile} exists");
              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 publisher_category_items_sel_show has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

              function publisher_category_items_sel_show($options)
              {
                  $helper = Helper::getInstance();
              
                  $block = $item = [];
              Severity: Minor
              Found in blocks/category_items_sel.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 resizeAndCrop has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function resizeAndCrop()
                  {
                      // check file extension
                      switch ($this->imageMimetype) {
                          case 'image/png':
              Severity: Minor
              Found in class/Resizer.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 getAdminLinks has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getAdminLinks($icons)
                  {
                      $adminLinks = '';
                      if (\is_object($GLOBALS['xoopsUser'])
                          && (Utility::userIsAdmin() || Utility::userIsAuthor($this)
              Severity: Minor
              Found in class/Item.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 showImage has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          function showImage(i) {
              
                              // optional parameter i
                              i = i || cur;
              
              
              Severity: Minor
              Found in assets/js/jquery.popeye-2.1.js - About 1 hr to fix

                Method __construct has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function __construct($id = null)
                    {
                        //        $this->helper = Helper::getInstance();
                        $this->db = \XoopsDatabaseFactory::getDatabaseConnection();
                        $this->initVar('itemid', \XOBJ_DTYPE_INT, 0);
                Severity: Minor
                Found in class/Item.php - About 1 hr to fix

                  Method html2text has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function html2text($document)
                      {
                          // PHP Manual:: function preg_replace
                          // $document should contain an HTML document.
                          // This will remove HTML tags, javascript sections
                  Severity: Minor
                  Found in class/Utility.php - About 1 hr to fix

                    Method getArticle has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static function getArticle(Item $itemObj, Category $categoryObj, \XoopsUser $xoopsUser, Helper $helper)
                        {
                            $itemImage = $itemObj->getVar('image');
                            if (isset($itemImage)) {
                                $imageHandler = xoops_getHandler('image');
                    Severity: Minor
                    Found in class/Jsonld.php - About 1 hr to fix

                      Method saveSampleData has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function saveSampleData(): void
                      {
                          global $xoopsConfig;
                          $moduleDirName      = \basename(\dirname(__DIR__));
                          $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                      Severity: Minor
                      Found in testdata/index.php - About 1 hr to fix

                        Method sendNotifications has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function sendNotifications($notifications = []): void
                            {
                                /** @var \XoopsNotificationHandler $notificationHandler */
                                $notificationHandler = \xoops_getHandler('notification');
                                $tags                = [];
                        Severity: Minor
                        Found in class/Item.php - About 1 hr to fix

                          Method publisher_tag_iteminfo has 36 lines of code (exceeds 25 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
                            Severity
                            Category
                            Status
                            Source
                            Language