attester/attester

View on GitHub

Showing 107 of 107 total issues

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

          campaign.create = function (campaign, override, campaignNumber) {
              var campaignConfig = getDefaults();
              if (override && override.resources) {
                  // "array-ify" entries in resources so they can get merged properly
                  for (var key in override.resources) {
          Severity: Minor
          Found in lib/attester/campaign.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 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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              function processErrorsArray(errors) {
                  for (var i = 0, l = errors.length; i < l; i++) {
                      processError(errors[i]);
                  }
              }
          Severity: Minor
          Found in lib/reports/xml-report.js and 1 other location - About 50 mins to fix
          lib/reports/xml-report.js on lines 112..116

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 52.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              function processTestsArray(array) {
                  for (var i = 0, l = array.length; i < l; i++) {
                      processTest(array[i]);
                  }
              }
          Severity: Minor
          Found in lib/reports/xml-report.js and 1 other location - About 50 mins to fix
          lib/reports/xml-report.js on lines 81..85

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 52.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          for (var i = 0; i < mockable.length; i += 1) {
              originalMethods[mockable[i]] = defaultLogger[mockable[i]];
          }
          Severity: Minor
          Found in lib/attester/logger.js and 1 other location - About 50 mins to fix
          lib/attester/logger.js on lines 38..40

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 52.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              for (var i = 0; i < mockable.length; i += 1) {
                  defaultLogger[mockable[i]] = originalMethods[mockable[i]];
              }
          Severity: Minor
          Found in lib/attester/logger.js and 1 other location - About 50 mins to fix
          lib/attester/logger.js on lines 26..28

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 52.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                          attester.testEnd({
                              name: testName + " " + suite.title,
                              testId: suite._attester_id,
                              parentTestId: suite.parent._attester_id
                          });
          Severity: Minor
          Found in lib/test-type/mocha/client/connector.js and 1 other location - About 50 mins to fix
          lib/test-type/mocha/client/connector.js on lines 121..125

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 51.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                      attester.testEnd({
                          name: testName + " " + hook.title,
                          testId: hook._attester_id,
                          parentTestId: hook.parent._attester_id
                      });
          Severity: Minor
          Found in lib/test-type/mocha/client/connector.js and 1 other location - About 50 mins to fix
          lib/test-type/mocha/client/connector.js on lines 78..82

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 51.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

          function checkConfigAndEndProcess(code) {
              if (attester.config["shutdown-on-campaign-end"]) {
                  endProcess(code);
              } else {
                  attester.logger.logInfo("Idle; press CTRL-C to end the process.");
          Severity: Minor
          Found in bin/attester.js and 1 other location - About 45 mins to fix
          lib/attester/cli.js on lines 40..46

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 50.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

          function checkConfigAndEndProcess(code) {
              if (attester.config["shutdown-on-campaign-end"]) {
                  endProcess(code);
              } else {
                  attester.logger.logInfo("Idle; press CTRL-C to end the process.");
          Severity: Minor
          Found in lib/attester/cli.js and 1 other location - About 45 mins to fix
          bin/attester.js on lines 81..87

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 50.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Avoid deeply nested control flow statements.
          Open

                                      if (!previous) {
                                          previous = true;
                                      } else {
                                          msg.push('\n');
                                      }
          Severity: Major
          Found in lib/test-type/aria-templates/client/run.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        if (createdFromTest) {
                                            msg.push(' (probably created in ', createdFromTest, ')');
                                        }
            Severity: Major
            Found in lib/test-type/aria-templates/client/run.js - About 45 mins to fix

              Function exports has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              module.exports = function (attester) {
                  var BaseTestType = attester.classes.BaseTestType;
                  var FileSet = attester.classes.FileSet;
                  var BrowserExcludesFileSet = attester.classes.BrowserExcludesFileSet;
              
              
              Severity: Minor
              Found in lib/test-type/mocha/mocha-test-type.js - About 45 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 tag has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function tag(name, defaults, description, scope, attributesGenerator) {
              Severity: Minor
              Found in lib/util/page-generator.js - About 35 mins to fix
                Severity
                Category
                Status
                Source
                Language