pankod/pankod-cli

View on GitHub

Showing 60 of 78 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    const replaceContentParams: ICommon.IReplaceContent = {
        fileDir: IAddRoutesReplaceParams.routesDir,
        filetoUpdate: fs.readFileSync(
            path.resolve('', IAddRoutesReplaceParams.routesDir),
            'utf8'
src/modules/element-factory/workbenches/tasks/nextjs2/addRoute.task.ts on lines 23..35

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 114.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    const replaceContentParams: ICommon.IReplaceContent = {
        fileDir: IAddRoutesReplaceParams.routesDir,
        filetoUpdate: fs.readFileSync(
            path.resolve('', IAddRoutesReplaceParams.routesDir),
            'utf8'
src/modules/element-factory/workbenches/tasks/nextjs/addRoute.task.ts on lines 23..35

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 114.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export const createFuncComponentParams: INextjs2Helper.ICreateFuncComponentParams = {
    templatePath: paths.nextjs2.templates.funcComponentTemplate,
    indexTemplatePath: paths.nextjs2.templates.componentIndexTemplatePath,
    componentsDir: paths.nextjs2.componentsDir,
    createInterfaceParams,
src/modules/element-factory/workbenches/params/nextjs2.params.ts on lines 39..47

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 100.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export const createClassComponentParams: INextjs2Helper.ICreateClassComponentParams = {
    templatePath: paths.nextjs2.templates.classComponentTemplatePath,
    indexTemplatePath: paths.nextjs2.templates.componentIndexTemplatePath,
    componentsDir: paths.nextjs2.componentsDir,
    createInterfaceParams,
src/modules/element-factory/workbenches/params/nextjs2.params.ts on lines 49..57

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 100.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

    const replaceReducerContentParams: ICommon.IReplaceContent = {
        fileDir: `${nextjs2.reducerDir}/index.ts`,
        filetoUpdate: fs.readFileSync(
            path.resolve('', `${nextjs2.reducerDir}/index.ts`),
            'utf8'
src/modules/element-factory/workbenches/tasks/nextjs/addActionConstIndex.task.ts on lines 18..28
src/modules/element-factory/workbenches/tasks/nextjs/addReducer.task.ts on lines 33..43
src/modules/element-factory/workbenches/tasks/nextjs/addReducer.task.ts on lines 55..66
src/modules/element-factory/workbenches/tasks/nextjs2/addReducer.task.ts on lines 35..45

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

        const replaceReducerContentParams: ICommon.IReplaceContent = {
            fileDir: `${nextjs.reducerDir}/index.ts`,
            filetoUpdate: fs.readFileSync(
                path.resolve('', `${nextjs.reducerDir}/index.ts`),
                'utf8'
src/modules/element-factory/workbenches/tasks/nextjs/addActionConstIndex.task.ts on lines 18..28
src/modules/element-factory/workbenches/tasks/nextjs/addReducer.task.ts on lines 33..43
src/modules/element-factory/workbenches/tasks/nextjs2/addReducer.task.ts on lines 35..45
src/modules/element-factory/workbenches/tasks/nextjs2/addReducer.task.ts on lines 66..77

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

    const replaceContentParams: ICommon.IReplaceContent = {
        fileDir: `${nextjs.definitionsDir}/ActionConsts.ts`,
        filetoUpdate: fs.readFileSync(
            path.resolve('', `${nextjs.definitionsDir}/ActionConsts.ts`),
            'utf8'
src/modules/element-factory/workbenches/tasks/nextjs/addReducer.task.ts on lines 33..43
src/modules/element-factory/workbenches/tasks/nextjs/addReducer.task.ts on lines 55..66
src/modules/element-factory/workbenches/tasks/nextjs2/addReducer.task.ts on lines 35..45
src/modules/element-factory/workbenches/tasks/nextjs2/addReducer.task.ts on lines 66..77

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

    const replaceContentParams: ICommon.IReplaceContent = {
        fileDir: `${nextjs2.reducerDir}/index.ts`,
        filetoUpdate: fs.readFileSync(
            path.resolve('', `${nextjs2.reducerDir}/index.ts`),
            'utf8'
src/modules/element-factory/workbenches/tasks/nextjs/addActionConstIndex.task.ts on lines 18..28
src/modules/element-factory/workbenches/tasks/nextjs/addReducer.task.ts on lines 33..43
src/modules/element-factory/workbenches/tasks/nextjs/addReducer.task.ts on lines 55..66
src/modules/element-factory/workbenches/tasks/nextjs2/addReducer.task.ts on lines 66..77

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

    const replaceContentParams: ICommon.IReplaceContent = {
        fileDir: `${nextjs.reducerDir}/index.ts`,
        filetoUpdate: fs.readFileSync(
            path.resolve('', `${nextjs.reducerDir}/index.ts`),
            'utf8'
src/modules/element-factory/workbenches/tasks/nextjs/addActionConstIndex.task.ts on lines 18..28
src/modules/element-factory/workbenches/tasks/nextjs/addReducer.task.ts on lines 55..66
src/modules/element-factory/workbenches/tasks/nextjs2/addReducer.task.ts on lines 35..45
src/modules/element-factory/workbenches/tasks/nextjs2/addReducer.task.ts on lines 66..77

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export const createTest = (options: ICommon.ICreateTest): void => {
    const writeFileProps: ICommon.IWriteFile = {
        dirPath: options.dirPath,
        getFileContent: () =>
            getTemplate(options.templatePath, options),
src/modules/element-factory/workbenches/tasks/moleculer/createIntegrationTest.task.ts on lines 6..15

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 92.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export const createIntegrationTest = (options: ICommon.ICreateTest): void => {
    const integrationProps: ICommon.IWriteFile = {
        dirPath: options.dirPath,
        getFileContent: () =>
            getTemplate(options.templatePath, options),
src/modules/element-factory/workbenches/tasks/moleculer/createTest.task.ts on lines 6..15

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 92.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    templates: {
        addRouteTemplate: './lib/Templates/nextjs/Routes.mustache',
        compInterfaceIndex: './lib/Templates/nextjs/Interfaces/ComponentIndex.mustache',
        createInterfaceTempPath: './lib/Templates/nextjs/Interfaces/Component.mustache',
        pageInterfaceIndex: './lib/Templates/nextjs/Interfaces/PageIndex.mustache',
Severity: Major
Found in src/modules/paths/nextjs.paths.ts and 1 other location - About 2 hrs to fix
src/modules/paths/moleculer.paths.ts on lines 12..38

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 91.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    templates: {
        brokerHelperCreate: './lib/Templates/moleculer/Tests/BrokerHelperCreate.mustache',
        brokerHelperImport: './lib/Templates/moleculer/Tests/BrokerHelperImport.mustache',
        createEntityIndexTemplate:
            './lib/Templates/moleculer/Repositories/EntityIndex.mustache',
Severity: Major
Found in src/modules/paths/moleculer.paths.ts and 1 other location - About 2 hrs to fix
src/modules/paths/nextjs.paths.ts on lines 17..35

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 91.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

export const entityName: inquirer.InputQuestion<ICommon.IAnswers> = {
    message: 'Enter entity name',
    name: 'fileName',
    type: 'input',
    validate(val: string): string | boolean {
src/modules/henchman/suitcase/questions/moleculer/service.question.ts on lines 12..19
src/modules/henchman/suitcase/questions/nextjs/page.question.ts on lines 12..19
src/modules/henchman/suitcase/questions/nextjs2/enterComponentName.question.ts on lines 12..19
src/modules/henchman/suitcase/questions/nextjs2/enterPageName.question.ts on lines 12..19
src/modules/henchman/suitcase/questions/svelte/component.question.ts on lines 12..19

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 86.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

export const enterComponentName: inquirer.InputQuestion<ICommon.IAnswers> = {
    message: 'Enter component name',
    name: 'fileName',
    type: 'input',
    validate(val: string): string | boolean {
src/modules/henchman/suitcase/questions/moleculer/entity.question.ts on lines 12..19
src/modules/henchman/suitcase/questions/moleculer/service.question.ts on lines 12..19
src/modules/henchman/suitcase/questions/nextjs/page.question.ts on lines 12..19
src/modules/henchman/suitcase/questions/nextjs2/enterPageName.question.ts on lines 12..19
src/modules/henchman/suitcase/questions/svelte/component.question.ts on lines 12..19

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 86.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

export const componentName: inquirer.InputQuestion<ICommon.IAnswers> = {
    message: 'Enter component name',
    name: 'fileName',
    type: 'input',
    validate(val: string): string | boolean {
src/modules/henchman/suitcase/questions/moleculer/entity.question.ts on lines 12..19
src/modules/henchman/suitcase/questions/moleculer/service.question.ts on lines 12..19
src/modules/henchman/suitcase/questions/nextjs/page.question.ts on lines 12..19
src/modules/henchman/suitcase/questions/nextjs2/enterComponentName.question.ts on lines 12..19
src/modules/henchman/suitcase/questions/nextjs2/enterPageName.question.ts on lines 12..19

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 86.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

export const enterPageName: inquirer.InputQuestion<ICommon.IAnswers> = {
    message: 'Enter page name',
    name: 'fileName',
    type: 'input',
    validate(val: string): string | boolean {
src/modules/henchman/suitcase/questions/moleculer/entity.question.ts on lines 12..19
src/modules/henchman/suitcase/questions/moleculer/service.question.ts on lines 12..19
src/modules/henchman/suitcase/questions/nextjs2/enterComponentName.question.ts on lines 12..19
src/modules/henchman/suitcase/questions/nextjs2/enterPageName.question.ts on lines 12..19
src/modules/henchman/suitcase/questions/svelte/component.question.ts on lines 12..19

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 86.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

export const serviceName: inquirer.InputQuestion<ICommon.IAnswers> = {
    message: 'Enter service name',
    name: 'fileName',
    type: 'input',
    validate(val: string): string | boolean {
src/modules/henchman/suitcase/questions/moleculer/entity.question.ts on lines 12..19
src/modules/henchman/suitcase/questions/nextjs/page.question.ts on lines 12..19
src/modules/henchman/suitcase/questions/nextjs2/enterComponentName.question.ts on lines 12..19
src/modules/henchman/suitcase/questions/nextjs2/enterPageName.question.ts on lines 12..19
src/modules/henchman/suitcase/questions/svelte/component.question.ts on lines 12..19

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 86.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

export const enterPageName: inquirer.InputQuestion<ICommon.IAnswers> = {
    message: 'Enter page name',
    name: 'fileName',
    type: 'input',
    validate(val: string): string | boolean {
src/modules/henchman/suitcase/questions/moleculer/entity.question.ts on lines 12..19
src/modules/henchman/suitcase/questions/moleculer/service.question.ts on lines 12..19
src/modules/henchman/suitcase/questions/nextjs/page.question.ts on lines 12..19
src/modules/henchman/suitcase/questions/nextjs2/enterComponentName.question.ts on lines 12..19
src/modules/henchman/suitcase/questions/svelte/component.question.ts on lines 12..19

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 86.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    if (isPage) {
        options.classDir = `${nextjs2.pagesDir}/${lowerFileName}`;

        const addRouteParams = {
            routesDir: nextjs2.routesDir,
src/modules/element-factory/workbenches/tasks/nextjs2/createFuncComponent.task.ts on lines 34..53

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 70.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language