Showing 87 of 107 total issues
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
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++) {
- 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 (!previous) {
previous = true;
} else {
msg.push('\n');
}
Avoid deeply nested control flow statements. Open
if (createdFromTest) {
msg.push(' (probably created in ', createdFromTest, ')');
}
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 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 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 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 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
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
Avoid too many return
statements within this function. Open
if (!isDotClassDefinition) return;
Avoid too many return
statements within this function. Open
if (!isObjectLitteral) return;
Avoid too many return
statements within this function. Open
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
return true;
Function set
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
exports.set = function (path, config) {
config = config || path;
if (typeof path === "string") {
if (!internalConfig[path]) {
internalConfig[path] = {};
- 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 onSocketData_pauseChanged
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Slave.prototype.onSocketData_pauseChanged = function (message) {
var paused = message.paused;
paused = !!paused; // makes sure it is a boolean
if (this.paused !== paused) {
this.paused = paused;
- 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"