mambax7/extgallery

View on GitHub
assets/js/TosRUs/src/js/jquery.tosrus.js

Summary

Maintainability
F
1 wk
Test Coverage

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

/*
 *  jQuery Touch Optimized Sliders "R"Us 1.4.0
 *
 *  Copyright (c) 2013 Fred Heusschen
 *  www.frebsite.nl
Severity: Major
Found in assets/js/TosRUs/src/js/jquery.tosrus.js - About 2 days to fix

    Function tosrus has 261 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        $.fn.TosRUs = $.fn.tosrus = function( oDefault, oDesktop, oTouch )
        {
    
            if ( this.length == 0 )
            {
    Severity: Major
    Found in assets/js/TosRUs/src/js/jquery.tosrus.js - About 1 day to fix

      Function complementOptions has 113 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function complementOptions( o, $tos, _tos )
          {
      
              //  Complement objects
      
      
      Severity: Major
      Found in assets/js/TosRUs/src/js/jquery.tosrus.js - About 4 hrs to fix

        Function loadContent has 101 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function loadContent( $sldr, start, end, opts )
            {
                $sldr.children().slice( start, end ).each(
                    function()
                    {
        Severity: Major
        Found in assets/js/TosRUs/src/js/jquery.tosrus.js - About 4 hrs to fix

          Function dragSlide has 75 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              $.fn.TosRUs.dragSlide = function( $wrpr, _visible, _total )
              {
                  var $sldr = $wrpr.find( '> .' + cls( 'slider' ) );
          
                  var _distance = 0,
          Severity: Major
          Found in assets/js/TosRUs/src/js/jquery.tosrus.js - About 3 hrs to fix

            Function pinchZoom has 56 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                $.fn.TosRUs.pinchZoom = function( $img )
                {
                    var _endScale = 1,
                        _curScale = 1,
                        _oldScale = 1,
            Severity: Major
            Found in assets/js/TosRUs/src/js/jquery.tosrus.js - About 2 hrs to fix

              Function _initSlidesFromContent has 53 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function _initSlidesFromContent( $tos, $anchors, $wrpr, $sldr, opts )
                  {
                      $tos.children().each(
                          function( index )
                          {
              Severity: Major
              Found in assets/js/TosRUs/src/js/jquery.tosrus.js - About 2 hrs to fix

                Function complButton has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function complButton( btn, o )
                    {
                        var navi = ( btn != 'close' );
                
                        if ( navi && $.isNumeric( o[ btn ] ) )
                Severity: Minor
                Found in assets/js/TosRUs/src/js/jquery.tosrus.js - About 1 hr to fix

                  Function _initResizeVideo has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function _initResizeVideo( $slide, ratio, maxWidth, maxHeight )
                      {
                          var $video = $slide.children();
                  
                          $slide
                  Severity: Minor
                  Found in assets/js/TosRUs/src/js/jquery.tosrus.js - About 1 hr to fix

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

                        function _initSlidesFromAnchors( $tos, $anchors, $wrpr, $sldr, opts )
                        {
                            getZoomAnchors( $anchors, opts ).addClass( cls( 'zoom' ) );
                    
                            $anchors
                    Severity: Minor
                    Found in assets/js/TosRUs/src/js/jquery.tosrus.js - About 1 hr to fix

                      Function scaleButtons has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function scaleButtons( $btns, $capt, timeout )
                          {
                              if ( _viewScale )
                              {
                                  var scale = _viewScale.getScale();
                      Severity: Minor
                      Found in assets/js/TosRUs/src/js/jquery.tosrus.js - About 1 hr to fix

                        Function _initKeys has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function _initKeys( $wrpr, opts )
                            {
                                if ( opts.prev.key || opts.next.key || opts.close.key )
                                {
                                    $(document).bind(
                        Severity: Minor
                        Found in assets/js/TosRUs/src/js/jquery.tosrus.js - About 1 hr to fix

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

                              function animate( $element, properties, direct, callback, easing )
                              {
                                  var duration = _duration;
                          
                                  if ( $.isNumeric( direct ) )
                          Severity: Minor
                          Found in assets/js/TosRUs/src/js/jquery.tosrus.js - About 1 hr to fix

                            Function _initSlides has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                function _initSlides( $tos, $anchors, $wrpr, $sldr, opts )
                            Severity: Minor
                            Found in assets/js/TosRUs/src/js/jquery.tosrus.js - About 35 mins to fix

                              Function _initSlidesFromContent has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  function _initSlidesFromContent( $tos, $anchors, $wrpr, $sldr, opts )
                              Severity: Minor
                              Found in assets/js/TosRUs/src/js/jquery.tosrus.js - About 35 mins to fix

                                Function animate has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    function animate( $element, properties, direct, callback, easing )
                                Severity: Minor
                                Found in assets/js/TosRUs/src/js/jquery.tosrus.js - About 35 mins to fix

                                  Function setButtons has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      function setButtons( $prev, $next, _index, _total, opts )
                                  Severity: Minor
                                  Found in assets/js/TosRUs/src/js/jquery.tosrus.js - About 35 mins to fix

                                    Function swipeOutTos has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                            swipeOutTos: function (x, t, b, c, d) {
                                    Severity: Minor
                                    Found in assets/js/TosRUs/src/js/jquery.tosrus.js - About 35 mins to fix

                                      Function _initSlidesFromAnchors has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          function _initSlidesFromAnchors( $tos, $anchors, $wrpr, $sldr, opts )
                                      Severity: Minor
                                      Found in assets/js/TosRUs/src/js/jquery.tosrus.js - About 35 mins to fix

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

                                                if ( opts.prev.button )
                                                {
                                                    $prev = ( opts.prev.button instanceof $ )
                                                        ? opts.prev.button
                                                        : $('<a class="' + cls( 'prev' ) + '" href="#" />').appendTo( $wrpr );
                                        Severity: Major
                                        Found in assets/js/TosRUs/src/js/jquery.tosrus.js and 1 other location - About 1 hr to fix
                                        assets/js/TosRUs/src/js/jquery.tosrus.js on lines 94..99

                                        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 ( opts.next.button )
                                                {
                                                    $next = ( opts.next.button instanceof $ )
                                                        ? opts.next.button
                                                        : $('<a class="' + cls( 'next' ) + '" href="#" />').appendTo( $wrpr );
                                        Severity: Major
                                        Found in assets/js/TosRUs/src/js/jquery.tosrus.js and 1 other location - About 1 hr to fix
                                        assets/js/TosRUs/src/js/jquery.tosrus.js on lines 88..93

                                        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

                                                swipeOutTos: function (x, t, b, c, d) {
                                                    return c * Math.sin( t / d * ( Math.PI / 2 ) ) + b;
                                                }
                                        Severity: Minor
                                        Found in assets/js/TosRUs/src/js/jquery.tosrus.js and 1 other location - About 45 mins to fix
                                        assets/js/galleryview/easing.js on lines 91..93

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

                                        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 ( typeof o[ btn ].button == 'string' )
                                                {
                                                        o[ btn ].button = $(o[ btn ].button);
                                                }
                                        Severity: Minor
                                        Found in assets/js/TosRUs/src/js/jquery.tosrus.js and 1 other location - About 40 mins to fix
                                        assets/js/TosRUs/src/js/jquery.tosrus.js on lines 1282..1285

                                        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 ( typeof o.wrapper.target == 'string' )
                                                {
                                                    o.wrapper.target = $(o.wrapper.target);
                                                }
                                        Severity: Minor
                                        Found in assets/js/TosRUs/src/js/jquery.tosrus.js and 1 other location - About 40 mins to fix
                                        assets/js/TosRUs/src/js/jquery.tosrus.js on lines 1382..1385

                                        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

                                        There are no issues that match your filters.

                                        Category
                                        Status