domjtalbot/nx-mesh

View on GitHub

Showing 553 of 553 total issues

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

export default {
  displayName: 'examples-sdk-neo4j-movies',
  preset: '../../jest.preset.js',
  testEnvironment: 'node',
  transform: {
Severity: Major
Found in examples/sdk-neo4j--movies/jest.config.ts and 5 other locations - About 1 hr to fix
examples/sdk-graphql--star-wars/jest.config.ts on lines 2..14
examples/sdk-json-schema--fake-api/jest.config.ts on lines 2..14
examples/sdk-mysql--rfam/jest.config.ts on lines 2..14
examples/sdk-openapi--javascript-wiki/jest.config.ts on lines 2..14
examples/sdk-soap--country-info/jest.config.ts on lines 2..14

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

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

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

      childProcess?.stderr?.on('data', (chunk) => {
        if (
          chunk.toString().indexOf('Transformed schema is not set yet') <= -1 ||
          options.debug
        ) {
Severity: Major
Found in packages/nx-mesh/src/executors/build-swc/build-swc.ts and 1 other location - About 1 hr to fix
packages/nx-mesh/src/executors/build/build.ts on lines 51..58

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

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

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

      childProcess?.stderr?.on('data', (chunk) => {
        if (
          chunk.toString().indexOf('Transformed schema is not set yet') <= -1 ||
          options.debug
        ) {
Severity: Major
Found in packages/nx-mesh/src/executors/build/build.ts and 1 other location - About 1 hr to fix
packages/nx-mesh/src/executors/build-swc/build-swc.ts on lines 51..58

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

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 addJest has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export async function addJest(host: Tree, options: NormalizedOptions) {
  if (options.unitTestRunner !== 'jest') {
    // eslint-disable-next-line @typescript-eslint/no-empty-function
    return () => {};
  }
Severity: Minor
Found in packages/nx-mesh/src/generators/base/lib/add-jest.ts - About 1 hr to fix

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

      runMeshCli(
        'dev',
        {
          args: {
            dir: resolve(context.root, options.dir),
    Severity: Major
    Found in packages/nx-mesh/src/executors/dev/dev.ts and 1 other location - About 1 hr to fix
    packages/nx-mesh/src/executors/start/start.ts on lines 24..40

    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

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

      runMeshCli(
        'start',
        {
          args: {
            dir: resolve(context.root, options.dir),
    Severity: Major
    Found in packages/nx-mesh/src/executors/start/start.ts and 1 other location - About 1 hr to fix
    packages/nx-mesh/src/executors/dev/dev.ts on lines 20..36

    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

    Function default has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default async function (tree: Tree) {
      let changesMade = false;
      const projects = getProjects(tree);
    
      forEachExecutorOptions(

      Function normalizeOptions has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function normalizeOptions(
        options: SwcExecutorOptions,
        contextRoot: string,
        sourceRoot?: string,
        projectRoot?: string
      Severity: Minor
      Found in packages/nx-mesh/src/executors/build-swc/swc-executor/swc.impl.ts - About 1 hr to fix

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

        export async function* startExecutor(
          options: StartExecutorSchema,
          context: ExecutorContext
        ) {
          if (options.dir === undefined) {
        Severity: Minor
        Found in packages/nx-mesh/src/executors/start/start.ts - About 1 hr to fix

          Function createPackageJson has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export async function createPackageJson(
            options: {
              dir: string;
              outputPath: string;
              projectRoot?: string;
          Severity: Minor
          Found in packages/nx-mesh/src/utils/create-package-json.ts - About 1 hr to fix

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

            describe('CountryIfno', () => {
              it('should render successfully', () => {
                const { baseElement } = render(<TrippinRoute {...exampleData} />);
            
                expect(baseElement).toBeTruthy();
            Severity: Major
            Found in examples/sdk-nextjs/specs/sources/odata/trippin.spec.tsx and 2 other locations - About 1 hr to fix
            examples/sdk-nextjs/specs/sources/openapi/javascript-wiki.spec.tsx on lines 8..14
            examples/sdk-nextjs/specs/sources/soap/country-info.spec.tsx on lines 8..14

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

            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 3 locations. Consider refactoring.
            Open

            describe('CountryIfno', () => {
              it('should render successfully', () => {
                const { baseElement } = render(<JavascriptWikiRoute {...exampleData} />);
            
                expect(baseElement).toBeTruthy();
            examples/sdk-nextjs/specs/sources/odata/trippin.spec.tsx on lines 8..14
            examples/sdk-nextjs/specs/sources/soap/country-info.spec.tsx on lines 8..14

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

            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 3 locations. Consider refactoring.
            Open

            describe('CountryIfno', () => {
              it('should render successfully', () => {
                const { baseElement } = render(<CountryInfoRoute {...exampleData} />);
            
                expect(baseElement).toBeTruthy();
            examples/sdk-nextjs/specs/sources/odata/trippin.spec.tsx on lines 8..14
            examples/sdk-nextjs/specs/sources/openapi/javascript-wiki.spec.tsx on lines 8..14

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

            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 devExecutor has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export async function* devExecutor(
              options: DevExecutorSchema,
              context: ExecutorContext
            ) {
              const { baseUrl, port } = await getServeLocation(options);
            Severity: Minor
            Found in packages/nx-mesh/src/executors/dev/dev.ts - About 1 hr to fix

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

              describe('soap/country-info', () => {
                beforeEach(() => cy.visit('/sources/soap/country-info'));
              
                it('should display daily forecast', () => {
                  cy.get('[data-language]').should('have.length.greaterThan', 0);
              examples/sdk-nextjs-e2e/src/e2e/sources/odata/trippin.cy.ts on lines 1..7
              examples/sdk-nextjs-e2e/src/e2e/sources/openapi/javascript-wiki.cy.ts on lines 1..7

              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 3 locations. Consider refactoring.
              Open

              describe('odata/trippin', () => {
                beforeEach(() => cy.visit('/sources/odata/trippin'));
              
                it('should display airports', () => {
                  cy.get('[data-airport]').should('have.length.greaterThan', 0);
              examples/sdk-nextjs-e2e/src/e2e/sources/openapi/javascript-wiki.cy.ts on lines 1..7
              examples/sdk-nextjs-e2e/src/e2e/sources/soap/country-info.cy.ts on lines 1..7

              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

              export default {
                displayName: 'examples-sdk-odata-trippin',
                preset: '../../jest.preset.js',
                globals: {
                  'ts-jest': {
              Severity: Major
              Found in examples/sdk-odata--trippin/jest.config.ts and 1 other location - About 1 hr to fix
              examples/sdk-openapi--stackexchange/jest.config.ts on lines 2..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 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 3 locations. Consider refactoring.
              Open

              describe('openapi/javascript-wiki', () => {
                beforeEach(() => cy.visit('/sources/openapi/javascript-wiki'));
              
                it('should display wiki data', () => {
                  cy.get('[data-wiki]').should('have.length.greaterThan', 0);
              examples/sdk-nextjs-e2e/src/e2e/sources/odata/trippin.cy.ts on lines 1..7
              examples/sdk-nextjs-e2e/src/e2e/sources/soap/country-info.cy.ts on lines 1..7

              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

              export default {
                displayName: 'examples-sdk-openapi-stackexchange',
                preset: '../../jest.preset.js',
                globals: {
                  'ts-jest': {
              Severity: Major
              Found in examples/sdk-openapi--stackexchange/jest.config.ts and 1 other location - About 1 hr to fix
              examples/sdk-odata--trippin/jest.config.ts on lines 2..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 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 buildExecutor has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default async function* buildExecutor(
                options: BuildGatewayExecutorSchema,
                context: ExecutorContext
              ) {
                if (options.dir === undefined) {
              Severity: Minor
              Found in packages/nx-mesh/src/executors/build-gateway/build-gateway.ts - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language