Showing 58 of 74 total issues
Avoid deeply nested control flow statements. Open
if (maybeRoute) {
routeName = possibleRouteName;
break;
} else {
if (paths.length === 0) {
Function onFileRequested
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function onFileRequested(req, res) {
var appFileName = req.params.name.split('---').join('/');
if (!appFileName.endsWith('.js')) {
return res.status(404).send('Not found');
}
- 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 initialize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function initialize(appInstance) {
let hotLoadService = lookup(appInstance, 'service:hot-loader');
if (!hotLoadService) {
return;
}
- 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 findEntypointFile
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function findEntypointFile(
fileName,
lookupFolder = ['dist', 'assets', ''].join(path.sep)
) {
if (lookupFolder.charAt(lookupFolder.length - 1) !== path.sep) {
- 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 _getTemplateCompilerPath
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_getTemplateCompilerPath() {
if (this._OPTIONS && this._OPTIONS['templateCompilerPath']) {
return this._OPTIONS['templateCompilerPath'];
}
const npmCompilerPath = path.join(
- 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 hotLoader.placeholderComponentName();
Avoid too many return
statements within this function. Open
return renderComponentName;
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
return node;
Avoid too many return
statements within this function. Open
return this.reloadWindow();
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return hotLoader.renderDynamicComponentHelper(
name,
context,
maybePropertyValue
);
Avoid too many return
statements within this function. Open
return false;
Function _scopedComponentNames
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_scopedComponentNames(name, scope) {
const closestRelativeName = []
.concat(this.muScopedComponents, this.currentRouteComponents())
.filter((resolvedName) => resolvedName.endsWith(name))
.pop();
- 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 clearRequirejsCache
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function clearRequirejsCache(context, componentName) {
const owner = getOwner(context);
const config = owner.resolveRegistration('config:environment');
const modulePrefix = get(config, 'modulePrefix') || 'dummy';
- 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 _ensureFindHost
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_ensureFindHost() {
if (!this._findHost) {
this._findHost = function findHostShim() {
let current = this;
let app;
- 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"