mambax7/extgallery

View on GitHub

Showing 701 of 9,653 total issues

Function fetchPhoto has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

    public function fetchPhoto($file)
    {
        $jupart  = Request::getInt('jupart', 0, 'POST');
        $jufinal = Request::getInt('jufinal', 1, 'POST');
        $md5sums = $_POST['md5sum'][0] ?? null;
Severity: Minor
Found in class/PhotoUploader.php - About 6 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 _start has 160 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        _start = function() {
            var obj = selectedArray[ selectedIndex ],
                href,
                type,
                title,
Severity: Major
Found in assets/js/fancybox/fancybox.js - About 6 hrs to fix

    Function open has 160 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        open: function(data) {
    
            if(!_body) {
                _body = $(document.body);
            }
    Severity: Major
    Found in assets/js/magnific_popup/jquery.magnific-popup.js - About 6 hrs to fix

      File watermark-border.php has 432 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      /**
       * ExtGallery Admin settings
       * Manage admin pages
      Severity: Minor
      Found in admin/watermark-border.php - About 6 hrs to fix

        Function rotate has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
        Open

            public function rotate($angle, $options = null)
            {
                if (null === $options) {
                    $autoresize = true;
                    $color_mask = [255, 255, 0];
        Severity: Minor
        Found in class/pear/Image/Transform/Driver/GD1.php - About 6 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 listBlocks has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
        Open

            function listBlocks()
            {
                global $xoopsModule, $pathIcon16;
                require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                $moduleDirName      = \basename(\dirname(__DIR__));
        Severity: Minor
        Found in admin/blocksadmin.php - About 6 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 PclTarMerge has 154 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function PclTarMerge($p_tarname, $p_tarname_add, $p_mode = '', $p_mode_add = '')
            {
                TrFctStart(__FILE__, __LINE__, 'PclTarMerge', "tar='$p_tarname', tar_add='$p_tarname_add', mode='$p_mode', mode_add='$p_mode_add'");
                $v_result = 1;
        
        
        Severity: Major
        Found in class/pcltar.lib.php - About 6 hrs to fix

          Function scale has 152 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              scale: function( options ) {
          
                  var self = this;
          
                  // extend some defaults
          Severity: Major
          Found in assets/js/galleria/galleria-1.3.3.js - About 6 hrs to fix

            Function scale has 152 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                scale: function( options ) {
            
                    var self = this;
            
                    // extend some defaults
            Severity: Major
            Found in assets/js/galleria/galleria-1.3.5.js - About 6 hrs to fix

              Method extgalleryPhotoShow has 149 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function extgalleryPhotoShow($options)
              {
                  global $xoopsConfig;
                  $photos = [];
              
              
              Severity: Major
              Found in blocks/extgallery_blocks.php - About 5 hrs to fix

                File album.php has 415 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /**
                 * ExtGallery Admin settings
                 * Manage admin pages
                 *
                Severity: Minor
                Found in admin/album.php - About 5 hrs to fix

                  Function get_crop_dimensions has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function get_crop_dimensions($image_width, $image_height)
                      {
                          if ('false' === $this->smart_crop) {
                              return ['width' => $this->container_width, 'height' => $this->container_height];
                          }
                  Severity: Minor
                  Found in assets/js/ml-slider/inc/metaslider.imagehelper.class.php - About 5 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 build_settings_rows has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function build_settings_rows($aFields)
                      {
                          // order the fields by priority
                          uasort($aFields, [$this, 'compare_elems']);
                  
                  
                  Severity: Minor
                  Found in assets/js/ml-slider/ml-slider.php - About 5 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 PclTarHandleAppend has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                  Open

                      function PclTarHandleAppend($p_tarname, $p_list, $p_mode, &$p_list_detail, $p_add_dir, $p_remove_dir)
                      {
                          TrFctStart(__FILE__, __LINE__, 'PclTarHandleAppend', "tar=$p_tarname, list, mode=$p_mode");
                          $v_result = 1;
                  
                  
                  Severity: Minor
                  Found in class/pcltar.lib.php - About 5 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 mkDir has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function mkDir($args)
                      {
                          $opts = self::_parseArgs($args, 'pm:');
                          if (PEAR::isError($opts)) {
                              return self::raiseError($opts);
                  Severity: Minor
                  Found in class/pear/System.php - About 5 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 extgalleryAjax has 142 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function extgalleryAjax($options)
                  {
                      $photos = [];
                      /** @var Extgallery\PhotoHandler $photoHandler */
                      $photoHandler       = Extgallery\Helper::getInstance()->getHandler('PublicPhoto');
                  Severity: Major
                  Found in blocks/extgallery_blocks.php - About 5 hrs to fix

                    Function _enter has 136 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            _enter: function( callback ) {
                    
                                fullscreen.active = true;
                    
                                if ( IFRAME ) {
                    Severity: Major
                    Found in assets/js/galleria/galleria-1.3.5.js - About 5 hrs to fix

                      Method xoops_module_update_extgallery has 136 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function xoops_module_update_extgallery(\XoopsModule $module, $previousVersion = null)
                      {
                          global $xoopsDB;
                      
                          $moduleDirName      = \basename(\dirname(__DIR__));
                      Severity: Major
                      Found in include/onupdate.php - About 5 hrs to fix

                        Function _enter has 132 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                _enter: function( callback ) {
                        
                                    fullscreen.active = true;
                        
                                    if ( IFRAME ) {
                        Severity: Major
                        Found in assets/js/galleria/galleria-1.3.3.js - About 5 hrs to fix

                          Method PclTarHandleDelete has 132 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function PclTarHandleDelete($p_tarname, $p_file_list, &$p_list_detail, $p_tar_mode)
                              {
                                  TrFctStart(__FILE__, __LINE__, 'PclTarHandleDelete', "archive='$p_tarname', list, tar_mode=$p_tar_mode");
                                  $v_result = 1;
                                  $v_nb     = 0;
                          Severity: Major
                          Found in class/pcltar.lib.php - About 5 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language