attester/attester

View on GitHub

Showing 87 of 107 total issues

Function getReportContent has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

function getReportContent(jsonReport, fixedLevels) {
    var res = ['<?xml version="1.0" encoding="UTF-8" ?>\n'];

    function processError(error) {
        var tagName = error.failure ? "failure" : "error";
Severity: Minor
Found in lib/reports/xml-report.js - About 5 hrs 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

File test-server.js has 382 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Copyright 2012 Amadeus s.a.s.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
Severity: Minor
Found in lib/test-server/test-server.js - About 5 hrs to fix

    Function writeReports has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

    var writeReports = function (config, results, callback) {
        var mkdirsCache = {};
        var expectedCallbacks = 1;
        var errors = null;
        var decreaseCallbacks = function (err) {
    Severity: Minor
    Found in lib/reports/write-reports.js - About 4 hrs 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

    File slave-client.js has 342 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* global SockJS */
    /*
     * Copyright 2012 Amadeus s.a.s.
     * Licensed under the Apache License, Version 2.0 (the "License");
     * you may not use this file except in compliance with the License.
    Severity: Minor
    Found in lib/test-server/client/slave-client.js - About 4 hrs to fix

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

      module.exports = function (attester) {
          var BaseTestType = attester.classes.BaseTestType;
          var FileSet = attester.classes.FileSet;
          var BrowserExcludesFileSet = attester.classes.BrowserExcludesFileSet;
      
      
      Severity: Major
      Found in lib/test-type/mocha/mocha-test-type.js - About 4 hrs to fix

        Function writeReports has 94 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var writeReports = function (config, results, callback) {
            var mkdirsCache = {};
            var expectedCallbacks = 1;
            var errors = null;
            var decreaseCallbacks = function (err) {
        Severity: Major
        Found in lib/reports/write-reports.js - About 3 hrs to fix

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

          module.exports = function (attesterServer, serverRoot) {
              var listsPossibleReports = function () {
                  var list = [];
                  attesterServer.campaigns.forEach(function (campaign) {
                      var result = campaign.getCoverageResult();
          Severity: Major
          Found in lib/test-server/coverage-display.js - About 3 hrs to fix

            Function iterate has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Open

            FileSet.prototype.iterate = function (entryCallback, endCallback) {
                var self = this;
                var root = this._root || "";
                var waitingCallbacks = 0;
                var decreaseCallbacks = function () {
            Severity: Minor
            Found in lib/util/files/fileset.js - About 3 hrs 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 exports has 86 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = function (attester) {
                var BaseTestType = attester.classes.BaseTestType;
                var TestsEnumerator = require('./at-tests-enumerator.js');
            
                var url = attester.utils.url;
            Severity: Major
            Found in lib/test-type/aria-templates/at-test-type.js - About 3 hrs to fix

              Function readATNewFileContent has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
              Open

              function readATNewFileContent(res, fileContent, fileName) {
                  var foundClassDef = null;
                  var walker = new UglifyJS.TreeWalker(function (node) {
                      var isAssignment = node instanceof UglifyJS.AST_Assign && node.operator == "=";
                      if (!isAssignment) return;
              Severity: Minor
              Found in lib/test-type/aria-templates/at-file-reader.js - About 2 hrs 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

              File slave-server.js has 281 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*
               * Copyright 2012 Amadeus s.a.s.
               * Licensed under the Apache License, Version 2.0 (the "License");
               * you may not use this file except in compliance with the License.
               * You may obtain a copy of the License at
              Severity: Minor
              Found in lib/test-server/slave-server.js - About 2 hrs to fix

                Function readATNewFileContent has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function readATNewFileContent(res, fileContent, fileName) {
                    var foundClassDef = null;
                    var walker = new UglifyJS.TreeWalker(function (node) {
                        var isAssignment = node instanceof UglifyJS.AST_Assign && node.operator == "=";
                        if (!isAssignment) return;
                Severity: Major
                Found in lib/test-type/aria-templates/at-file-reader.js - About 2 hrs to fix

                  Function getReportContent has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function getReportContent(jsonReport, fixedLevels) {
                      var res = ['<?xml version="1.0" encoding="UTF-8" ?>\n'];
                  
                      function processError(error) {
                          var tagName = error.failure ? "failure" : "error";
                  Severity: Major
                  Found in lib/reports/xml-report.js - About 2 hrs to fix

                    Function taskFinished has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                    Open

                        taskFinished: function (event) {
                            var taskId = event.taskId;
                    
                            var task = this.campaign.jsonReport.tasks[taskId];
                            var taskName = task.name;
                    Severity: Minor
                    Found in lib/reports/console-report.js - About 2 hrs 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 createPhantomExitCb has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                    Open

                        createPhantomExitCb: function (cfg, state, n) {
                            // Node 0.8 and 0.10 differently handle spawning errors ('exit' vs 'error'), but errors that happened after
                            // launching the command are both handled in 'exit' callback
                            return function (code, signal) {
                                // See http://tldp.org/LDP/abs/html/exitcodes.html and http://stackoverflow.com/a/1535733/
                    Severity: Minor
                    Found in lib/launchers/phantom-launcher.js - About 2 hrs 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 MochaTestType has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        var MochaTestType = function (campaign, inputConfig) {
                            // Default values for the configuration object
                            var testConfig = {
                                files: {
                                    rootDirectory: process.cwd(),
                    Severity: Major
                    Found in lib/test-type/mocha/mocha-test-type.js - About 2 hrs to fix

                      Function readATClasspath has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      ATEnvironment.prototype.readATClasspath = function (classpath, callback) {
                          var classpathInfo = this._classpaths[classpath];
                          var self = this;
                          var filePath = null;
                          if (!classpathInfo) {
                      Severity: Major
                      Found in lib/test-type/aria-templates/at-environment.js - About 2 hrs to fix

                        Function TestCampaign has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        var TestCampaign = function (config, parentLogger) {
                            this.results = config.liveResults ? [] : null;
                            this.startTime = new Date();
                            this.campaignNumber = config.campaignNumber;
                            this.id = createCampaignId(this.startTime);
                        Severity: Minor
                        Found in lib/test-campaign/test-campaign.js - About 2 hrs to fix

                          Function readATClasspath has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                          Open

                          ATEnvironment.prototype.readATClasspath = function (classpath, callback) {
                              var classpathInfo = this._classpaths[classpath];
                              var self = this;
                              var filePath = null;
                              if (!classpathInfo) {
                          Severity: Minor
                          Found in lib/test-type/aria-templates/at-environment.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 AriaTemplatesTests has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              var AriaTemplatesTests = function (campaign, inputConfig) {
                                  // Default values for the config:
                                  var testConfig = {
                                      rootFolderPath: '/',
                                      bootstrap: null,
                          Severity: Minor
                          Found in lib/test-type/aria-templates/at-test-type.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language