XoopsModules25x/smallworld

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

Summary

Maintainability
F
6 days
Test Coverage

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

/*!
    jQuery ColorBox v1.4.6 - 2013-03-19
    (c) 2013 Jack Moore - jacklmoore.com/colorbox
    license: http://www.opensource.org/licenses/mit-license.php
*/
Severity: Major
Found in assets/js/jquery.colorbox.js - About 1 day to fix

    Function prep has 125 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        publicMethod.prep = function (object) {
            if (!open) {
                return;
            }
    
    
    Severity: Major
    Found in assets/js/jquery.colorbox.js - About 5 hrs to fix

      Function load has 94 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function load() {
              var href, setResize, prep = publicMethod.prep, $inline, request = ++requests;
      
              active = true;
      
      
      Severity: Major
      Found in assets/js/jquery.colorbox.js - About 3 hrs to fix

        Function launch has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function launch(target) {
                if (!closing) {
        
                    element = target;
        
        
        Severity: Major
        Found in assets/js/jquery.colorbox.js - About 2 hrs to fix

          Function position has 65 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              publicMethod.position = function (speed, loadedCallback) {
                  var
                      css,
                      top = 0,
                      left = 0,
          Severity: Major
          Found in assets/js/jquery.colorbox.js - About 2 hrs to fix

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

                function slideshow() {
                    var
                        timeOut,
                        className = prefix + "Slideshow_",
                        click = "click." + prefix,
            Severity: Major
            Found in assets/js/jquery.colorbox.js - About 2 hrs to fix

              Function addBindings has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function addBindings() {
                      function clickHandler(e) {
                          // ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.
                          // See: http://jacklmoore.com/notes/click-events/
                          if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey)) {
              Severity: Minor
              Found in assets/js/jquery.colorbox.js - About 1 hr to fix

                Function appendHTML has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function appendHTML() {
                        if (!$box && document.body) {
                            init = false;
                
                            $window = $(window);
                Severity: Minor
                Found in assets/js/jquery.colorbox.js - About 1 hr to fix

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

                          function getWidth() {
                              settings.w = settings.w || $loaded.width();
                              settings.w = settings.mw && settings.mw < settings.w ? settings.mw : settings.w;
                              return settings.w;
                          }
                  Severity: Major
                  Found in assets/js/jquery.colorbox.js and 1 other location - About 2 hrs to fix
                  assets/js/jquery.colorbox.js on lines 700..704

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

                  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

                          function getHeight() {
                              settings.h = settings.h || $loaded.height();
                              settings.h = settings.mh && settings.mh < settings.h ? settings.mh : settings.h;
                              return settings.h;
                          }
                  Severity: Major
                  Found in assets/js/jquery.colorbox.js and 1 other location - About 2 hrs to fix
                  assets/js/jquery.colorbox.js on lines 694..698

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

                  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 (settings.maxWidth) {
                              settings.mw = setSize(settings.maxWidth, 'x') - loadedWidth - interfaceWidth;
                              settings.mw = settings.w && settings.w < settings.mw ? settings.w : settings.mw;
                          }
                  Severity: Major
                  Found in assets/js/jquery.colorbox.js and 1 other location - About 2 hrs to fix
                  assets/js/jquery.colorbox.js on lines 877..880

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

                  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 (settings.maxHeight) {
                              settings.mh = setSize(settings.maxHeight, 'y') - loadedHeight - interfaceHeight;
                              settings.mh = settings.h && settings.h < settings.mh ? settings.h : settings.mh;
                          }
                  Severity: Major
                  Found in assets/js/jquery.colorbox.js and 1 other location - About 2 hrs to fix
                  assets/js/jquery.colorbox.js on lines 873..876

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

                  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

                              $topBorder[0].style.width = $bottomBorder[0].style.width = $content[0].style.width = (parseInt(that.style.width, 10) - interfaceWidth) + 'px';
                  Severity: Major
                  Found in assets/js/jquery.colorbox.js and 1 other location - About 1 hr to fix
                  assets/js/jquery.colorbox.js on lines 620..620

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

                  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

                              $content[0].style.height = $leftBorder[0].style.height = $rightBorder[0].style.height = (parseInt(that.style.height, 10) - interfaceHeight) + 'px';
                  Severity: Major
                  Found in assets/js/jquery.colorbox.js and 1 other location - About 1 hr to fix
                  assets/js/jquery.colorbox.js on lines 619..619

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

                  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 (settings.mw && photo.width > settings.mw) {
                                              percent = (photo.width - settings.mw) / photo.width;
                                              setResize();
                                          }
                  Severity: Major
                  Found in assets/js/jquery.colorbox.js and 1 other location - About 1 hr to fix
                  assets/js/jquery.colorbox.js on lines 935..938

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

                  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 (settings.mh && photo.height > settings.mh) {
                                              percent = (photo.height - settings.mh) / photo.height;
                                              setResize();
                                          }
                  Severity: Major
                  Found in assets/js/jquery.colorbox.js and 1 other location - About 1 hr to fix
                  assets/js/jquery.colorbox.js on lines 931..934

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

                  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

                          settings.h = settings.height ?
                              setSize(settings.height, 'y') - loadedHeight - interfaceHeight :
                              settings.innerHeight && setSize(settings.innerHeight, 'y');
                  Severity: Minor
                  Found in assets/js/jquery.colorbox.js and 1 other location - About 55 mins to fix
                  assets/js/jquery.colorbox.js on lines 863..865

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

                  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

                          settings.w = settings.width ?
                              setSize(settings.width, 'x') - loadedWidth - interfaceWidth :
                              settings.innerWidth && setSize(settings.innerWidth, 'x');
                  Severity: Minor
                  Found in assets/js/jquery.colorbox.js and 1 other location - About 55 mins to fix
                  assets/js/jquery.colorbox.js on lines 859..861

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

                  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 (settings.retinaImage && window.devicePixelRatio > 1) {
                                          photo.height = photo.height / window.devicePixelRatio;
                                          photo.width = photo.width / window.devicePixelRatio;
                                      }
                  Severity: Minor
                  Found in assets/js/jquery.colorbox.js and 1 other location - About 40 mins to fix
                  assets/js/jquery.form.js on lines 420..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 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

                                  interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width();
                  Severity: Minor
                  Found in assets/js/jquery.colorbox.js and 1 other location - About 35 mins to fix
                  assets/js/jquery.colorbox.js on lines 354..354

                  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

                                  interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();//Subtraction needed for IE6
                  Severity: Minor
                  Found in assets/js/jquery.colorbox.js and 1 other location - About 35 mins to fix
                  assets/js/jquery.colorbox.js on lines 355..355

                  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