conversant/ad-libs.js

View on GitHub

Showing 84 of 84 total issues

Function checkPlugin has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

var checkPlugin = function (name) {
    /**
     * @type plugin
     * @property description
     * @property version
Severity: Minor
Found in lib/detect/environment.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 getVersion has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

var getVersion = function (uaVersion, minVersion, maxVersion) {
    var actualVersion = minVersion;
    if (uaVersion >= minVersion) {
        if (!maxVersion || uaVersion <= maxVersion) {
            actualVersion = uaVersion;
Severity: Minor
Found in lib/detect/browser.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 triggerEvent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

var triggerEvent = function(element, eventName) {
    var doc = document,
        evt;

    if (doc.createEvent) {
Severity: Minor
Found in lib/dom/triggerEvent.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

TODO found
Open

     * @TODO: indexOf is only supported in IE9+, this needs to be updated to account for IE8
Severity: Minor
Found in lib/detect/capabilities.js by fixme
Severity
Category
Status
Source
Language