Showing 76 of 76 total issues
Function _on
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
var _on = function (eventString, eventHandler) {
// Bind an event string(s) to an event handler function.
//
// Parameter
// eventString
- Create a ticketCreate a ticket
Function inactivityCheck
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
var inactivityCheck = setInterval(function() {
// Check to see if active is false, if so - there has been no activity.
if(!active) {
// Then check if enough time has passed for the periods defined in `opts.periods`
for(var i in opts.periods) {
- Create a ticketCreate a ticket
Function 8
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{}],8:[function(require,module,exports){
/*!
* ki.js - jQuery-like API super-tiny JavaScript library
* Copyright (c) 2014 Denis Ciccale (@tdecs)
* Released under MIT license
- Create a ticketCreate a ticket
Function _emit
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
var _emit = function (eventString) {
// Emit an event to execute the bound event handler functions.
// The event handlers are executed immediately.
//
// Parameter
- Create a ticketCreate a ticket
Function log
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
log: function(message, obj) {
if(this.config.debug && console !== undefined) {
var style = "";
switch(obj) {
case "warn":
- Create a ticketCreate a ticket
Function isOnScreen
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
isOnScreen: function(x, y) {
if(x === null || typeof x === 'undefined') { x = 1; }
if(y === null || typeof y === 'undefined') { y = 1; }
var viewport = {};
- Create a ticketCreate a ticket
Function isOnScreen
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
isOnScreen: function(x, y) {
if(x === null || typeof x === 'undefined') { x = 1; }
if(y === null || typeof y === 'undefined') { y = 1; }
var viewport = {};
- Create a ticketCreate a ticket
Function log
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
log: function(message, obj) {
if(this.config.debug && console !== undefined) {
var style = "";
switch(obj) {
case "warn":
- Create a ticketCreate a ticket
Function isOnScreen
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
isOnScreen: function(x, y) {
if(x === null || typeof x === 'undefined') { x = 1; }
if(y === null || typeof y === 'undefined') { y = 1; }
var viewport = {};
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
if(opts.event === "click") {
opts.event = "focus";
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if(element.className) {
tgtStr += "." + element.className;
} else {
// No classes? Position on page? -- this could vary greatly and is up to the client device...so no.
// var offset = $ki(element).offset();
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if(element.className) {
tgtStr += "." + element.className;
} else {
// No classes? Position on page? -- this could vary greatly and is up to the client device...so no.
// var offset = $ki(element).offset();
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (subRouteMap.hasOwnProperty(rs)) {
delete this.routeMap[rs];
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if(opts.event === "click") {
opts.event = "focus";
}
- Create a ticketCreate a ticket
Function leave
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
leave: function(opts) {
opts = this.extend({
"_method": "leave",
"category": "behavior",
"action": "",
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function pageWordCount
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
pageWordCount: function(discountedSelectors) {
// discount obvious selectors (so we don't count text in the footer, nav, navbar, etc.)
discountedSelectors = (typeof(discountedSelectors) !== 'object') ? ['.footer', '.navbar', '.nav', '.header', '.ad', '.advertisement']:discountedSelectors;
var bodyInnerText = $ki('body')[0].innerText || $ki('body')[0].textContent || "";
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"