mambax7/publisher

View on GitHub

Showing 355 of 3,032 total issues

File xoops_version.php has 1594 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php declare(strict_types=1);
/*
 You may not change or alter any portion of this comment or credits
 of supporting developers from this source code or any supporting source code
 which is considered copyrighted (c) material of the original comment or credit authors.
Severity: Major
Found in xoops_version.php - About 4 days to fix

    File thumb.php has 1190 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php declare(strict_types=1);
    /**
     * TimThumb by Ben Gillbanks and Mark Maunder
     * Based on work done by Tim McDaniels and Darren Hoyt
     * https://code.google.com/p/timthumb/
    Severity: Major
    Found in thumb.php - About 3 days to fix

      File Utility.php has 922 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php declare(strict_types=1);
      
      namespace XoopsModules\Publisher;
      
      /*
      Severity: Major
      Found in class/Utility.php - About 2 days to fix

        Method createElements has 413 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function createElements($obj)
            {
                $helper       = Helper::getInstance();
                $timeoffset   = null;
                $configurator = new Configurator();
        Severity: Major
        Found in class/Form/ItemForm.php - About 2 days to fix

          Function popeye has 391 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              $.fn.popeye = function (options) {
                  'use strict';
          
                  // build main options before element iteration
                  //----------------------------------------------------------------------
          Severity: Major
          Found in assets/js/jquery.popeye-2.1.js - About 1 day to fix

            File Item.php has 779 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php declare(strict_types=1);
            
            namespace XoopsModules\Publisher;
            
            /*
            Severity: Major
            Found in class/Item.php - About 1 day to fix

              Function processImageAndWriteToCache has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function processImageAndWriteToCache($localImage)
                  {
                      $sData    = getimagesize($localImage);
                      $origType = $sData[2];
                      $mimeType = $sData['mime'];
              Severity: Minor
              Found in thumb.php - About 1 day 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 createElements has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function createElements($obj)
                  {
                      $helper       = Helper::getInstance();
                      $timeoffset   = null;
                      $configurator = new Configurator();
              Severity: Minor
              Found in class/Form/ItemForm.php - About 1 day 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

              File MimetypesUtility.php has 642 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php declare(strict_types=1);
              
              namespace XoopsModules\Publisher;
              
              /*
              Severity: Major
              Found in class/MimetypesUtility.php - About 1 day to fix

                Function publisher_latest_news_show has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring.
                Open

                function publisher_latest_news_show($options)
                {
                    $block = [];
                
                    $configurator = new Configurator();
                Severity: Minor
                Found in blocks/latest_news.php - About 1 day 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 getElementsBySelector has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
                Open

                document.getElementsBySelector = function (selector) {
                    // Attempt to fail gracefully in lesser browsers
                    if (!document.getElementsByTagName) {
                        return new Array();
                    }
                Severity: Minor
                Found in assets/js/behavior.js - About 1 day 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

                File Blocksadmin.php has 590 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php declare(strict_types=1);
                
                namespace XoopsModules\Publisher\Common;
                
                /**
                Severity: Major
                Found in class/Common/Blocksadmin.php - About 1 day to fix

                  Method processImageAndWriteToCache has 248 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected function processImageAndWriteToCache($localImage)
                      {
                          $sData    = getimagesize($localImage);
                          $origType = $sData[2];
                          $mimeType = $sData['mime'];
                  Severity: Major
                  Found in thumb.php - About 1 day to fix

                    Function publisher_items_new_show has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function publisher_items_new_show($options)
                    {
                        $helper = Helper::getInstance();
                        /** @var ItemHandler $itemHandler */
                        $itemHandler = $helper->getHandler('Item');
                    Severity: Minor
                    Found in blocks/items_new.php - About 1 day 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_spot_show has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function publisher_items_spot_show($options)
                    {
                        //    global $xoTheme;
                        $helper = Helper::getInstance();
                        /** @var CategoryHandler $categoryHandler */
                    Severity: Minor
                    Found in blocks/items_spot.php - About 1 day 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 listBlocks has 219 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function listBlocks(): void
                        {
                            global $xoopsModule, $pathIcon16;
                            require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                            //        xoops_loadLanguage('admin', 'system');
                    Severity: Major
                    Found in class/Common/Blocksadmin.php - About 1 day to fix

                      Function xoops_module_update_publisher has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function xoops_module_update_publisher(\XoopsModule $module, ?string $previousVersion = null)
                      {
                          //    global $GLOBALS['xoopsDB'];
                          $moduleDirName = \basename(\dirname(__DIR__));
                          //    $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                      Severity: Minor
                      Found in include/onupdate.php - About 1 day 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 truncateHtml has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static function truncateHtml(
                              string $text,
                              ?int $length = 100,
                              string $ending = '...',
                              bool $exact = false,
                      Severity: Minor
                      Found in class/Common/SysUtility.php - About 1 day 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 createSchemaFromSqlfile has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function createSchemaFromSqlfile(): bool
                          {
                              if (!\is_file($this->fileSql)) {
                                  \xoops_error('Error: Sql file not found!');
                                  return false;
                      Severity: Minor
                      Found in class/Common/MigrateHelper.php - About 1 day 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

                      File ItemForm.php has 498 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php declare(strict_types=1);
                      
                      namespace XoopsModules\Publisher\Form;
                      
                      /*
                      Severity: Minor
                      Found in class/Form/ItemForm.php - About 7 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language