attester/attester

View on GitHub
lib/test-type/all-tests.js

Summary

Maintainability
C
7 hrs
Test Coverage

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

var buildTasksForTest = function (testType, test) {
    var subTests = test.subTests;
    var testResults = test.results;
    if (!subTests && !test.url && !testResults) {
        // something is wrong with this test!!
Severity: Minor
Found in lib/test-type/all-tests.js - About 1 hr to fix

    Function init has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    AllTests.prototype.init = function (callback) {
        var expectedCallbacks = 1;
        var testTypes = this.testTypes;
        var decrementExpectedCallbacks = function () {
            expectedCallbacks--;
    Severity: Minor
    Found in lib/test-type/all-tests.js - About 1 hr to fix

      Function buildTask has 33 lines of code (exceeds 25 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 1 hr to fix

        Function buildTasksForTest has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        var buildTasksForTest = function (testType, test) {
            var subTests = test.subTests;
            var testResults = test.results;
            if (!subTests && !test.url && !testResults) {
                // something is wrong with this test!!
        Severity: Minor
        Found in lib/test-type/all-tests.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 init has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

        AllTests.prototype.init = function (callback) {
            var expectedCallbacks = 1;
            var testTypes = this.testTypes;
            var decrementExpectedCallbacks = function () {
                expectedCallbacks--;
        Severity: Minor
        Found in lib/test-type/all-tests.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 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

        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

        There are no issues that match your filters.

        Category
        Status