mambax7/extgallery

View on GitHub

Showing 701 of 9,653 total issues

Function addPan has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    addPan : function( img ) {

        if ( this._options.imageCrop === false ) {
            return;
        }
Severity: Major
Found in assets/js/galleria/galleria-1.3.5.js - About 2 hrs to fix

    Method truncateHtml has 63 lines of code (exceeds 25 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: Major
    Found in class/Common/SysUtility.php - About 2 hrs to fix

      Method truncateHtml has 63 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              $open_tags = [];
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
      Severity: Major
      Found in class/Utility.php - About 2 hrs to fix

        Method postPhotoTraitement has 63 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function postPhotoTraitement($file, $checkMd5 = false)
            {
                //        require_once XOOPS_ROOT_PATH.'/modules/extgallery/class/photoUploader.php';
        
                $catHandler = Extgallery\Helper::getInstance()->getHandler('PublicCategory');
        Severity: Major
        Found in class/PhotoHandler.php - About 2 hrs to fix

          CategoryHandler has 23 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class CategoryHandler extends Extgallery\PersistableObjectHandler
          {
              //var $_nestedTree;
              public $_photoHandler;
          
          
          Severity: Minor
          Found in class/CategoryHandler.php - About 2 hrs to fix

            Function addPan has 61 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                addPan : function( img ) {
            
                    if ( this._options.image_crop === false ) {
                        return;
                    }
            Severity: Major
            Found in assets/js/galleria/galleria-1.1.js - About 2 hrs to fix

              Function success has 61 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          success: function() {
                              // calculate some cropping
                              var newWidth = ( width - options.margin * 2 ) / self.original.width,
                                  newHeight = ( height - options.margin * 2 ) / self.original.height,
                                  cropMap = {
              Severity: Major
              Found in assets/js/galleria/galleria-1.1.js - About 2 hrs to fix

                Function deleteDirectory has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function deleteDirectory($src)
                    {
                        // Only continue if user is a 'global' Admin
                        if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
                            return false;
                Severity: Minor
                Found in class/Common/FilesManagement.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 _raiseError has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected static function _raiseError(
                        $object,
                        $message = null,
                        $code = null,
                        $mode = null,
                Severity: Minor
                Found in class/pear/PEAR.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 _PEAR_call_destructors has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                Open

                function _PEAR_call_destructors()
                {
                    global $_PEAR_destructor_object_list;
                    if (is_array($_PEAR_destructor_object_list)
                        && count($_PEAR_destructor_object_list)) {
                Severity: Minor
                Found in class/pear/PEAR.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 PclTarHandleReadHeader has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                Open

                    function PclTarHandleReadHeader($v_binary_data, &$v_header)
                    {
                        TrFctStart(__FILE__, __LINE__, 'PclTarHandleReadHeader', '');
                        $v_result = 1;
                
                
                Severity: Minor
                Found in class/pcltar.lib.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 SetCharSet has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function SetCharSet($vCharSet)
                    {
                        // check for input type
                        if (\is_array($vCharSet)) {
                            $this->aCharSet = $vCharSet;
                Severity: Minor
                Found in class/PhpCaptcha.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 init has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        init : function() {
                
                            // trigger the event
                            self.trigger( Galleria.LIGHTBOX_OPEN );
                
                
                Severity: Major
                Found in assets/js/galleria/galleria-1.1.js - About 2 hrs to fix

                  PhpCaptcha has 22 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class PhpCaptcha
                  {
                      public $oImage;
                      public $aFonts;
                      public $iWidth;
                  Severity: Minor
                  Found in class/PhpCaptcha.php - About 2 hrs to fix

                    Function loadCSS has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                loadCSS : function( href, id, callback ) {
                    
                                    var link,
                                        length;
                    
                    
                    Severity: Major
                    Found in assets/js/galleria/galleria-1.3.3.js - About 2 hrs to fix

                      Function loadCSS has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  loadCSS : function( href, id, callback ) {
                      
                                      var link,
                                          length;
                      
                      
                      Severity: Major
                      Found in assets/js/galleria/galleria-1.3.5.js - About 2 hrs to fix

                        Function refresh has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                    refresh: function() {
                                        var imageData = this.currentImage;
                                        if (!imageData)
                                            return this;
                        
                        
                        Severity: Major
                        Found in assets/js/galleriffic/jquery.galleriffic.js - About 2 hrs to fix

                          Method _get_image_details has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function _get_image_details($image)
                              {
                                  $data = @getimagesize($image);
                                  //  1 = GIF,   2 = JPG,  3 = PNG,  4 = SWF,  5 = PSD,  6 = BMP,
                                  //  7 = TIFF (intel byte order),   8 = TIFF (motorola byte order),
                          Severity: Major
                          Found in class/pear/Image/Transform.php - About 2 hrs to fix

                            Function _process_title has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    _process_title = function() {
                                        titleStr = currentOpts.title || '';
                                        titleHeight = 0;
                            
                                        title
                            Severity: Major
                            Found in assets/js/fancybox/fancybox.js - About 2 hrs to fix

                              File pcltrace.lib.php has 261 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              <?php
                              
                              namespace XoopsModules\Extgallery;
                              
                              // --------------------------------------------------------------------------------
                              Severity: Minor
                              Found in class/pcltrace.lib.php - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language