conversant/ad-libs.js

View on GitHub

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,
Severity: Minor
Found in lib/dom/domReady.js - About 2 hrs to fix

    Function exports has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function(config) {
        config.set({
    
            basePath: '',
    
    
    Severity: Minor
    Found in karma.conf.js - About 1 hr to fix

      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,
      Severity: Minor
      Found in lib/detect/safeframe.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 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',
      Severity: Minor
      Found in lib/xhr.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 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')];
          }
      
      
      Severity: Minor
      Found in lib/dom/appendHtml.js - About 1 hr to fix

        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 || '',
        Severity: Minor
        Found in lib/url/format.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 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;
        Severity: Minor
        Found in lib/detect/browser.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 parseSearch has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        var parseSearch = function (querystring) {
            var query = {},
                parts,
                pair,
                i;
        Severity: Minor
        Found in lib/url/parse.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 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)) {
        Severity: Minor
        Found in lib/detect/browser.js - About 1 hr to fix

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

            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;
            Severity: Minor
            Found in lib/loadScript.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 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,
            Severity: Minor
            Found in lib/dom/getExecutingScript.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 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(),
            Severity: Minor
            Found in lib/detect/browser.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 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 || '',
            Severity: Minor
            Found in lib/url/format.js - About 1 hr to fix

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

                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',
                Severity: Minor
                Found in lib/xhr.js - About 1 hr to fix

                  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(),
                  Severity: Minor
                  Found in lib/detect/browser.js - About 1 hr to fix

                    Function getTimeline has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        self.getTimeline = function () {
                            var timelineMap = [],
                                time,
                                calculatedStart;
                    
                    
                    Severity: Minor
                    Found in lib/performanceMarker.js - About 1 hr to fix

                      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
                      Severity: Minor
                      Found in lib/detect/browser.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 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){
                      Severity: Minor
                      Found in lib/loadScript.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

                      Severity
                      Category
                      Status
                      Source
                      Language