mambax7/extgallery

View on GitHub

Showing 9,653 of 9,653 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
Severity: Major
Found in assets/js/galleryview/easing.js and 1 other location - About 1 hr to fix
assets/js/galleryview/easing.js on lines 124..124

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    if ( arguments.length || typeof this._options.picasa !== 'string' ) {
        load.apply( this, Galleria.utils.array( arguments ) );
        return;
    }
Severity: Major
Found in assets/js/galleria/plugins/picasa/galleria.picasa.js and 1 other location - About 1 hr to fix
assets/js/galleria/plugins/flickr/galleria.flickr.js on lines 321..324

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    if ( arguments.length || typeof this._options.flickr !== 'string' ) {
        load.apply( this, Galleria.utils.array( arguments ) );
        return;
    }
Severity: Major
Found in assets/js/galleria/plugins/flickr/galleria.flickr.js and 1 other location - About 1 hr to fix
assets/js/galleria/plugins/picasa/galleria.picasa.js on lines 246..249

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method updateBlock has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

    function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
Severity: Major
Found in admin/blocksadmin.php - About 1 hr to fix

    Function _getWH has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _getWH : function() {
    
            var $container = this.$( 'container' ),
                $target = this.$( 'target' ),
                self = this,
    Severity: Minor
    Found in assets/js/galleria/galleria-1.3.3.js - About 1 hr to fix

      Function _getWH has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _getWH : function() {
      
              var $container = this.$( 'container' ),
                  $target = this.$( 'target' ),
                  self = this,
      Severity: Minor
      Found in assets/js/galleria/galleria-1.3.5.js - About 1 hr to fix

        Function historyInit has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            historyInit: function(callback, src){
                jQuery.historyCallback = callback;
                if (src) jQuery.historyIframeSrc = src;
                var current_hash = location.hash.replace(/\?.*$/, '');
        
        
        Severity: Minor
        Found in assets/js/galleriffic/jquery.history.js - About 1 hr to fix

          Function _initKeys has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function _initKeys( $wrpr, opts )
              {
                  if ( opts.prev.key || opts.next.key || opts.close.key )
                  {
                      $(document).bind(
          Severity: Minor
          Found in assets/js/TosRUs/src/js/jquery.tosrus.js - About 1 hr to fix

            Method extgallery_tag_iteminfo has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function extgallery_tag_iteminfo(&$items)
            {
                if (empty($items) || !is_array($items)) {
                    return false;
                }
            Severity: Minor
            Found in class/plugins/plugin.tag.php - About 1 hr to fix

              Method staticPushErrorHandling has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function staticPushErrorHandling($mode, $options = null)
                  {
                      $stack       = &$GLOBALS['_PEAR_error_handler_stack'];
                      $def_mode    = &$GLOBALS['_PEAR_default_error_mode'];
                      $def_options = &$GLOBALS['_PEAR_default_error_options'];
              Severity: Minor
              Found in class/pear/PEAR.php - About 1 hr to fix

                Method get_image_url has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function get_image_url()
                    {
                        // Get the image file path
                        if (!mb_strlen($this->path)) {
                            return $this->url;
                Severity: Minor
                Found in assets/js/ml-slider/inc/metaslider.imagehelper.class.php - About 1 hr to fix

                  Method _dirToStruct has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected static function _dirToStruct($sPath, $maxinst, $aktinst = 0, $silent = false)
                      {
                          $struct = ['dirs' => [], 'files' => []];
                          if (false === ($dir = @opendir($sPath))) {
                              if (!$silent) {
                  Severity: Minor
                  Found in class/pear/System.php - About 1 hr to fix

                    Method rotate has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function rotate($angle, $options = null)
                        {
                            if (!($angle == $this->_rotation_angle($angle))) {
                                // No rotation needed
                                return true;
                    Severity: Minor
                    Found in class/pear/Image/Transform/Driver/NetPBM.php - About 1 hr to fix

                      Method PclTarDelete has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function PclTarDelete($p_tarname, $p_filelist, $p_mode = '')
                          {
                              TrFctStart(__FILE__, __LINE__, 'PclTarDelete', "tar='$p_tarname', list='$p_filelist', mode='$p_mode'");
                              $v_result = 1;
                      
                      
                      Severity: Minor
                      Found in class/pcltar.lib.php - About 1 hr to fix

                        Method PclTarExtractList has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function PclTarExtractList($p_tarname, $p_filelist, $p_path = './', $p_remove_path = '', $p_mode = '')
                            {
                                TrFctStart(__FILE__, __LINE__, 'PclTarExtractList', "tar=$p_tarname, list, path=$p_path, remove_path='$p_remove_path', mode='$p_mode'");
                                $v_result = 1;
                        
                        
                        Severity: Minor
                        Found in class/pcltar.lib.php - About 1 hr to fix

                          Method PclTarUpdate has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function PclTarUpdate($p_tarname, $p_filelist, $p_mode = '', $p_add_dir = '', $p_remove_dir = '')
                              {
                                  TrFctStart(__FILE__, __LINE__, 'PclTarUpdate', "tar='$p_tarname', list='$p_filelist', mode='$p_mode'");
                                  $v_result = 1;
                          
                          
                          Severity: Minor
                          Found in class/pcltar.lib.php - About 1 hr to fix

                            Method getMax has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function getMax(\CriteriaElement $criteria = null, $max = '*')
                                {
                                    $field   = '';
                                    $groupby = false;
                                    if (\is_object($criteria) && \is_subclass_of($criteria, \CriteriaElement::class)) {
                            Severity: Minor
                            Found in class/PersistableObjectHandler.php - About 1 hr to fix

                              Method render has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function render()
                                  {
                                      $ele_name = $this->getName();
                                      echo '<table class="outer"><tr><td class="odd"><table><tr>';
                                      $cols = 1;
                              Severity: Minor
                              Found in class/GroupFormCheckBox.php - About 1 hr to fix

                                Method getSum has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function getSum(\CriteriaElement $criteria = null, $sum = '*')
                                    {
                                        $field   = '';
                                        $groupby = false;
                                        if (\is_object($criteria) && \is_subclass_of($criteria, \CriteriaElement::class)) {
                                Severity: Minor
                                Found in class/PersistableObjectHandler.php - About 1 hr to fix

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                      toggleFullscreen: function( callback ) {
                                          this._fullscreen[ this.isFullscreen() ? 'exit' : 'enter'].apply( this, Utils.array( arguments ) );
                                          return this;
                                      },
                                  Severity: Major
                                  Found in assets/js/galleria/galleria-1.3.5.js and 1 other location - About 1 hr to fix
                                  assets/js/galleria/galleria-1.3.3.js on lines 4159..4162

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 57.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language