plugins/misc/fancybox/script/01-jquery.fancybox.js

Summary

Maintainability
F
1 wk
Test Coverage

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

/*!
 * fancyBox - jQuery Plugin
 * version: 2.1.5 (Fri, 14 Jun 2013)
 * @requires jQuery v1.6 or later
 *
Severity: Major
Found in plugins/misc/fancybox/script/01-jquery.fancybox.js - About 3 days to fix

    Function _setDimension has 167 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 plugins/misc/fancybox/script/01-jquery.fancybox.js - About 6 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 plugins/misc/fancybox/script/01-jquery.fancybox.js - About 3 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 plugins/misc/fancybox/script/01-jquery.fancybox.js - About 3 hrs to fix

          Function _afterLoad has 86 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 plugins/misc/fancybox/script/01-jquery.fancybox.js - About 3 hrs to fix

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

                    bindEvents: function () {
                        var current = F.current,
                            keys;
            
                        if (!current) {
            Severity: Major
            Found in plugins/misc/fancybox/script/01-jquery.fancybox.js - About 2 hrs to fix

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

                      _afterZoomIn: function () {
                          var current = F.current;
              
                          if (!current) {
                              return;
              Severity: Minor
              Found in plugins/misc/fancybox/script/01-jquery.fancybox.js - About 1 hr 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 plugins/misc/fancybox/script/01-jquery.fancybox.js - About 1 hr to fix

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

                          beforeShow: function (opts) {
                              var current = F.current,
                                  text    = current.title,
                                  type    = opts.type,
                                  title,
                  Severity: Minor
                  Found in plugins/misc/fancybox/script/01-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 plugins/misc/fancybox/script/01-jquery.fancybox.js - About 1 hr to fix

                      Function fancybox has 32 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 plugins/misc/fancybox/script/01-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 plugins/misc/fancybox/script/01-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 plugins/misc/fancybox/script/01-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 plugins/misc/fancybox/script/01-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 plugins/misc/fancybox/script/01-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 plugins/misc/fancybox/script/01-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 plugins/misc/fancybox/script/01-jquery.fancybox.js and 1 other location - About 2 hrs to fix
                                  plugins/misc/fancybox/script/01-jquery.fancybox.js on lines 473..483

                                  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 plugins/misc/fancybox/script/01-jquery.fancybox.js and 1 other location - About 2 hrs to fix
                                  plugins/misc/fancybox/script/01-jquery.fancybox.js on lines 486..496

                                  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.animate(endPos, {
                                                  duration : effect === 'none' ? 0 : current.closeSpeed,
                                                  easing   : current.closeEasing,
                                                  step     : elastic ? this.step : null,
                                                  complete : F._afterZoomOut
                                  Severity: Major
                                  Found in plugins/misc/fancybox/script/01-jquery.fancybox.js and 1 other location - About 1 hr to fix
                                  plugins/misc/fancybox/script/01-jquery.fancybox.js on lines 1598..1603

                                  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.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 plugins/misc/fancybox/script/01-jquery.fancybox.js and 1 other location - About 1 hr to fix
                                  plugins/misc/fancybox/script/01-jquery.fancybox.js on lines 1620..1625

                                  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.top  = getValue(Math.max(rez.top,  rez.top  + ((viewport.h - height) * current.topRatio)));
                                  Severity: Minor
                                  Found in plugins/misc/fancybox/script/01-jquery.fancybox.js and 1 other location - About 50 mins to fix
                                  plugins/misc/fancybox/script/01-jquery.fancybox.js on lines 1415..1415

                                  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.left = getValue(Math.max(rez.left, rez.left + ((viewport.w - width)  * current.leftRatio)));
                                  Severity: Minor
                                  Found in plugins/misc/fancybox/script/01-jquery.fancybox.js and 1 other location - About 50 mins to fix
                                  plugins/misc/fancybox/script/01-jquery.fancybox.js on lines 1414..1414

                                  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

                                                  if (direction === 'down' || direction === 'right') {
                                                      startPos[ field ] = getValue(getScalar(startPos[ field ]) - distance);
                                                      endPos[ field ]   = '+=' + distance + 'px';
                                  
                                                  } else {
                                  Severity: Minor
                                  Found in plugins/misc/fancybox/script/01-jquery.fancybox.js and 1 other location - About 40 mins to fix
                                  plugins/misc/fancybox/script/01-jquery.fancybox.js on lines 1646..1649

                                  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

                                                  } else {
                                                      startPos[ field ] = getValue(getScalar(startPos[ field ]) + distance);
                                                      endPos[ field ]   = '-=' + distance + 'px';
                                                  }
                                  Severity: Minor
                                  Found in plugins/misc/fancybox/script/01-jquery.fancybox.js and 1 other location - About 40 mins to fix
                                  plugins/misc/fancybox/script/01-jquery.fancybox.js on lines 1642..1646

                                  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

                                  There are no issues that match your filters.

                                  Category
                                  Status