Showing 91 of 172 total issues
Avoid too many return
statements within this function. Open
if (url?.startsWith('mysql://') || url?.startsWith('mariadb://')) return 'mysql';
Avoid too many return
statements within this function. Open
return dbDialect;
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return undefined;
Function parseMsSql
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
parseMsSql() {
// Remove wrapping parentheses
while (/^\(.*\)$/.test(this.expression)) {
this.expression = this.expression.substr(1, this.expression.length - 2);
}
- 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 writeDockerCompose
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
writeDockerCompose(config) {
const databaseUrl = `\${${this.isLinuxOs ? 'DATABASE_URL' : 'DOCKER_DATABASE_URL'}}`;
const forestUrl = this.env.FOREST_URL_IS_DEFAULT
? false
: `\${FOREST_URL-${this.env.FOREST_SERVER_URL}}`;
- 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 createFiles
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async createFiles(config, schema) {
const { isUpdate, useMultiDatabase, modelsExportPath } = config.appConfig;
await this.mkdirp(`${this.projectPath}/routes`);
await this.mkdirp(`${this.projectPath}/forest`);
- 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 connectToSequelize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
connectToSequelize(databaseDialect, options, isSSL) {
let connectionOptionsSequelize = options.connectionOptions;
if (!connectionOptionsSequelize) {
connectionOptionsSequelize = {};
- 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 handleDatabaseUrlConfiguration
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async handleDatabaseUrlConfiguration() {
if (this.environmentVariables.projectOrigin !== 'In-app') {
const isDatabaseAlreadyConfigured = !!this.env.DATABASE_URL;
if (!isDatabaseAlreadyConfigured) {
- 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 getDialect
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function getDialect(options: ProjectCreateOptions): ProjectCreateOptions['databaseDialect'] {
const { databaseDialect: dialect, databaseConnectionURL: url } = options;
if (dialect) return dialect;
if (url?.startsWith('postgres://')) return 'postgres';
- 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 ProjectManager
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function ProjectManager(config) {
const { assertPresent, authenticator, env, jwtDecode, lodash } = Context.inject();
assertPresent({ authenticator, env, jwtDecode, lodash });
function deserialize(response) {
- 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"