wahyd4/ocelots

View on GitHub
public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js

Summary

Maintainability
F
1 wk
Test Coverage

File jquery.fancybox.js has 1390 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * fancyBox - jQuery Plugin
 * version: 2.1.0 (Mon, 20 Aug 2012)
 * @requires jQuery v1.6 or later
 *
Severity: Major
Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 3 days to fix

    Function _setDimension has 161 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            _setDimension: function () {
                var viewport   = F.getViewport(),
                    steps      = 0,
                    canShrink  = false,
                    canExpand  = false,
    Severity: Major
    Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 6 hrs to fix

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

              _start: function (index) {
                  var coming = {},
                      obj,
                      href,
                      type,
      Severity: Major
      Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 3 hrs to fix

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

                open: function (group, opts) {
                    if (!group) {
                        return;
                    }
        
        
        Severity: Major
        Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 3 hrs to fix

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

                  _afterLoad: function () {
                      var coming   = F.coming,
                          previous = F.current,
                          placeholder = 'fancybox-placeholder',
                          current,
          Severity: Major
          Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 3 hrs to fix

            Function bindEvents has 51 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    bindEvents: function () {
                        var current = F.current,
                            keys;
            
                        if (!current) {
            Severity: Major
            Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 2 hrs to fix

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

                      getOrigPosition: function () {
                          var current  = F.current,
                              element  = current.element,
                              orig     = current.orig,
                              pos      = {},
              Severity: Minor
              Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 1 hr to fix

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

                        play: function ( action ) {
                            var clear = function () {
                                    clearTimeout(F.player.timer);
                                },
                                set = function () {
                Severity: Minor
                Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 1 hr to fix

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

                          beforeShow: function (opts) {
                              var text = F.current.title,
                                  type = opts.type,
                                  title,
                                  target;
                  Severity: Minor
                  Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 1 hr to fix

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

                            _afterZoomIn: function () {
                                var current = F.current;
                    
                                if (!current) {
                                    return;
                    Severity: Minor
                    Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 1 hr to fix

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

                          $.fn.fancybox = function (options) {
                              var index,
                                  that     = $(this),
                                  selector = this.selector || '',
                                  run      = function(e) {
                      Severity: Minor
                      Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 1 hr to fix

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

                                update: function (e) {
                                    var type = (e && e.type),
                                        anyway = !type || type === 'orientationchange';
                        
                                    if (anyway) {
                        Severity: Minor
                        Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 1 hr to fix

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

                                  changeIn: function () {
                                      var current   = F.current,
                                          effect    = current.nextEffect,
                                          startPos  = current.pos,
                                          endPos    = { opacity : 1 },
                          Severity: Minor
                          Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 1 hr to fix

                            Consider simplifying this complex logical expression.
                            Open

                                                if (!e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey && !(target && (target.type || $(target).is('[contenteditable]')))) {
                                                    $.each(keys, function(i, val) {
                                                        if (current.group.length > 1 && val[ code ] !== undefined) {
                                                            F[ i ]( val[ code ] );
                            
                            
                            Severity: Major
                            Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 1 hr to fix

                              Consider simplifying this complex logical expression.
                              Open

                                              if (!(e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && !what.is('.fancybox-wrap')) {
                                                  relType = options.groupAttr || 'data-fancybox-group';
                                                  relVal  = what.attr(relType);
                              
                                                  if (!relVal) {
                              Severity: Major
                              Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 40 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                                    return F._error( 'content' );
                                Severity: Major
                                Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                                  return F._error( 'href' );
                                  Severity: Major
                                  Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 30 mins to fix

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

                                            prev: function ( direction ) {
                                                var current = F.current;
                                    
                                                if (current) {
                                                    if (!isString(direction)) {
                                    Severity: Major
                                    Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js and 1 other location - About 2 hrs to fix
                                    public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js on lines 477..487

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

                                    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

                                            next: function ( direction ) {
                                                var current = F.current;
                                    
                                                if (current) {
                                                    if (!isString(direction)) {
                                    Severity: Major
                                    Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js and 1 other location - About 2 hrs to fix
                                    public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js on lines 490..500

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

                                    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

                                                F.wrap.css(startPos).animate(endPos, {
                                                    duration : effect === 'none' ? 0 : current.openSpeed,
                                                    easing   : current.openEasing,
                                                    step     : elastic ? this.step : null,
                                                    complete : F._afterZoomIn
                                    Severity: Major
                                    Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js and 1 other location - About 1 hr to fix
                                    public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js on lines 1609..1614

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

                                    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

                                                F.wrap.animate(endPos, {
                                                    duration : effect === 'none' ? 0 : current.closeSpeed,
                                                    easing   : current.closeEasing,
                                                    step     : elastic ? this.step : null,
                                                    complete : F._afterZoomOut
                                    Severity: Major
                                    Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js and 1 other location - About 1 hr to fix
                                    public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js on lines 1587..1592

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

                                    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

                                                rez.left = getValue(Math.max(rez.left, rez.left + ((viewport.w - width)  * current.leftRatio)));
                                    Severity: Minor
                                    Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js and 1 other location - About 50 mins to fix
                                    public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js on lines 1409..1409

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

                                    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

                                                rez.top  = getValue(Math.max(rez.top,  rez.top  + ((viewport.h - height) * current.topRatio)));
                                    Severity: Minor
                                    Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js and 1 other location - About 50 mins to fix
                                    public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js on lines 1410..1410

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

                                    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

                                                    } else {
                                                        startPos[ field ] = getValue(getScalar(startPos[ field ]) + distance);
                                                        endPos[ field ]   = '-=' + distance + 'px';
                                                    }
                                    Severity: Minor
                                    Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js and 1 other location - About 40 mins to fix
                                    public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js on lines 1631..1635

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

                                    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 (direction === 'down' || direction === 'right') {
                                                        startPos[ field ] = getValue(getScalar(startPos[ field ]) - distance);
                                                        endPos[ field ]   = '+=' + distance + 'px';
                                    
                                                    } else {
                                    Severity: Minor
                                    Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js and 1 other location - About 40 mins to fix
                                    public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js on lines 1635..1638

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

                                    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 (previous.wrap.css('position') === 'fixed') {
                                                        previous.wrap.css(F._getPosition( true ));
                                                    }
                                    Severity: Minor
                                    Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js and 1 other location - About 35 mins to fix
                                    public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js on lines 421..423

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

                                    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 (F.wrap.css('position') === 'fixed') {
                                                        F.wrap.css(F._getPosition( true ));
                                                    }
                                    Severity: Minor
                                    Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js and 1 other location - About 35 mins to fix
                                    public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js on lines 1076..1078

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

                                    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