attester/attester

View on GitHub

Showing 87 of 107 total issues

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

module.exports = function (ipv4Only) {
    var categories = {
        IPv4: [],
        internalIPv4: [],
        IPv6: [],
Severity: Minor
Found in lib/util/detectHostname.js - About 1 hr to fix

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

    function tag(name, defaults, description, scope, attributesGenerator) {
        var config = defaults || {};
        var data = scope || {};
        merge(config, description);
    
    
    Severity: Minor
    Found in lib/util/page-generator.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 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 optimizeNumberOfParallelInstances has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var optimizeNumberOfParallelInstances = function (cfg, logger) {
        if (cfg.maxInstances === 0) { // explicitly asking for no PhantomJS
            logger.logInfo("No PhantomJS instances launched.");
            return 0;
        }
    Severity: Minor
    Found in lib/util/optimize-parallel.js - About 1 hr to fix

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

        Function create has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        exports.create = function (callback) {
            testServer = new TestServer({
                predictableUrls: config["predictable-urls"],
                shutdownOnCampaignEnd: config["shutdown-on-campaign-end"],
                frozen: config["server-only"],
        Severity: Minor
        Found in lib/attester/server.js - About 1 hr to fix

          Function routeCoverage has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var routeCoverage = function (req, res, next) {
              var testServer = this;
              var match = /\/([0-9]+)\/([0-9]+)/.exec(req.path);
              var campaignId;
              var taskId;
          Severity: Minor
          Found in lib/test-server/test-server.js - About 1 hr to fix

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

            module.exports = function (req, res, next) {
                var model = this.data;
                var page = this.page;
                if (page.charAt(0) !== "/") {
                    page = "/" + page;
            Severity: Minor
            Found in lib/middlewares/template.js - About 1 hr to fix

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

                Function walker has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    var walker = new UglifyJS.TreeWalker(function (node) {
                        var isAssignment = node instanceof UglifyJS.AST_Assign && node.operator == "=";
                        if (!isAssignment) return;
                        var moduleExports = node.left;
                        var isDotExports = moduleExports instanceof UglifyJS.AST_Dot && moduleExports.property == "exports";
                Severity: Minor
                Found in lib/test-type/aria-templates/at-file-reader.js - About 1 hr to fix

                  Function require has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  exports.require = function (name, config) {
                      // Do it here so that it's available for the plugin even before it gets called
                      var pluginConfig = exports.config(name, config);
                  
                      var pending = function () {
                  Severity: Minor
                  Found in lib/attester/plugins.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 processFile has a Cognitive Complexity of 10 (exceeds 5 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

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

                  function readRequire(expression) {
                      if (expression instanceof UglifyJS.AST_Call && expression.args.length == 1) {
                          var requireVar = expression.expression;
                          if (requireVar instanceof UglifyJS.AST_SymbolRef && requireVar.name == "require" && requireVar.thedef.undeclared) {
                              var param = expression.args[0];
                  Severity: Minor
                  Found in lib/test-type/aria-templates/at-file-reader.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 bootPhantom has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      bootPhantom: function (cfg, state, n) {
                          cfg.args = cfg.args || {};
                          var phantomPath = cfg.phantomPath;
                          var controlScript = pathUtil.join(__dirname, '../browsers/phantomjs-control-script.js');
                  
                  
                  Severity: Minor
                  Found in lib/launchers/phantom-launcher.js - About 1 hr to fix

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

                    TestCampaign.prototype.init = function (callback) {
                        // fills the array of tasks
                        var self = this;
                        var waitingCb = 1;
                        var endInit = function () {
                    Severity: Minor
                    Found in lib/test-campaign/test-campaign.js - About 1 hr to fix

                      Function stackTrace has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          attesterPrototype.stackTrace = function (exception) {
                              try {
                                  var skipFirstLine = false;
                                  if (!exception || !exception.stack) {
                                      try {
                      Severity: Minor
                      Found in lib/test-server/client/slave-client.js - About 1 hr to fix

                        Function getStatus has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        TestServer.prototype.getStatus = function () {
                            return {
                                slaves: this.slaves.map(function (slave) {
                                    return {
                                        address: slave.address,
                        Severity: Minor
                        Found in lib/test-server/test-server.js - About 1 hr to fix

                          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

                          Severity
                          Category
                          Status
                          Source
                          Language