Showing 187 of 269 total issues
Consider simplifying this complex logical expression. Open
if (!broccoliPayload.error) {
let originalError = broccoliPayload.originalError || {};
let location = broccoliPayload.location || originalError.location;
broccoliPayload.error = {
message: originalError.message,
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (hasOptions) {
let indent = `\n `;
let outdent = `\n `;
blueprintOptions =
- Create a ticketCreate a ticket
Function load
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Blueprint.load = function (blueprintPath, blueprintOptions) {
if (fs.lstatSync(blueprintPath).isDirectory()) {
let Constructor = Blueprint;
let constructorPath = path.resolve(blueprintPath, 'index.js');
- Read upRead up
- Create a ticketCreate a ticket
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 locals
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
locals(options) {
let entity = options.entity;
let rawName = entity.name;
let name = stringUtil.dasherize(rawName);
let namespace = stringUtil.classify(rawName);
- Read upRead up
- Create a ticketCreate a ticket
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 checkYarn
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async checkYarn() {
try {
let result = await this.yarn(['--version']);
let version = result.stdout;
- Read upRead up
- Create a ticketCreate a ticket
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 hasDependencies
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
hasDependencies() {
if (this.cli.disableDependencyChecker) {
// Blueprint tests set this flag.
return true;
}
- Read upRead up
- Create a ticketCreate a ticket
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 dumpInvalidAddonPackages
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
dumpInvalidAddonPackages(addonPackageList) {
if (this._hasDumpedInvalidAddonPackages) {
return;
}
this._hasDumpedInvalidAddonPackages = true;
- Read upRead up
- Create a ticketCreate a ticket
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 run
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async run(options) {
let hasBuild = !!options.path;
if (hasBuild) {
if (!fs.existsSync(options.path)) {
- Read upRead up
- Create a ticketCreate a ticket
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 startHttpServer
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async startHttpServer() {
this.app = this.express();
const compression = require('compression');
this.app.use(
compression({
- Read upRead up
- Create a ticketCreate a ticket
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 _generateTestPortNumber
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async _generateTestPortNumber(options, ui) {
if (options.testPort === defaultPort && !options.port) {
let foundPort = await getPort({ port: options.testPort });
if (options.testPort !== foundPort) {
- Read upRead up
- Create a ticketCreate a ticket
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 _generateCustomConfigs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_generateCustomConfigs(options) {
let config = {};
if (!options.filter && !options.module && !options.launch && !options.query && !options['test-page']) {
return config;
}
- Read upRead up
- Create a ticketCreate a ticket
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 run
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
run(commandOptions, rawArgs) {
let blueprintName = rawArgs[0];
let entityName = rawArgs[1];
if (!blueprintName) {
- Read upRead up
- Create a ticketCreate a ticket
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 'app';
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return false;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return experimentValue !== 'false';
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return experimentValue !== undefined && experimentValue !== 'false';
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return Reflect.get(targetCacheEntry[TARGET_INSTANCE], property);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return !!(
addonCtorOrInstance.prototype.options.lazyLoading &&
addonCtorOrInstance.prototype.options.lazyLoading.enabled === true
);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return Reflect.get(targetCacheEntry, property);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return addonInstance;
- Create a ticketCreate a ticket