Showing 87 of 107 total issues
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;
}
- Read upRead up
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();
- Read upRead up
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
Avoid deeply nested control flow statements. Open
if (createdFromTest) {
msg.push(' (probably created in ', createdFromTest, ')');
}
Avoid deeply nested control flow statements. Open
if (!previous) {
previous = true;
} else {
msg.push('\n');
}
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;
- Read upRead up
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) {
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,
- Read upRead up
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 parseCommandLine
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
var parseCommandLine = function () {
var args = system.args;
for (var i = 0, l = args.length; i < l; i++) {
if (args[i] == "--auto-exit") {
autoExit = true;
- Read upRead up
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 staticSender
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Resources.prototype.staticSender = function () {
return function (req, res, next) {
var resolvedPath = req.resolvedPath;
if (resolvedPath) {
var error = function error(err) {
- Read upRead up
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 detectBrowser
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
exports.detectBrowser = function (data) {
var parser = new UAParser(data.userAgent);
var browser = parser.getBrowser();
var browserName = browser.name || "Unknown browser";
var browserVersion = browser.version;
- Read upRead up
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 onLog
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ConsoleLogger.prototype.onLog = function (evt) {
var color = LEVEL_COLORS[evt.level - 1];
var message = evt.message;
if (color) {
if (Array.isArray(color)) {
- Read upRead up
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 onLauncherConnect
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function onLauncherConnect(slaveURL, info) {
var launcherConfig = attester.config["launcher-config"];
if (launcherConfig) {
if (!Array.isArray(launcherConfig)) {
launcherConfig = [launcherConfig];
- Read upRead up
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
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
if (!isDotClassDefinition) return;
Avoid too many return
statements within this function. Open
if (!(ariaRef && /^aria(templates)?\/Aria(\.js)?$/.test(ariaRef))) return;
Avoid too many return
statements within this function. Open
if (!isObjectLitteral) return;
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'
- Read upRead up
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 error
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
error: function (event) {
var name = event.name || "";
var method = event.method || "";
if (name) {
if (method) {
- Read upRead up
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 addResult
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
JsonLogReport.prototype.addResult = function (event) {
if (this._stream) {
var value = JSON.stringify(event);
if (this._first) {
this._first = false;
- Read upRead up
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"