Showing 87 of 107 total issues
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 buildNameFromConfig
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
var buildNameFromConfig = function (config) {
if (config.displayAs) {
return config.displayAs;
}
- 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
TestEnumerator.prototype._addResult = function (testInfo, res) {
var classpath = testInfo.name;
var testSuite = res.testSuite;
var error = res.error;
if (error) {
- 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 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 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"
Further reading
Function resolvePath
has a Cognitive Complexity of 6 (exceeds 5 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);
- 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"