developer239/create-opinionated-react-app

View on GitHub

Showing 13 of 20 total issues

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

export const createReactApp = async (context: IMainState) => {
  const { isCypress } = await prompt({
    name: 'isCypress',
    type: 'list',
    message: 'Do you want to use cypress?',
Severity: Major
Found in src/projects/createReactApp.ts and 1 other location - About 2 days to fix
src/projects/nextJsApp.ts on lines 14..73

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 437.

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 createNextJsApp = async (context: IMainState) => {
  const { isCypress } = await prompt({
    name: 'isCypress',
    type: 'list',
    message: 'Do you want to use cypress?',
Severity: Major
Found in src/projects/nextJsApp.ts and 1 other location - About 2 days to fix
src/projects/createReactApp.ts on lines 14..73

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 437.

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 checkYarn = async () => {
  const { code } = shell.exec('yarn --version')

  if (code !== 0) {
    logger.info(
Severity: Major
Found in src/services/dependencyCheck/yarn.ts and 1 other location - About 2 hrs to fix
src/services/dependencyCheck/npx.ts on lines 5..16

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 89.

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 checkNpx = async () => {
  const { code } = shell.exec('npx --version')

  if (code !== 0) {
    logger.info(
Severity: Major
Found in src/services/dependencyCheck/npx.ts and 1 other location - About 2 hrs to fix
src/services/dependencyCheck/yarn.ts on lines 5..16

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 89.

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

Function createNextJsApp has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const createNextJsApp = async (context: IMainState) => {
  const { isCypress } = await prompt({
    name: 'isCypress',
    type: 'list',
    message: 'Do you want to use cypress?',
Severity: Minor
Found in src/projects/nextJsApp.ts - About 1 hr to fix

    Function createReactApp has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const createReactApp = async (context: IMainState) => {
      const { isCypress } = await prompt({
        name: 'isCypress',
        type: 'list',
        message: 'Do you want to use cypress?',
    Severity: Minor
    Found in src/projects/createReactApp.ts - About 1 hr to fix

      Function initGatsby has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const initGatsby = async (context: IContext) => {
        await shell.execWithSpinner(
          `npx gatsby new ${context.projectFolder}`,
          '[gatsby] initialize',
        )
      Severity: Minor
      Found in src/packages/_Gatsby/index.ts - About 1 hr to fix

        Function addEslint has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const addEslint = async (context: IContext) => {
          const lintTs = 'eslint --ext .ts,.tsx src'
        
          await json.update('package.json')(
            {
        Severity: Minor
        Found in src/packages/eslint/index.ts - About 1 hr to fix

          Function createNestJsApp has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const createNestJsApp = async (context: IMainState) => {
            const { databaseType } = await prompt({
              name: 'databaseType',
              type: 'list',
              message: 'Do you want to use database?',
          Severity: Minor
          Found in src/projects/nestJsApp.ts - About 1 hr to fix

            Function addCypress has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const addCypress = async (context: IContext) => {
              const { ciType } = await prompt({
                name: 'ciType',
                type: 'list',
                message: 'Do you want to generate CI configuration for cypress?',
            Severity: Minor
            Found in src/packages/cypress/index.ts - About 1 hr to fix

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

                  await json.update('package.json')(
                    {
                      projectName: context.projectFolder,
                      message: '[json] adding heroku scripts',
                      messageSuccess: '[json] add heroku scripts',
              Severity: Major
              Found in src/packages/heroku/index.ts and 1 other location - About 1 hr to fix
              src/packages/heroku/index.ts on lines 16..29

              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 64.

              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

                await json.update('package.json')(
                  {
                    projectName: context.projectFolder,
                    message: '[json] adding heroku scripts',
                    messageSuccess: '[json] add heroku scripts',
              Severity: Major
              Found in src/packages/heroku/index.ts and 1 other location - About 1 hr to fix
              src/packages/heroku/index.ts on lines 44..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 64.

              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

              Function initNestJsApp has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const initNestJsApp = async (context: IContext) => {
                await shell.execWithSpinner(
                  `npx nest new ${context.projectFolder} --package-manager yarn`,
                  '[nest.js] initialize',
                )
              Severity: Minor
              Found in src/packages/_NestJs/index.ts - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language