mambax7/extgallery

View on GitHub
assets/js/galleriffic/jquery.galleriffic.js

Summary

Maintainability
F
1 wk
Test Coverage

Function galleriffic has 585 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $.fn.galleriffic = function(settings) {
        //  Extend Gallery Object
        $.extend(this, {
            // Returns the version of the script
            version: $.galleriffic.version,
Severity: Major
Found in assets/js/galleriffic/jquery.galleriffic.js - About 2 days to fix

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

    /**
     * jQuery Galleriffic plugin
     *
     * Copyright (c) 2008 Trent Foley (http://trentacular.com)
     * Licensed under the MIT License:
    Severity: Major
    Found in assets/js/galleriffic/jquery.galleriffic.js - About 1 day to fix

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

                  refresh: function() {
                      var imageData = this.currentImage;
                      if (!imageData)
                          return this;
      
      
      Severity: Major
      Found in assets/js/galleriffic/jquery.galleriffic.js - About 2 hrs to fix

        Function addImage has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    addImage: function(listItem, thumbExists, insert, position) {
                        var $li = ( typeof listItem === "string" ) ? $(listItem) : listItem;
                        var $aThumb = $li.find('a.thumb');
                        var slideUrl = $aThumb.attr('href');
                        var title = $aThumb.attr('title');
        Severity: Minor
        Found in assets/js/galleriffic/jquery.galleriffic.js - About 1 hr to fix

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

                      buildPager: function(pager) {
                          var gallery = this;
                          var numPages = this.getNumPages();
                          var page = this.getCurrentPage();
                          var startIndex = page * this.numThumbs;
          Severity: Minor
          Found in assets/js/galleriffic/jquery.galleriffic.js - About 1 hr to fix

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

                        rebuildThumbs: function() {
                            var needsPagination = this.data.length > this.numThumbs;
            
                            // Rebuild top pager
                            if (this.enableTopPager) {
            Severity: Minor
            Found in assets/js/galleriffic/jquery.galleriffic.js - About 1 hr to fix

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

                          buildImage: function(imageData, isSync) {
                              var gallery = this;
                              var nextIndex = this.getNextIndex(imageData.index);
              
                              // Construct new hidden span for the image
              Severity: Minor
              Found in assets/js/galleriffic/jquery.galleriffic.js - About 1 hr to fix

                Avoid too many return statements within this function.
                Open

                                return this;
                Severity: Major
                Found in assets/js/galleriffic/jquery.galleriffic.js - About 30 mins to fix

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

                                  if (this.enableTopPager) {
                                      var $topPager = this.find('div.top');
                                      if ($topPager.length == 0)
                                          $topPager = this.prepend('<div class="top pagination"></div>').find('div.top');
                                      else
                  Severity: Major
                  Found in assets/js/galleriffic/jquery.galleriffic.js and 1 other location - About 2 hrs to fix
                  assets/js/galleriffic/jquery.galleriffic.js on lines 751..760

                  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

                                  if (this.enableBottomPager) {
                                      var $bottomPager = this.find('div.bottom');
                                      if ($bottomPager.length == 0)
                                          $bottomPager = this.append('<div class="bottom pagination"></div>').find('div.bottom');
                                      else
                  Severity: Major
                  Found in assets/js/galleriffic/jquery.galleriffic.js and 1 other location - About 2 hrs to fix
                  assets/js/galleriffic/jquery.galleriffic.js on lines 739..748

                  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

                                  if (this.$controlsContainer) {
                                      this.$controlsContainer
                                          .find('div.ss-controls a').removeClass().addClass('pause')
                                          .attr('title', this.pauseLinkText)
                                          .attr('href', '#pause')
                  Severity: Major
                  Found in assets/js/galleriffic/jquery.galleriffic.js and 1 other location - About 2 hrs to fix
                  assets/js/galleriffic/jquery.galleriffic.js on lines 386..392

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

                  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 (this.$controlsContainer) {
                                      this.$controlsContainer
                                          .find('div.ss-controls a').removeClass().addClass('play')
                                          .attr('title', this.playLinkText)
                                          .attr('href', '#play')
                  Severity: Major
                  Found in assets/js/galleriffic/jquery.galleriffic.js and 1 other location - About 2 hrs to fix
                  assets/js/galleriffic/jquery.galleriffic.js on lines 401..407

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

                  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

                                      pager.append('<a rel="history" href="#'+this.data[nextPage].hash+'" title="'+this.nextPageLinkText+'">'+this.nextPageLinkText+'</a>');
                  Severity: Major
                  Found in assets/js/galleriffic/jquery.galleriffic.js and 1 other location - About 1 hr to fix
                  assets/js/galleriffic/jquery.galleriffic.js on lines 816..816

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

                  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

                                      pager.append('<a rel="history" href="#'+this.data[prevPage].hash+'" title="'+this.prevPageLinkText+'">'+this.prevPageLinkText+'</a>');
                  Severity: Major
                  Found in assets/js/galleriffic/jquery.galleriffic.js and 1 other location - About 1 hr to fix
                  assets/js/galleriffic/jquery.galleriffic.js on lines 847..847

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

                  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

                              previous: function(dontPause, bypassHistory) {
                                  this.gotoIndex(this.getPrevIndex(this.currentImage.index), dontPause, bypassHistory);
                                  return this;
                              },
                  Severity: Minor
                  Found in assets/js/galleriffic/jquery.galleriffic.js and 1 other location - About 40 mins to fix
                  assets/js/galleriffic/jquery.galleriffic.js on lines 440..443

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

                  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(dontPause, bypassHistory) {
                                  this.gotoIndex(this.getNextIndex(this.currentImage.index), dontPause, bypassHistory);
                                  return this;
                              },
                  Severity: Minor
                  Found in assets/js/galleriffic/jquery.galleriffic.js and 1 other location - About 40 mins to fix
                  assets/js/galleriffic/jquery.galleriffic.js on lines 448..451

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

                  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 (page < lastPage) {
                                      var startIndex = page * this.numThumbs;
                                      var nextPage = startIndex + this.numThumbs;
                                      this.gotoIndex(nextPage, dontPause, bypassHistory);
                                  }
                  Severity: Minor
                  Found in assets/js/galleriffic/jquery.galleriffic.js and 1 other location - About 35 mins to fix
                  assets/js/galleriffic/jquery.galleriffic.js on lines 473..477

                  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

                                  if (page > 0) {
                                      var startIndex = page * this.numThumbs;
                                      var prevPage = startIndex - this.numThumbs;
                                      this.gotoIndex(prevPage, dontPause, bypassHistory);
                                  }
                  Severity: Minor
                  Found in assets/js/galleriffic/jquery.galleriffic.js and 1 other location - About 35 mins to fix
                  assets/js/galleriffic/jquery.galleriffic.js on lines 459..463

                  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