mambax7/extgallery

View on GitHub

Showing 701 of 9,653 total issues

Method _makeWatermark has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function _makeWatermark($imageTransform)
    {
        if (!\function_exists('imagettfbbox')) {
            return;
        }
Severity: Minor
Found in class/PhotoHandler.php - About 1 hr to fix

    Function xoops_module_update_extgallery has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    function xoops_module_update_extgallery(\XoopsModule $xoopsModule, $oldVersion = null)
    {
        $catHandler = Extgallery\Helper::getInstance()->getHandler('PublicCategory');
        $catHandler->rebuild();
    
    
    Severity: Minor
    Found in include/update_function.php - About 1 hr 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 extgalleryList has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    function extgalleryList($options)
    {
        global $xoopsConfig;
    
        /** @var Extgallery\PhotoHandler $photoHandler */
    Severity: Minor
    Found in blocks/extgallery_blocks.php - About 1 hr 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 __construct has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        public function __construct()
        {
            if (!PEAR::loadExtension('gd')) {
                $this->isError(PEAR::raiseError('GD library is not available.', IMAGE_TRANSFORM_ERROR_UNSUPPORTED));
            } else {
    Severity: Minor
    Found in class/pear/Image/Transform/Driver/GD.php - About 1 hr 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 onload has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                onload = (function( self, callback, src ) {
    
                    return function() {
    
                        var complete = function() {
    Severity: Minor
    Found in assets/js/galleria/galleria-1.3.3.js - About 1 hr to fix

      Function onThumbLoad has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  onThumbLoad = function( thumb, callback ) {
      
                      // scale when ready
                      thumb.scale({
                          width:    thumb.data.width,
      Severity: Minor
      Found in assets/js/galleria/galleria-1.3.3.js - About 1 hr to fix

        Function onThumbLoad has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    onThumbLoad = function( thumb, callback ) {
        
                        // scale when ready
                        thumb.scale({
                            width:    thumb.data.width,
        Severity: Minor
        Found in assets/js/galleria/galleria-1.3.5.js - About 1 hr to fix

          Function onload has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      onload = (function( self, callback, src ) {
          
                          return function() {
          
                              var complete = function() {
          Severity: Minor
          Found in assets/js/galleria/galleria-1.3.5.js - About 1 hr to fix

            Function tipsy has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                $.fn.tipsy = function(options) {
            
                    if (options === true) {
                        return this.data('tipsy');
                    } else if (typeof options == 'string') {
            Severity: Minor
            Found in assets/js/ml-slider/assets/tipsy/jquery.tipsy.js - About 1 hr to fix

              Method addLocalPhoto has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function addLocalPhoto(
                      $catId,
                      $dirtyPhotoName,
                      $photoTitle = '',
                      $photoDesc = '',
              Severity: Minor
              Found in class/PhotoHandler.php - About 1 hr to fix

                Function appendHTML has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function appendHTML() {
                        if (!$box && document.body) {
                            init = false;
                            $window = $(window);
                            $box = $tag(div).attr({
                Severity: Minor
                Found in assets/js/ml-slider/assets/colorbox/jquery.colorbox-min.js - About 1 hr to fix

                  Method get_easing_options has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function get_easing_options()
                      {
                          $options = [
                              'linear',
                              'swing',
                  Severity: Minor
                  Found in assets/js/ml-slider/ml-slider.php - About 1 hr to fix

                    Method checkVerModule has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static function checkVerModule($helper, $source = 'github', $default = 'master')
                        {
                            $moduleDirName      = \basename(\dirname(__DIR__, 2));
                            $moduleDirNameUpper = mb_strtoupper($moduleDirName);
                            $update             = '';
                    Severity: Minor
                    Found in class/Common/VersionChecks.php - About 1 hr to fix

                      Function load has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      Galleria.prototype.load = function() {
                      
                          // pass if no data is provided or flickr option not found
                          if ( arguments.length || typeof this._options.flickr !== 'string' ) {
                              load.apply( this, Galleria.utils.array( arguments ) );
                      Severity: Minor
                      Found in assets/js/galleria/plugins/flickr/galleria.flickr.js - About 1 hr to fix

                        Method _generate has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function _generate($filename, $type = '', $quality = null)
                            {
                                $type    = mb_strtolower(('' == $type) ? $this->type : $type);
                                $options = is_array($quality) ? $quality : [];
                                switch ($type) {
                        Severity: Minor
                        Found in class/pear/Image/Transform/Driver/GD.php - About 1 hr to fix

                          Function _call has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              _call: function( type, url, params, callback ) {
                          
                                  url = 'https://picasaweb.google.com/data/feed/api/' + url + '?';
                          
                                  if (typeof params == 'function') {
                          Severity: Minor
                          Found in assets/js/galleria/plugins/picasa/galleria.picasa.js - About 1 hr to fix

                            Function complButton has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function complButton( btn, o )
                                {
                                    var navi = ( btn != 'close' );
                            
                                    if ( navi && $.isNumeric( o[ btn ] ) )
                            Severity: Minor
                            Found in assets/js/TosRUs/src/js/jquery.tosrus.js - About 1 hr to fix

                              Method extgalleryListEdit has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function extgalleryListEdit($options)
                              {
                                  $catHandler = Extgallery\Helper::getInstance()->getHandler('PublicCategory');
                                  $form       = _MB_EXTGALLERY_PHOTO_NUMBER . ' : <input name="options[]" size="5" maxlength="255" value="' . $options[0] . '" type="text"><br>';
                                  //==================================
                              Severity: Minor
                              Found in blocks/extgallery_blocks.php - About 1 hr to fix

                                Function ccmValidateBlockForm has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function ccmValidateBlockForm() {
                                
                                    if ($('#magnific_type').val() == 'select1') {
                                        ccm_addError(ccm_t('selection-required'));
                                    }

                                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 loadTableFromArrayWithReplace has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function loadTableFromArrayWithReplace($table, $data, $search, $replace)
                                {
                                    /** @var \XoopsMySQLDatabase $db */
                                    $db = \XoopsDatabaseFactory::getDatabaseConnection();
                                
                                
                                Severity: Minor
                                Found in testdata/index.php - About 1 hr 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

                                Severity
                                Category
                                Status
                                Source
                                Language