attester/attester

View on GitHub

Showing 87 of 107 total issues

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

var getPrototype = function (type) {
    // See if we can get it from local repository, otherwise delegate to npm
    var locals = {
        'aria-templates': './aria-templates/at-test-type',
        'mocha': './mocha/mocha-test-type'
Severity: Minor
Found in lib/test-type/all-tests.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 buildNameFromConfig has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

var buildNameFromConfig = function (config) {
    if (config.displayAs) {
        return config.displayAs;
    }

Severity: Minor
Found in lib/test-campaign/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 _addResult has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

TestEnumerator.prototype._addResult = function (testInfo, res) {
    var classpath = testInfo.name;
    var testSuite = res.testSuite;
    var error = res.error;
    if (error) {
Severity: Minor
Found in lib/test-type/aria-templates/at-tests-enumerator.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

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 addResult has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

JsonLogReport.prototype.addResult = function (event) {
    if (this._stream) {
        var value = JSON.stringify(event);
        if (this._first) {
            this._first = false;
Severity: Minor
Found in lib/reports/json-log-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

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

Resources.prototype.resolvePath = function (path, callback) {
    var rootsArray = this._rootsArray;
    var checkFileExistence = function (pathInContext, currentIndex) {
        var entry = rootsArray[currentIndex];
        var absolutePath = pathUtils.join(entry.root, pathInContext);
Severity: Minor
Found in lib/middlewares/resources.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