Showing 11 of 25 total issues
Function getElementsByClassName
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
document.getElementsByClassName = function(search) {
var d = document, elements, pattern, i, results = [];
if (d.querySelectorAll) { // IE8
return d.querySelectorAll("." + search);
}
- 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 exports
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
stylesheet.check.exports = function(exports) {
// If our `exports` parameter is not an `Array`, cast it to one.
if (!me.isaArray(exports)) {
exports = [exports];
}
- Create a ticketCreate a ticket
Function anonymous
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
define.anonymous = function(moduleName) {
// If we don't have a anonymous module waiting to be defined, then halt the function. We should at the very least have
// either a `factory` or reference to the last defined module (which in this case would be our anonymous module
// without a name).
if (!define.anonymous.pending && !define.module.last) {
- 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 test
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
me.tasks.test = function() {
me.grunt.registerTask('test', function() {
var done = this.async();
var series = [];
var success = true;
- Create a ticketCreate a ticket
Function check
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
javascript.check = function(module, postLoadCheck) {
// See if the module itself has been flagged as loaded.
if (module.loader.loaded === true || module.amd === true && postLoadCheck === true) {
return true;
}
- 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 attributes
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
javascript.attributes = function(attribute) {
// The `Array` to store our `attribute` values.
var values = [];
// If the `attribute` is not a string, halt the `Function`.
- Create a ticketCreate a ticket
Function isType
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
me.isType = function(variable, type) {
// Special check for `null` for legacy browsers. @ie
if (type === 'Object' && variable === null) {
return false;
}
- 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 log
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
var log = function() {
// Make sure that both debugging is enable and what `global.console` exists.
if (!me.config.settings.debug || !global.console) {
return false;
}
- 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 too many return
statements within this function. Open
return undefined;
- Create a ticketCreate a ticket
Function scan
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
stylesheet.scan = function(ruleset, selectors) {
// Store whether or not we found our selector.
var found = false;
// Loop through the rules.
- 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 series
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
normalize.series = function(input, type, fallback, strip) {
// Store our normalized series.
var normalized = [];
// Case our input to an array/series.
- 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"