mambax7/pedigree

View on GitHub
assets/js/jquery.magnific-popup.js

Summary

Maintainability
F
1 wk
Test Coverage

File jquery.magnific-popup.js has 1325 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*! Magnific Popup - v1.1.0 - 2016-02-20
* http://dimsemenov.com/plugins/magnific-popup/
* Copyright (c) 2016 Dmitry Semenov; */
;(function (factory) {
if (typeof define === 'function' && define.amd) {
Severity: Major
Found in assets/js/jquery.magnific-popup.js - About 3 days to fix

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

        open: function(data) {
    
            var i;
    
            if(data.isObj === false) {
    Severity: Major
    Found in assets/js/jquery.magnific-popup.js - About 6 hrs to fix

      Function initZoom has 80 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              initZoom: function() {
                  var zoomSt = mfp.st.zoom,
                      ns = '.zoom',
                      image;
      
      
      Severity: Major
      Found in assets/js/jquery.magnific-popup.js - About 3 hrs to fix

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

                getImage: function(item, template) {
        
                    var guard = 0,
        
                        // image load complete handler
        Severity: Major
        Found in assets/js/jquery.magnific-popup.js - About 3 hrs to fix

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

                  initGallery: function() {
          
                      var gSt = mfp.st.gallery,
                          ns = '.mfp-gallery';
          
          
          Severity: Major
          Found in assets/js/jquery.magnific-popup.js - About 2 hrs to fix

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

                _close: function() {
                    _mfpTrigger(CLOSE_EVENT);
            
                    var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' ';
            
            
            Severity: Minor
            Found in assets/js/jquery.magnific-popup.js - About 1 hr to fix

              Function _parseMarkup has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _parseMarkup: function(template, values, item) {
                      var arr;
                      if(item.data) {
                          values = $.extend(item.data, values);
                      }
              Severity: Minor
              Found in assets/js/jquery.magnific-popup.js - About 1 hr to fix

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

                $.fn.magnificPopup = function(options) {
                    _checkInstance();
                
                    var jqEl = $(this);
                
                
                Severity: Minor
                Found in assets/js/jquery.magnific-popup.js - About 1 hr to fix

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

                          getAjax: function(item) {
                  
                              if(_ajaxCur) {
                                  $(document.body).addClass(_ajaxCur);
                              }
                  Severity: Minor
                  Found in assets/js/jquery.magnific-popup.js - About 1 hr to fix

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

                        updateItemHTML: function() {
                            var item = mfp.items[mfp.index];
                    
                            // Detach and perform modifications
                            mfp.contentContainer.detach();
                    Severity: Minor
                    Found in assets/js/jquery.magnific-popup.js - About 1 hr to fix

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

                          _openClick: function(e, el, options) {
                              var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick;
                      
                      
                              if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey ) ) {
                      Severity: Minor
                      Found in assets/js/jquery.magnific-popup.js - About 1 hr to fix

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

                            parseEl: function(index) {
                                var item = mfp.items[index],
                                    type;
                        
                                if(item.tagName) {
                        Severity: Minor
                        Found in assets/js/jquery.magnific-popup.js - About 1 hr to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if(el.is('img')) {
                                                      el.attr('src', value);
                                                  } else {
                                                      el.replaceWith( $('<img>').attr('src', value).attr('class', el.attr('class')) );
                                                  }
                          Severity: Major
                          Found in assets/js/jquery.magnific-popup.js - About 45 mins to fix

                            Consider simplifying this complex logical expression.
                            Open

                                    if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey ) ) {
                                        return;
                                    }
                            Severity: Major
                            Found in assets/js/jquery.magnific-popup.js - About 40 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                      return false;
                              Severity: Major
                              Found in assets/js/jquery.magnific-popup.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                                return true;
                                Severity: Major
                                Found in assets/js/jquery.magnific-popup.js - About 30 mins to fix

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

                                          next: function() {
                                              mfp.direction = true;
                                              mfp.index = _getLoopedId(mfp.index + 1);
                                              mfp.updateItemHTML();
                                          },
                                  Severity: Minor
                                  Found in assets/js/jquery.magnific-popup.js and 1 other location - About 55 mins to fix
                                  assets/js/jquery.magnific-popup.js on lines 1767..1771

                                  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 54.

                                  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

                                          prev: function() {
                                              mfp.direction = false;
                                              mfp.index = _getLoopedId(mfp.index - 1);
                                              mfp.updateItemHTML();
                                          },
                                  Severity: Minor
                                  Found in assets/js/jquery.magnific-popup.js and 1 other location - About 55 mins to fix
                                  assets/js/jquery.magnific-popup.js on lines 1762..1766

                                  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 54.

                                  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

                                              for(i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) {
                                                  mfp._preloadItem(mfp.index+i);
                                              }
                                  Severity: Minor
                                  Found in assets/js/jquery.magnific-popup.js and 1 other location - About 45 mins to fix
                                  assets/js/jquery.magnific-popup.js on lines 1786..1788

                                  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 50.

                                  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

                                              for(i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) {
                                                  mfp._preloadItem(mfp.index-i);
                                              }
                                  Severity: Minor
                                  Found in assets/js/jquery.magnific-popup.js and 1 other location - About 45 mins to fix
                                  assets/js/jquery.magnific-popup.js on lines 1783..1785

                                  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 50.

                                  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

                                                          arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS),
                                  Severity: Minor
                                  Found in assets/js/jquery.magnific-popup.js and 1 other location - About 35 mins to fix
                                  assets/js/jquery.magnific-popup.js on lines 1732..1732

                                  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 47.

                                  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

                                                          arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS);
                                  Severity: Minor
                                  Found in assets/js/jquery.magnific-popup.js and 1 other location - About 35 mins to fix
                                  assets/js/jquery.magnific-popup.js on lines 1731..1731

                                  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 47.

                                  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

                                  There are no issues that match your filters.

                                  Category
                                  Status