attester/attester

View on GitHub

Showing 87 of 107 total issues

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

module.exports = function (attesterServer, serverRoot) {
    var listsPossibleReports = function () {
        var list = [];
        attesterServer.campaigns.forEach(function (campaign) {
            var result = campaign.getCoverageResult();
Severity: Minor
Found in lib/test-server/coverage-display.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 buildId has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

var buildId = function (loggersChain) {
    var somethingBefore = false;
    var leftParen = '['; // https://github.com/jshint/jshint/issues/1485
    var res = [leftParen];
    for (var i = 0, l = loggersChain.length; i < l; i++) {
Severity: Minor
Found in lib/logging/console-logger.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

Avoid deeply nested control flow statements.
Open

                            if (!previous) {
                                previous = true;
                            } else {
                                msg.push('\n');
                            }
Severity: Major
Found in lib/test-type/aria-templates/client/run.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                if (createdFromTest) {
                                    msg.push(' (probably created in ', createdFromTest, ')');
                                }
    Severity: Major
    Found in lib/test-type/aria-templates/client/run.js - About 45 mins to fix

      Function exports has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      module.exports = function (attester) {
          var BaseTestType = attester.classes.BaseTestType;
          var FileSet = attester.classes.FileSet;
          var BrowserExcludesFileSet = attester.classes.BrowserExcludesFileSet;
      
      
      Severity: Minor
      Found in lib/test-type/mocha/mocha-test-type.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 tag has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function tag(name, defaults, description, scope, attributesGenerator) {
      Severity: Minor
      Found in lib/util/page-generator.js - About 35 mins to fix

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

        var parseCommandLine = function () {
            var args = system.args;
            for (var i = 0, l = args.length; i < l; i++) {
                if (args[i] == "--auto-exit") {
                    autoExit = true;
        Severity: Minor
        Found in lib/browsers/phantomjs-control-script.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

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

        ConsoleLogger.prototype.onLog = function (evt) {
            var color = LEVEL_COLORS[evt.level - 1];
            var message = evt.message;
            if (color) {
                if (Array.isArray(color)) {
        Severity: Minor
        Found in lib/logging/console-logger.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

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

        Resources.prototype.staticSender = function () {
            return function (req, res, next) {
                var resolvedPath = req.resolvedPath;
                if (resolvedPath) {
                    var error = function error(err) {
        Severity: Minor
        Found in lib/middlewares/resources.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

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

        exports.detectBrowser = function (data) {
            var parser = new UAParser(data.userAgent);
            var browser = parser.getBrowser();
            var browserName = browser.name || "Unknown browser";
            var browserVersion = browser.version;
        Severity: Minor
        Found in lib/util/browser-detection.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

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

        function onLauncherConnect(slaveURL, info) {
            var launcherConfig = attester.config["launcher-config"];
            if (launcherConfig) {
                if (!Array.isArray(launcherConfig)) {
                    launcherConfig = [launcherConfig];
        Severity: Minor
        Found in lib/launchers/attester-launcher.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

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

        var buildTask = function (testType, test, browser) {
            var taskId = this.tasks.length;
            var task = {
                taskId: taskId,
                testType: testType,
        Severity: Minor
        Found in lib/test-type/all-tests.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

                if (!isDotClassDefinition) return;
        Severity: Major
        Found in lib/test-type/aria-templates/at-file-reader.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  if (!isObjectLitteral) return;
          Severity: Major
          Found in lib/test-type/aria-templates/at-file-reader.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return;
            Severity: Major
            Found in lib/test-type/aria-templates/at-file-reader.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      if (!(ariaRef && /^aria(templates)?\/Aria(\.js)?$/.test(ariaRef))) return;
              Severity: Major
              Found in lib/test-type/aria-templates/at-file-reader.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return true;
                Severity: Major
                Found in lib/test-type/aria-templates/at-file-reader.js - About 30 mins to fix

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

                  exports.set = function (path, config) {
                      config = config || path;
                      if (typeof path === "string") {
                          if (!internalConfig[path]) {
                              internalConfig[path] = {};
                  Severity: Minor
                  Found in lib/attester/config.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 onSocketData_pauseChanged has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  Slave.prototype.onSocketData_pauseChanged = function (message) {
                      var paused = message.paused;
                      paused = !!paused; // makes sure it is a boolean
                      if (this.paused !== paused) {
                          this.paused = paused;
                  Severity: Minor
                  Found in lib/test-server/slave-server.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 error has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      error: function (event) {
                          var name = event.name || "";
                          var method = event.method || "";
                          if (name) {
                              if (method) {
                  Severity: Minor
                  Found in lib/reports/console-report.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