attester/attester

View on GitHub

Showing 87 of 107 total issues

Function TestServer has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var TestServer = function (config, logger) {
    this.logger = new Logger("TestServer", logger);
    this.config = config;
    var app = connect();
    app.use(compression());
Severity: Minor
Found in lib/test-server/test-server.js - About 1 hr to fix

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

      Function cleanTaskEnd has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function cleanTaskEnd() {
              try {
                  mainTestObject.$dispose();
                  mainTestObject = null;
              } catch (e) {
      Severity: Minor
      Found in lib/test-type/aria-templates/client/run.js - About 1 hr to fix

        Function merge has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

        var merge = function (destination, source, exclude) {
            if (!source) {
                return;
            }
            if (!exclude) {
        Severity: Minor
        Found in lib/util/merge.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 addToFlatReport has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

        function addToFlatReport(task) {
            var subTests = task.subTests;
            /*if (task.errors) {
                    // don't loose those errors
                }*/
        Severity: Minor
        Found in lib/reports/json-report.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 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 createPhantomExitCb has 37 lines of code (exceeds 25 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 1 hr to fix

            Function reportsList has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    reportsList: function (callback) {
                        var possibleReports = listsPossibleReports();
                        var now = new Date();
                        var waitingCb = 1;
                        var callCallback = function () {
            Severity: Minor
            Found in lib/test-server/coverage-display.js - About 1 hr to fix

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

              module.exports = function (grunt) {
                  grunt.initConfig({
                      jshint: {
                          lib: ['package.json', 'gruntfile.js', 'lib/**/*.js', '!lib/**/html5shiv.js'],
                          options: grunt.file.readJSON('.jshintrc'),
              Severity: Minor
              Found in Gruntfile.js - About 1 hr to fix

                Function assignTask has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                Slave.prototype.assignTask = function (campaign, task) {
                    var taskExecutionId = this.taskExecutionId = ++taskExecutionCount;
                    this.currentTask = task;
                    this.currentCampaign = campaign;
                    this.currentTaskRestartPlanned = false;
                Severity: Minor
                Found in lib/test-server/slave-server.js - About 1 hr to fix

                  Function TestCampaign has a Cognitive Complexity of 12 (exceeds 5 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 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 instrument has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  Coverage.prototype.instrument = function (absoluteFileName, displayFileName, callback) {
                      var self = this;
                      var cacheEntry = this._cache[displayFileName];
                      if (cacheEntry) {
                          if (cacheEntry.callbacks) {
                  Severity: Minor
                  Found in lib/test-campaign/coverage.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 readATOldFileContent has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function readATOldFileContent(res, fileContent, fileName) {
                          var classDef = null;
                          var classDefinitionCalls = 0;
                          var sandbox = {
                              aria: {
                      Severity: Minor
                      Found in lib/test-type/aria-templates/at-file-reader.js - About 1 hr to fix

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

                        page.onInitialized = function (arg1) {
                            page.evaluate(function () {
                                window.attesterConfig = {
                                    onDisconnect: function () {
                                        window.callPhantom({
                        Severity: Minor
                        Found in lib/browsers/phantomjs-control-script.js - About 1 hr to fix

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

                          ATEnvironment.prototype.readATFile = function (file, callback) {
                              file = path.normalize(file);
                              var fileInfo = this._files[file];
                              if (!fileInfo) {
                                  var waitingCallbacks = [callback];
                          Severity: Minor
                          Found in lib/test-type/aria-templates/at-environment.js - About 1 hr to fix

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

                                var sendTestUpdate = function (scope, name, info) {
                                    if (!checkTaskExecutionId(scope, name)) {
                                        return false;
                                    }
                                    if (!info) {
                            Severity: Minor
                            Found in lib/test-server/client/slave-client.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 processFile has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                var processFile = function processFile(out, fileName, fileInfos) {
                                    fileName = fileName.replace(/\\/g, '/'); // use only forward slashes
                                    out.push('SF:' + fileName);
                                    var statements = fileInfos.code.src;
                                    var execCount;
                                Severity: Minor
                                Found in lib/reports/lcov-report.js - About 1 hr to fix

                                  Function taskFinished has 32 lines of code (exceeds 25 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 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language