mambax7/publisher

View on GitHub

Showing 355 of 3,032 total issues

Method setVarsFromRequest has 95 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function setVarsFromRequest(): void
    {
        //Required fields
        //        if (!empty($categoryid = Request::getInt('categoryid', 0, 'POST'))) {
        //            $this->setVar('categoryid', $categoryid);}
Severity: Major
Found in class/Item.php - About 3 hrs to fix

    Function publisher_items_recent_show has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

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

        public function setVarsFromRequest(): void
        {
            //Required fields
            //        if (!empty($categoryid = Request::getInt('categoryid', 0, 'POST'))) {
            //            $this->setVar('categoryid', $categoryid);}
    Severity: Minor
    Found in class/Item.php - About 3 hrs 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 89 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function __construct()
        {
            global $allowedSites;
            $this->startTime = microtime(true);
            date_default_timezone_set('UTC');
    Severity: Major
    Found in thumb.php - About 3 hrs to fix

      Method publisher_items_recent_show has 86 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function publisher_items_recent_show($options)
      {
          $helper = Helper::getInstance();
          /** @var ItemHandler $itemHandler */
          $itemHandler = $helper->getHandler('Item');
      Severity: Major
      Found in blocks/items_recent.php - About 3 hrs to fix

        Function edit has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function edit(): void
            {
                $helper = Helper::getInstance();
                /** @var MimetypeHandler $mimetypeHandler */
                $mimetypeHandler = $helper->getHandler('Mimetype');
        Severity: Minor
        Found in class/MimetypesUtility.php - About 3 hrs 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 publisher_items_columns_show has 85 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function publisher_items_columns_show($options)
        {
            //    global $xoTheme;
            $helper = Helper::getInstance();
            /** @var CategoryHandler $categoryHandler */
        Severity: Major
        Found in blocks/items_columns.php - About 3 hrs to fix

          ThemeTabForm has 28 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class ThemeTabForm extends \XoopsForm
          {
              public $formTabs = [];
              /**
               * "action" attribute for the html form
          Severity: Minor
          Found in class/Form/ThemeTabForm.php - About 3 hrs to fix

            Method xoops_module_update_publisher has 82 lines of code (exceeds 25 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: Major
            Found in include/onupdate.php - About 3 hrs to fix

              Function publisher_search has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
              Open

              function publisher_search($queryArray, $andor, $limit, $offset, $userid, $categories = [], $sortby = 0, $searchin = '', $extra = '')
              {
                  $helper        = Helper::getInstance();
                  $ret           = $item = [];
                  $hightlightKey = '';
              Severity: Minor
              Found in include/search.inc.php - About 3 hrs 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 getItemsFromSearch has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getItemsFromSearch($queryArray = [], $andor = 'AND', $limit = 0, $offset = 0, $userid = 0, $categories = [], $sortby = 0, $searchin = '', $extra = '')
                  {
                      $count            = 0;
                      $ret              = [];
                      $criteriaKeywords = $criteriaPermissions = $criteriaUser = null;
              Severity: Minor
              Found in class/ItemHandler.php - About 3 hrs 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 search has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function search($icons): void
                  {
                      $helper = Helper::getInstance();
                      /** @var MimetypeHandler $mimetypeHandler */
                      $mimetypeHandler = $helper->getHandler('Mimetype');
              Severity: Minor
              Found in class/MimetypesUtility.php - About 3 hrs 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 getItemsFromSearch has 76 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getItemsFromSearch($queryArray = [], $andor = 'AND', $limit = 0, $offset = 0, $userid = 0, $categories = [], $sortby = 0, $searchin = '', $extra = '')
                  {
                      $count            = 0;
                      $ret              = [];
                      $criteriaKeywords = $criteriaPermissions = $criteriaUser = null;
              Severity: Major
              Found in class/ItemHandler.php - About 3 hrs to fix

                Consider simplifying this complex logical expression.
                Open

                    if (document.documentElement.getBoundingClientRect) {
                        // Get Offset using getBoundingClientRect
                        // http://ejohn.org/blog/getboundingclientrect-is-awesome/
                        var getOffset = function (el) {
                            var box = el.getBoundingClientRect();
                Severity: Critical
                Found in assets/js/ajaxupload.3.9.js - About 3 hrs to fix

                  Function getLocalImagePath has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function getLocalImagePath($src)
                      {
                          $src = ltrim($src, '/'); //strip off the leading '/'
                          if (!$this->docRoot) {
                              $this->debug(3, 'We have no document root set, so as a last resort, lets check if the image is in the current dir and serve that.');
                  Severity: Minor
                  Found in thumb.php - About 2 hrs 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 updateBlock has a Cognitive Complexity of 21 (exceeds 5 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 2 hrs 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 editCategory has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function editCategory($showmenu = false, $categoryid = 0, $nbSubCats = 4, $categoryObj = null): void
                      {
                          $helper       = Helper::getInstance();
                          $configurator = new Common\Configurator();
                          $icons        = $configurator->icons;
                  Severity: Minor
                  Found in class/Utility.php - About 2 hrs 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 checkVerModule has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function checkVerModule(\Xmf\Module\Helper $helper, ?string $source = 'github', ?string $default = 'master'): ?array
                      {
                          /*
                                  // Generated by curl-to-PHP: https://incarnate.github.io/curl-to-php/
                                  $ch = curl_init();
                  Severity: Minor
                  Found in class/Common/VersionChecks.php - About 2 hrs 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 orderBlock has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function orderBlock(
                          array $bid,
                          array $oldtitle,
                          array $oldside,
                          array $oldweight,
                  Severity: Minor
                  Found in class/Common/Blocksadmin.php - About 2 hrs 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 toArraySimple has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function toArraySimple($display = 'default', $maxCharTitle = 0, $maxCharSummary = 300, $fullSummary = false)
                      {
                          $itemPageId = -1;
                          if (\is_numeric($display)) {
                              $itemPageId = $display;
                  Severity: Major
                  Found in class/Item.php - About 2 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language