jacobemerick/web

View on GitHub
public/js/imagelightbox.js

Summary

Maintainability
D
2 days
Test Coverage

Function imageLightbox has 229 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  $.fn.imageLightbox = function( options )
  {
    var options    = $.extend(
             {
              selector:   'id="imagelightbox"',
Severity: Major
Found in public/js/imagelightbox.js - About 1 day to fix

    Function loadImage has 102 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          loadImage = function( direction )
          {
            if( inProgress ) return false;
    
            direction = typeof direction === 'undefined' ? false : direction == 'left' ? 1 : -1;
    Severity: Major
    Found in public/js/imagelightbox.js - About 4 hrs to fix

      File imagelightbox.js has 271 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      
      /*
        By Osvaldas Valutis, www.osvaldas.info
        Available for use under the MIT License
      */
      Severity: Minor
      Found in public/js/imagelightbox.js - About 2 hrs to fix

        Consider simplifying this complex logical expression.
        Open

                  if( direction !== false && ( targets.length < 2 || ( options.quitOnEnd === true && ( ( direction === -1 && targets.index( target ) == 0 ) || ( direction === 1 && targets.index( target ) == targets.length - 1 ) ) ) ) )
                  {
                    quitLightbox();
                    return false;
                  }
        Severity: Major
        Found in public/js/imagelightbox.js - About 1 hr to fix

          Avoid too many return statements within this function.
          Open

                return false;
          Severity: Major
          Found in public/js/imagelightbox.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return false;
            Severity: Major
            Found in public/js/imagelightbox.js - About 30 mins to fix

              There are no issues that match your filters.

              Category
              Status