Passed
Push — master ( 5d5e8c...0c75d0 )
by Jean
01:53
created

jquery.nouislider-range-input.js ➔ ... ➔ ???   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 1
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 1
rs 10
1
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("jquery"),require("nouislider"),require("wnumb"));else if("function"==typeof define&&define.amd)define(["jquery","nouislider","wnumb"],t);else{var r="object"==typeof exports?t(require("jquery"),require("nouislider"),require("wnumb")):t(e.jQuery,e.nouislider,e.wnumb);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(window,function(e,t,r){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){const n=r(1),o=r(2),i=r(3);n.fn.enableNoUISlider=function(){this.filter("input[type=range]:not(.js-nouislider-initialized)").each(function(){const e=n(this);e.css({display:"none"}).addClass("js-nouislider-initialized");const t=n('<div class="nouislider-range-wrapper"><div></div></div>').insertAfter(e),r=e.attr("min")?Number(e.attr("min")):0,u=e.attr("max")?Number(e.attr("max")):100,a=e.attr("step")?Number(e.attr("step")):1,f=e.attr("value")?Number(e.attr("value")):1,l=e.data("wnumb-format")?e.data("wnumb-format"):null,s={start:f,step:a,range:{min:r,max:u},tooltips:[!0]};null!==l&&(s.format=i(l));const c=o.create(t.find("div").get(0),s);e.on("change",function(){c.set(this.value)}),c.on("change",(t,r,n)=>{e.val(n[0]).trigger("change"),c.set(n[0])})})}},function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t){e.exports=r}])});
0 ignored issues
show
Bug introduced by
The variable Symbol seems to be never declared. If this is a global, consider adding a /** global: Symbol */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
Unused Code introduced by
The parameter r is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
Complexity introduced by
A for in loop automatically includes the property of any prototype object, consider checking the key using hasOwnProperty.

When iterating over the keys of an object, this includes not only the keys of the object, but also keys contained in the prototype of that object. It is generally a best practice to check for these keys specifically:

var someObject;
for (var key in someObject) {
    if ( ! someObject.hasOwnProperty(key)) {
        continue; // Skip keys from the prototype.
    }

    doSomethingWith(key);
}
Loading history...
unused-code introduced by
The call to bind does not seem necessary since the function does not use this. Consider calling it directly.
Loading history...
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...
Comprehensibility introduced by
Usage of the sequence operator is discouraged, since it may lead to obfuscated code.

The sequence or comma operator allows the inclusion of multiple expressions where only is permitted. The result of the sequence is the value of the last expression.

This operator is most often used in for statements.

Used in another places it can make code hard to read, especially when people do not realize it even exists as a seperate operator.

This check looks for usage of the sequence operator in locations where it is not necessary and could be replaced by a series of expressions or statements.

var a,b,c;

a = 1, b = 1,  c= 3;

could just as well be written as:

var a,b,c;

a = 1;
b = 1;
c = 3;

To learn more about the sequence operator, please refer to the MDN.

Loading history...
Bug introduced by
The variable define seems to be never declared. If this is a global, consider adding a /** global: define */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
introduced by
You have used a bitwise operator & in a condition. Did you maybe want to use the logical operator &&
Loading history...
Unused Code introduced by
The parameter t is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
introduced by
Expected an assignment or function call and instead saw an expression.
Loading history...
introduced by
Wrap an immediate function invocation in parentheses.
Loading history...
introduced by
A space is required after ','.
Loading history...
introduced by
Missing space before opening brace.
Loading history...
introduced by
Requires a space after '{'.
Loading history...
introduced by
Expected space(s) after "if".
Loading history...
introduced by
Expected literal to be on the right side of ==.
Loading history...
introduced by
Operator '==' must be spaced.
Loading history...
Bug Best Practice introduced by
Apart from some edge-cases, it is generally advisable to use the strict comparison === instead of ==.

The loose comparison such as == or != might produce some weird results for some values, unless you explicitly want to have this behavior here, better use the strict alternative.

Learn more about loose comparison in Javascript.

Loading history...
introduced by
Operator '&&' must be spaced.
Loading history...
introduced by
Operator '=' must be spaced.
Loading history...
introduced by
Missing whitespace after semicolon.
Loading history...
Bug introduced by
The variable define was not defined.
Loading history...
introduced by
Expected space(s) after "else".
Loading history...
Compatibility Best Practice introduced by
Instead of var consider using ECMAScript 6's const or let which have stricter semantics.
Loading history...
introduced by
Operator '?' must be spaced.
Loading history...
introduced by
The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.
Loading history...
introduced by
Expected space(s) after "for".
Loading history...
introduced by
for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.keys,values,entries, and iterate over the resulting array.
Loading history...
introduced by
Requires a space before '}'.
Loading history...
introduced by
Unexpected function expression.
Loading history...
introduced by
'e' is already declared in the upper scope.
Loading history...
introduced by
't' is already declared in the upper scope.
Loading history...
introduced by
'r' is already declared in the upper scope.
Loading history...
introduced by
Expected space(s) before "return".
Loading history...
introduced by
Unexpected chained assignment.
Loading history...
introduced by
Missing space before value for key 'i'.
Loading history...
introduced by
Missing space before value for key 'l'.
Loading history...
introduced by
Missing space before value for key 'exports'.
Loading history...
introduced by
Return statement should not contain assignment.
Loading history...
introduced by
Unexpected use of comma operator.
Loading history...
introduced by
Operator '||' must be spaced.
Loading history...
introduced by
Missing space before value for key 'enumerable'.
Loading history...
introduced by
Missing space before value for key 'get'.
Loading history...
introduced by
Expected literal to be on the right side of !=.
Loading history...
introduced by
Operator '!=' must be spaced.
Loading history...
Bug Best Practice introduced by
Apart from some edge-cases, it is generally advisable to use the strict comparison !== instead of !=.

The loose comparison such as == or != might produce some weird results for some values, unless you explicitly want to have this behavior here, better use the strict alternative.

Learn more about loose comparison in Javascript.

Loading history...
introduced by
Missing space before value for key 'value'.
Loading history...
introduced by
Unexpected assignment within an 'if' statement.
Loading history...
introduced by
Unexpected use of '&'.
Loading history...
introduced by
Operator '&' must be spaced.
Loading history...
introduced by
Expected space(s) before "for".
Loading history...
Coding Style introduced by
Split initialized 'const' declarations into multiple statements.
Loading history...
introduced by
Missing space before value for key 'display'.
Loading history...
introduced by
Expected a line break after this opening brace.
Loading history...
introduced by
Missing space before value for key 'start'.
Loading history...
introduced by
Missing space before value for key 'step'.
Loading history...
introduced by
Missing space before value for key 'range'.
Loading history...
introduced by
Missing space before value for key 'min'.
Loading history...
introduced by
Missing space before value for key 'max'.
Loading history...
introduced by
Missing space before value for key 'tooltips'.
Loading history...
introduced by
Expected a line break before this closing brace.
Loading history...
introduced by
Expected literal to be on the right side of !==.
Loading history...
introduced by
Operator '!==' must be spaced.
Loading history...
introduced by
'n' is already declared in the upper scope.
Loading history...
introduced by
Missing space before =>.
Loading history...
introduced by
Missing space after =>.
Loading history...
Coding Style introduced by
As per coding-style, please add a newline (\n) at the end of the file.
Loading history...