Showing 187 of 269 total issues
Avoid too many return
statements within this function. Open
return [];
- 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 getAddonProxy(addonCacheEntry, parent);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return 'dependencies';
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return () => undefined;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return targetCacheEntry[TARGET_INSTANCE];
- 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 false;
- 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 class extends UnknownCommand {
constructor(options) {
super(options);
this.name = commandName;
}
- Create a ticketCreate a ticket
Function confirmOverwrite
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
confirmOverwrite(path) {
let promptOptions = {
type: 'expand',
name: 'answer',
default: false,
- 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 _getAssetPath
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_getAssetPath(asset) {
/* @type {String} */
let assetPath;
if (typeof asset !== 'object') {
- 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 getBodyMsg
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function getBodyMsg(langArg) {
return isValidCodeAndProg(langArg)
? getValidAndProgMsg(langArg)
: isProgLang(langArg)
? getProgLangMsg(langArg)
- 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 formatPackageList
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function formatPackageList(packages) {
if (Array.isArray(packages)) {
if (packages.length === 1) {
return packages[0];
} else if (packages.length === 2) {
- 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 setupMiddleware
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
setupMiddleware(options) {
const tinylr = require('tiny-lr');
const Server = tinylr.Server;
if (options.liveReloadPrefix) {
- 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 parseArgs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
parseArgs(commandArgs) {
let knownOpts = {}; // Parse options
let commandOptions = {};
let parsedOptions;
- 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 shouldHandleRequest
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
shouldHandleRequest(req, options) {
let acceptHeaders = req.headers.accept || [];
let hasHTMLHeader = acceptHeaders.indexOf('text/html') !== -1;
if (req.method !== 'GET') {
return false;
- 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 isValidParsedOption
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function isValidParsedOption(option, parsedOption) {
// option.name didn't parse
if (parsedOption === undefined) {
// no default
if (option.default === undefined) {
- 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 _checkInRepoAddonExists
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_checkInRepoAddonExists(options) {
let addon;
if (options.inRepoAddon) {
addon = findAddonByName(this.project, options.inRepoAddon);
- 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 constructor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
constructor(options) {
let optionTokens = (options && options.tokens) || {};
let renderStyles = (options && options.renderStyles) || chalk;
let tokens = this.generateTokens(renderStyles);
let markdownOptions = (options && options.markdownOptions) || {};
- 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"