renyard/validity

View on GitHub

Showing 29 of 75 total issues

Function loadOptions has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function loadOptions() {
        var validateHosts,
            hostOpt,
            validator = $('validator'),
            legacy = $('legacy'),
Severity: Minor
Found in src/ui/js/options.js - About 1 hr to fix

    Function validity has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var validity = (function(validity) {
        "use strict";
        var nu = {};
    
        // Public Methods
    Severity: Minor
    Found in src/background/nu.js - About 1 hr to fix

      Function parseResponse has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          nu.parseResponse = function(response) {
              var data = JSON.parse(response),
                  errors = 0,
                  warnings = 0,
                  infos = 0,
      Severity: Minor
      Found in src/background/nu.js - About 1 hr to fix

        Function onreadystatechange has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                xhrValidator.onreadystatechange = function() {
                    var response;
                    if (xhrValidator.readyState === 4) {
                        if (xhrValidator.status === 200) {
                            if (legacy) {
        Severity: Minor
        Found in src/background/net.js - About 1 hr to fix

          Function validity has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          var validity = (function (validity) {
              "use strict";
              var opts = {},
                  options = {},
                  backend,
          Severity: Minor
          Found in src/background/opts.js - About 55 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 validity has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          var validity = (function(validity) {
              "use strict";
              var stats = {},
                  ga_elm,
                  purge_timeout,
          Severity: Minor
          Found in src/background/stats.js - About 55 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 _renderFrame has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              ui._renderFrame = function(tabId, text, frames, currFrame, interval) {
          Severity: Minor
          Found in src/background/ui.js - About 35 mins to fix

            Function validity has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            var validity = (function(validity) {
                "use strict";
                var xml = {},
                    suppressed = [
                        // Deprecated in favour of nu validator.
            Severity: Minor
            Found in src/background/xml.js - About 35 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 0;
            Severity: Major
            Found in src/background/xml.js - About 30 mins to fix
              Severity
              Category
              Status
              Source
              Language