Showing 91 of 172 total issues
Function createFiles
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected async createFiles(dumpConfig: Config, mongoSchema?: any) {
this.writePackageJson(
dumpConfig.language,
dumpConfig.dbConfig.dbDialect,
dumpConfig.appConfig.appName,
Function check
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.check = async jobId => {
try {
const jobResponse = await agent
.get(`${env.FOREST_SERVER_URL}/api/jobs/${jobId}`)
.set('Authorization', `Bearer ${authenticator.getAuthToken()}`)
Function runAuthenticated
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
async runAuthenticated() {
const parsed = await this.parse(SetOriginCommand);
const envSecret = this.env.FOREST_ENV_SECRET;
const commandOptions = { ...parsed.flags, ...parsed.args, envSecret };
let config;
Function notifySuccess
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
async notifySuccess() {
if (
!this.applicationName ||
!this.command ||
!this.sessionToken ||
Function analyzeFields
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function analyzeFields(queryInterface, tableName, config) {
const dialect = queryInterface.sequelize.getDialect();
let columnsByName;
// Workaround bug in sequelize/dialects/mysql/query-generator#describe
Function writeTsConfigJson
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
writeTsConfigJson() {
this.writeFile(
'tsconfig.json',
`${JSON.stringify(
{
Function render
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
render(environment, config) {
const table = new this.Table({
chars,
});
- 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 parseGeneric
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
parseGeneric() {
const nulls = ['NULL'];
const falses = ['false', 'FALSE', "b'0'", '((0))'];
const trues = ['true', 'TRUE', "b'1'", '((1))'];
const isDate = ['TIMESTAMP', 'DATETIME', 'DATE', 'TIME'];
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
getDialect(dbConnectionUrl, dbDialect) {
if (dbConnectionUrl) {
if (dbConnectionUrl.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 runAuthenticated
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
async runAuthenticated() {
try {
const config = await this.getConfig();
const branches = (await BranchManager.getBranches(config.envSecret)) || [];
- 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 optionToInquirer
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function optionToInquirer(name: string, option: CommandOptions[string]): unknown {
const { os } = inject() as any; // eslint-disable-line @typescript-eslint/no-explicit-any
// Use rawlist on windows because of https://github.com/SBoudrias/Inquirer.js/issues/303
const listType = /^win/.test(os.platform()) ? 'rawlist' : 'list';
- 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 runAuthenticated
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
async runAuthenticated() {
const parsed = await this.parse(PushCommand);
const envSecret = this.env.FOREST_ENV_SECRET;
const commandOptions = { ...parsed.flags, ...parsed.args, envSecret };
let 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 TableConstraintsGetter
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function TableConstraintsGetter(databaseConnection, schema) {
const queryInterface = databaseConnection.getQueryInterface();
this.perform = async table => {
let query = 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 runAuthenticated
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
async runAuthenticated() {
const parsed = await this.parse(CreateCommand);
const config = await withCurrentProject({ ...this.env, ...parsed.flags });
const manager = new EnvironmentManager(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 createReference
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
tableName,
existingsReferences,
association,
foreignKey,
manyToManyForeignKey,
Function runAuthenticated
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async runAuthenticated() {
const parsed = await this.parse(BranchCommand);
const envSecret = this.env.FOREST_ENV_SECRET;
const commandOptions = { ...parsed.flags, ...parsed.args, envSecret };
let 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 writePackageJson
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
writePackageJson(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
Function notifyError
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async notifyError(code = 'unknown_error', message = null, context = undefined) {
if (!this.applicationName || !this.command) {
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 _logLine
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_logLine(message, options) {
if (this.silent) return;
options = {
...DEFAULT_OPTION_VALUES,
- 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"