dolox/fallback

View on GitHub

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);
    }
Severity: Minor
Found in examples/js/getElementsByClassName.js - About 1 hr to fix

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];
    }
Severity: Minor
Found in src/loader/stylesheet.js - About 1 hr to fix

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) {
Severity: Minor
Found in src/define.js - About 1 hr to fix

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;
Severity: Minor
Found in Gruntfile.js - About 1 hr to fix

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;
    }
Severity: Minor
Found in src/loader/javascript.js - About 1 hr to fix

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`.
Severity: Minor
Found in src/loader/javascript.js - About 1 hr to fix

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;
    }
Severity: Minor
Found in src/core.js - About 45 mins to fix

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;
    }
Severity: Minor
Found in src/log.js - About 45 mins to fix

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;
Severity: Major
Found in src/loader/javascript.js - About 30 mins to fix

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.
Severity: Minor
Found in src/loader/stylesheet.js - About 25 mins to fix

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.
Severity: Minor
Found in src/normalize.js - About 25 mins to fix

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

Severity
Category
Status
Source
Language