angelakuo/citydogshare

View on GitHub
public/assets/galleria-1.4.2-220d7df5eebafadbd1ec7a666be4d71fda2f96deaf72ea27bdfb1c0e32bdbd77.js

Summary

Maintainability
F
1 mo
Test Coverage

File galleria-1.4.2-220d7df5eebafadbd1ec7a666be4d71fda2f96deaf72ea27bdfb1c0e32bdbd77.js has 4395 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Galleria v 1.4.2 2014-08-07
 * http://galleria.io
 *
 * Licensed under the MIT license

    Function Utils has 401 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        Utils = (function() {
    
            return {
    
                // legacy support for clearTimer

      Function _init has 341 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _init: function() {
      
              var self = this,
                  options = this._options;
      
      

        Function Finger has 195 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Galleria.Finger = (function() {
        
            var abs = M.abs;
        
            // test for translate3d support

          Function _show has 182 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _show : function() {
          
                  // shortcuts
                  var self = this,
                      queue = this._queue[ 0 ],

            Function _createThumbnails has 177 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                _createThumbnails : function( push ) {
            
                    this.get( 'total' ).innerHTML = this.getDataLength();
            
                    var src,

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

                  scale: function( options ) {
              
                      var self = this;
              
                      // extend some defaults

                Function init has 140 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    init: function( target, options ) {
                
                        options = _legacyOptions( options );
                
                        // save the original ingredients

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

                          _enter: function( callback ) {
                  
                              fullscreen.active = true;
                  
                              if ( IFRAME ) {

                    Function _transitions has 128 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        _transitions = (function() {
                    
                            var _slide = function(params, complete, fade, door) {
                    
                                var easing = this.getOptions('easing'),

                      Function animate has 118 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  animate : (function() {
                      
                                      // detect transition
                                      var transition = (function( style ) {
                                          var props = 'transition WebkitTransition MozTransition OTransition'.split(' '),

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

                            load: function(src, size, callback) {
                        
                                if ( typeof size == 'function' ) {
                                    callback = size;
                                    size = null;

                          Function _run has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              _run : function() {
                          
                                  var self = this;
                          
                                  self._createThumbnails();

                            Function complete has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    var complete = (function( data, next, active, queue, thumb ) {
                            
                                        return function() {
                            
                                            var win;

                              Function init has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      init : function() {
                              
                                          if ( lightbox.initialized ) {
                                              return;
                                          }

                                Function show has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        show: function(index) {
                                
                                            lightbox.active = index = typeof index === 'number' ? index : self.getIndex() || 0;
                                
                                            if ( !lightbox.initialized ) {

                                  Function success has 83 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,

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

                                                success: function() {
                                    
                                                    // save the instance
                                                    _galleries.push( self );
                                    
                                    

                                      Function show has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          show : function( index, rewind, _history ) {
                                      
                                              var swipe = this._options.swipe;
                                      
                                              // do nothing queue is long || index is false || queue is false and transition is in progress

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

                                            load : function( source, selector, config ) {
                                        
                                                var self = this,
                                                    o = this._options;
                                        
                                        

                                          Function _parseData has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                              _parseData : function( callback ) {
                                          
                                                  var self = this,
                                                      current,
                                                      ready = false,

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

                                                addPan : function( img ) {
                                            
                                                    if ( this._options.imageCrop === false ) {
                                                        return;
                                                    }

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

                                                          loadCSS : function( href, id, callback ) {
                                              
                                                              var link,
                                                                  length;
                                              
                                              

                                                Function add has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                    add: function(handleObj) {
                                                
                                                        var getCoords = function(e) {
                                                            if ( e.touches && e.touches.length ) {
                                                                var touch = e.touches[0];

                                                  Function Finger has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                                                  Open

                                                      var Finger = function(elem, options) {
                                                  
                                                          // default options
                                                          this.config = {
                                                              start: 0,

                                                    Function _exit has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                                    Open

                                                            _exit: function( callback ) {
                                                    
                                                                fullscreen.active = false;
                                                    
                                                                var inBrowser = !self._options.trueFullscreen || !_nativeFullscreen.support,

                                                      Function addTheme has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                      Galleria.addTheme = function( theme ) {
                                                      
                                                          // make sure we have a name
                                                          if ( !theme.name ) {
                                                              Galleria.raise('No theme name specified');

                                                        Function complete has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                                        Open

                                                                        complete: function( next ) {
                                                        
                                                                            // toggle low quality for IE
                                                                            if ( 'image' in active ) {
                                                                                Utils.toggleQuality( active.image, false );

                                                          Function _slide has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                                          Open

                                                                  var _slide = function(params, complete, fade, door) {
                                                          
                                                                      var easing = this.getOptions('easing'),
                                                                          distance = this.getStageWidth(),
                                                                          from = { left: distance * ( params.rewind ? -1 : 1 ) },

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

                                                                        onload = (function( self, callback, src ) {
                                                            
                                                                            return function() {
                                                            
                                                                                var complete = function() {

                                                              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,

                                                                Function bind has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                Open

                                                                        bind: function( elem, value ) {
                                                                
                                                                            // todo: revise if alternative tooltip is needed for mobile devices
                                                                            if (Galleria.TOUCH) {
                                                                                return;

                                                                  Function raise has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                  Open

                                                                  Galleria.raise = function( msg, fatal ) {
                                                                  
                                                                      var type = fatal ? 'Fatal error' : 'Error',
                                                                  
                                                                          css = {

                                                                    Function _scaleImage has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                    Open

                                                                        _scaleImage : function( image, options ) {
                                                                    
                                                                            image = image || this._controls.getActive();
                                                                    
                                                                            // janpub (JH) fix:

                                                                      Function enter has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                      Open

                                                                              enter: function( callback ) {
                                                                      
                                                                                  fullscreen.beforeEnter(function() {
                                                                      
                                                                                      callback = fullscreen.parseCallback( callback, true );

                                                                        Function rescale has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                        Open

                                                                            rescale : function( width, height, complete ) {
                                                                        
                                                                                var self = this;
                                                                        
                                                                                // allow rescale(fn)

                                                                          Function Video has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                          Open

                                                                              Video = function( type, id ) {
                                                                          
                                                                                  for( var i=0; i<_video._inst.length; i++ ) {
                                                                                      if ( _video._inst[i].id === id && _video._inst[i].type == type ) {
                                                                                          return _video._inst[i];

                                                                            Function complete has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                            Open

                                                                                                complete: function( thumb ) {
                                                                            
                                                                                                    // shrink thumbnails to fit
                                                                                                    var top = ['left', 'top'],
                                                                                                        arr = ['Width', 'Height'],

                                                                              Function loop has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                              Open

                                                                                      loop: function() {
                                                                              
                                                                                          var distance = this.to - this.pos,
                                                                                              factor = 1;
                                                                              
                                                                              

                                                                                Function add has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                Open

                                                                                        add: function(elem, to, from, hide) {
                                                                                            if ( !elem || Galleria.TOUCH ) {
                                                                                                return;
                                                                                            }
                                                                                            if (!idle.bound) {

                                                                                  Function rescale has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                  Open

                                                                                          rescale: function(event) {
                                                                                  
                                                                                              // calculate
                                                                                               var width = M.min( $win.width()-40, lightbox.width ),
                                                                                                  height = M.min( $win.height()-60, lightbox.height ),

                                                                                    Function bindControls has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                    Open

                                                                                            bindControls: function() {
                                                                                    
                                                                                                var i;
                                                                                    
                                                                                                carousel.next.on( 'click:fast', function(e) {

                                                                                      Function show has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                      Open

                                                                                                  show : function( elem, speed, callback ) {
                                                                                      
                                                                                                      callback = callback || F;
                                                                                      
                                                                                                      var $elem = $(elem);

                                                                                        Function galleria has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                        Open

                                                                                        $.fn.galleria = function( options ) {
                                                                                        
                                                                                            var selector = this.selector;
                                                                                        
                                                                                            // try domReady if element not found

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

                                                                                              _getWH : function() {
                                                                                          
                                                                                                  var $container = this.$( 'container' ),
                                                                                                      $target = this.$( 'target' ),
                                                                                                      self = this,

                                                                                            Function lazyLoadChunks has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                            Open

                                                                                                lazyLoadChunks: function( size, delay ) {
                                                                                            
                                                                                                    var len = this.getDataLength(),
                                                                                                        i = 0,
                                                                                                        n = 0,

                                                                                              Function wait has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                              Open

                                                                                                          wait : function(options) {
                                                                                              
                                                                                                              Galleria._waiters = Galleria._waiters || [];
                                                                                              
                                                                                                              options = $.extend({

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

                                                                                                        var scale = function() {
                                                                                                
                                                                                                            // set stagewidth
                                                                                                            self._stageWidth = width || self.$( 'stage' ).width();
                                                                                                            self._stageHeight = height || self.$( 'stage' ).height();

                                                                                                  Function _playCheck has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                  Open

                                                                                                      _playCheck : function() {
                                                                                                          var self = this,
                                                                                                              played = 0,
                                                                                                              interval = 20,
                                                                                                              now = Utils.timestamp(),

                                                                                                    Function hide has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                    Open

                                                                                                                hide : function( elem, speed, callback ) {
                                                                                                    
                                                                                                                    callback = callback || F;
                                                                                                    
                                                                                                                    var $elem = $(elem);

                                                                                                      Function flash has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                      Open

                                                                                                                      flash: function(params, complete) {
                                                                                                                          $(params.next).css({
                                                                                                                              opacity: 0,
                                                                                                                              left: 0
                                                                                                                          });

                                                                                                        Avoid deeply nested control flow statements.
                                                                                                        Open

                                                                                                                                                if ( type == 'image' && !current.big ) {
                                                                                                                                                    current.big = current.image;
                                                                                                                                                }

                                                                                                          Function galleriaIn has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                          Open

                                                                                                              galleriaIn: function (_, t, b, c, d) {

                                                                                                            Function easeout has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                            Open

                                                                                                                    this.easeout = function (x, t, b, c, d) {

                                                                                                              Function complete has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                              Open

                                                                                                                      var complete = (function( data, next, active, queue, thumb ) {

                                                                                                                Function easing has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                Open

                                                                                                                            easing: function(x,t,b,c,d) {

                                                                                                                  Function galleriaOut has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                  Open

                                                                                                                      galleriaOut: function (_, t, b, c, d) {

                                                                                                                    Function galleria has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                    Open

                                                                                                                        galleria: function (_, t, b, c, d) {

                                                                                                                      There are no issues that match your filters.

                                                                                                                      Category
                                                                                                                      Status