Showing 59 of 84 total issues
Function domReady
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
var domReady = function (callback, targetWindow, isInteractiveOk) {
// Local variables, because domReady should work for more than just the parent document/window
var hasLoaded = false,
pollingTimeoutHandle,
Function exports
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(config) {
config.set({
basePath: '',
Function getSupport
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
var getSupport = function (win) {
win = win || window;
var support = [],
len = EXT_SUPPORT_FIELDS.length,
result,
- Read upRead up
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 xhr
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
var xhr = function (options, callback) {
var method = options.method || 'GET',
withCredentials = options.withCredentials || false,
url = options.url,
responseType = options.responseType || 'text',
- Read upRead up
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 appendHtml
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
var appendHtml = function(parentEl, html) {
if (!(parentEl && parentEl.appendChild)) {
return [new Error('parentEl is not an Element')];
}
Function formatUrl
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
var formatUrl = function (components) {
var protocol = components.protocol || '',
host = components.host,
pathname = components.pathname || '',
search = components.search || '',
- Read upRead up
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 getSafariVersion
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
var getSafariVersion = function (win, uaVersion) {
var safariVersion = DEFAULT_VERSION,
d = win.document,
nav = win.navigator;
- Read upRead up
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 parseSearch
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
var parseSearch = function (querystring) {
var query = {},
parts,
pair,
i;
- Read upRead up
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 getOtherOS
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
var getOtherOS = function (win, ua) {
var otherBrowser = new Browser();
if (has('wiiu', win)) {
Function createScript
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
var createScript = function (url, loaded, requestTimeout, target) {
var script = d.createElement('script'),
timeoutId;
if (!target){
Function loadScript
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
var loadScript = function (urls, onLoaded, onError, requestTimeout, target) {
var queue = 0,
errorUrls = [],
url,
i;
- Read upRead up
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 getExecutingScript
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
var getExecutingScript = function (validatorFunc, testScript) {
var currentScriptEl = testScript || document.currentScript, // FF 4+, Chrome 29+, Opera 16+, Safari 7+
outputScriptEl = null,
scripts,
scriptEl,
- Read upRead up
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 getAppleOS
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
var getAppleOS = function (win, ua) {
var mac = /Mac/i,
iOS = /iPhone|iPad|iPod/i,
appleBrowser = new Browser(),
- Read upRead up
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 formatUrl
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
var formatUrl = function (components) {
var protocol = components.protocol || '',
host = components.host,
pathname = components.pathname || '',
search = components.search || '',
Function getSafariVersion
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
var getSafariVersion = function (win, uaVersion) {
var safariVersion = DEFAULT_VERSION,
d = win.document,
nav = win.navigator;
Function xhr
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
var xhr = function (options, callback) {
var method = options.method || 'GET',
withCredentials = options.withCredentials || false,
url = options.url,
responseType = options.responseType || 'text',
Function getAppleOS
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
var getAppleOS = function (win, ua) {
var mac = /Mac/i,
iOS = /iPhone|iPad|iPod/i,
appleBrowser = new Browser(),
Function getTimeline
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
self.getTimeline = function () {
var timelineMap = [],
time,
calculatedStart;
Function getTridentVersion
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
var getTridentVersion = function (win, uaVersion) {
var tridentVersion = DEFAULT_VERSION,
d = win.document;
// Detect all IE versions possible by feature detection
- Read upRead up
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 createScript
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
var createScript = function (url, loaded, requestTimeout, target) {
var script = d.createElement('script'),
timeoutId;
if (!target){
- Read upRead up
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"