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
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 )
{
Function complementOptions
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
function complementOptions( o, $tos, _tos )
{
// Complement objects
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()
{
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,
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,
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 )
{
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 ] ) )
Function _initResizeVideo
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _initResizeVideo( $slide, ratio, maxWidth, maxHeight )
{
var $video = $slide.children();
$slide
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
Function scaleButtons
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function scaleButtons( $btns, $capt, timeout )
{
if ( _viewScale )
{
var scale = _viewScale.getScale();
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(
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 ) )
Function _initSlides
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function _initSlides( $tos, $anchors, $wrpr, $sldr, opts )
Function _initSlidesFromContent
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function _initSlidesFromContent( $tos, $anchors, $wrpr, $sldr, opts )
Function animate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function animate( $element, properties, direct, callback, easing )
Function setButtons
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function setButtons( $prev, $next, _index, _total, opts )
Function swipeOutTos
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
swipeOutTos: function (x, t, b, c, d) {
Function _initSlidesFromAnchors
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function _initSlidesFromAnchors( $tos, $anchors, $wrpr, $sldr, opts )
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 );
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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 );
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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;
}
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ( typeof o[ btn ].button == 'string' )
{
o[ btn ].button = $(o[ btn ].button);
}
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ( typeof o.wrapper.target == 'string' )
{
o.wrapper.target = $(o.wrapper.target);
}
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76