Showing 53 of 79 total issues
Function handleSchema
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
handleSchema() {
if (this.isOptionRequested('dbSchema')) {
this.envConfig.dbSchema = this.program.schema;
if (!this.envConfig.dbSchema) {
this.prompts.push({
- 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 parse
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
parse() {
if (this.expression === null || this.expression === undefined) {
return null;
}
- 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 createReference
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
tableName,
existingsReferences,
association,
foreignKey,
manyToManyForeignKey,
Function loginWithGoogle
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async loginWithGoogle(email) {
const endpoint = process.env.FOREST_URL && process.env.FOREST_URL.includes('localhost')
? 'http://localhost:4200' : 'https://app.forestadmin.com';
const url = this.chalk.cyan.underline(`${endpoint}/authentication-token`);
this.logger.info(`To authenticate with your Google account, please follow this link and copy the authentication token: ${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 getDatabaseUrl
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
static getDatabaseUrl(config) {
let connectionString;
if (config.dbConnectionUrl) {
connectionString = config.dbConnectionUrl;
- 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 handleEmail
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
handleEmail() {
if (this.isOptionRequested('email')) {
this.envConfig.email = this.program.email;
if (!this.envConfig.email) {
- 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 dump
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async dump(schema, config) {
const cwd = process.cwd();
const projectPath = config.appName ? `${cwd}/${config.appName}` : cwd;
const { isUpdate, useMultiDatabase, modelsExportPath } = config;
- 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 ProjectCreator
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function ProjectCreator(sessionToken) {
this.createProject = async (projectName, config) => {
try {
const newProject = await api.createProject(config, sessionToken, { name: projectName });
- 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 loginFromCommandLine
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async loginFromCommandLine(config) {
const { email, token } = config;
let sessionToken;
try {
sessionToken = token || this.fs.readFileSync(this.pathToLumberrc, { encoding: 'utf8' });
- 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 writePackageJson
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
writePackageJson(projectPath, { dbDialect, appName }) {
const orm = dbDialect === 'mongodb' ? 'mongoose' : 'sequelize';
const dependencies = {
'body-parser': '1.19.0',
chalk: '~1.1.3',
- 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 dbDialect;
Function connnectToSequelize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
connnectToSequelize(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 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"