XoopsModules25x/smallworld

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

Summary

Maintainability
F
1 wk
Test Coverage

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

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

    File jquery.galleriffic.js has 663 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/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/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 xoops_smallworldli = (typeof listItem === "string") ? xoops_smallworld(listItem) : listItem;
                        var xoops_smallworldaThumb = xoops_smallworldli.find('a.thumb');
                        var slideUrl = xoops_smallworldaThumb.attr('href');
                        var title = xoops_smallworldaThumb.attr('title');
        Severity: Minor
        Found in assets/js/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/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/jquery.galleriffic.js - About 1 hr to fix

              Function buildImage has 35 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/jquery.galleriffic.js - About 1 hr to fix

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

                            preloadRecursive: function (startIndex, currentIndex) {
                                // Check if startIndex has been relocated
                                if (startIndex != this.preloadStartIndex) {
                                    var nextIndex = this.getNextIndex(this.preloadStartIndex);
                                    return this.preloadRecursive(this.preloadStartIndex, nextIndex);
                Severity: Minor
                Found in assets/js/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/jquery.galleriffic.js - About 30 mins to fix

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

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

                    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.enableTopPager) {
                                        var xoops_smallworldtopPager = this.find('div.top');
                                        if (xoops_smallworldtopPager.length == 0)
                                            xoops_smallworldtopPager = this.prepend('<div class="top pagination"></div>').find('div.top');
                                        else
                    Severity: Major
                    Found in assets/js/jquery.galleriffic.js and 1 other location - About 2 hrs to fix
                    assets/js/jquery.galleriffic.js on lines 756..765

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

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

                    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[prevPage].hash + '" title="' + this.prevPageLinkText + '">' + this.prevPageLinkText + '</a>');
                    Severity: Major
                    Found in assets/js/jquery.galleriffic.js and 1 other location - About 1 hr to fix
                    assets/js/jquery.galleriffic.js on lines 852..852

                    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[nextPage].hash + '" title="' + this.nextPageLinkText + '">' + this.nextPageLinkText + '</a>');
                    Severity: Major
                    Found in assets/js/jquery.galleriffic.js and 1 other location - About 1 hr to fix
                    assets/js/jquery.galleriffic.js on lines 821..821

                    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

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

                    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

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

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

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

                    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