mambax7/publisher

View on GitHub

Showing 336 of 2,127 total issues

File xoops_version.php has 1561 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
Severity: Major
Found in xoops_version.php - About 4 days to fix

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

    <?php
    
    declare(strict_types=1);
    /**
     * TimThumb by Ben Gillbanks and Mark Maunder
    Severity: Major
    Found in thumb.php - About 3 days to fix

      File Utility.php has 894 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 408 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 753 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 createElements has a Cognitive Complexity of 86 (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

              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

              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

                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

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

                  function xoops_module_update_publisher(\XoopsModule $module, $previousVersion = null)
                  {
                      global $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

                  Method listBlocks has 212 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function listBlocks()
                      {
                          global $xoopsModule, $pathIcon16;
                          //        require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                          xoops_load('xoopslist');
                  Severity: Major
                  Found in admin/blocksadmin.php - About 1 day to fix

                    Function truncateHtml has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
                        {
                            if ($considerHtml) {
                                // if the plain text is shorter than the maximum length, return the whole text
                                if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
                    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

                    File blocksadmin.php has 500 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    declare(strict_types=1);
                    
                    /**
                    Severity: Minor
                    Found in admin/blocksadmin.php - About 1 day to fix

                      File ItemForm.php has 496 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

                        Method publisher_latest_news_show has 195 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function publisher_latest_news_show($options)
                        {
                            $block = [];
                        
                            $configurator = new Configurator();
                        Severity: Major
                        Found in blocks/latest_news.php - About 7 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language