spherehq/sphere

View on GitHub

Showing 214 of 214 total issues

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

export type AccountSubscriptionPayload = {
  readonly mutation: MutationType
  readonly node?: Maybe<Account>
  readonly updatedFields?: Maybe<ReadonlyArray<Scalars['String']>>
  readonly previousValues?: Maybe<AccountPreviousValues>
Severity: Major
Found in packages/api/src/types.ts and 7 other locations - About 2 hrs to fix
packages/api/src/types.ts on lines 469..474
packages/api/src/types.ts on lines 1056..1061
packages/api/src/types.ts on lines 1294..1299
packages/api/src/types.ts on lines 1931..1936
packages/api/src/types.ts on lines 2102..2107
packages/api/src/types.ts on lines 2267..2272
packages/api/src/types.ts on lines 2544..2549

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

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

export type PostMetadataSubscriptionPayload = {
  readonly mutation: MutationType
  readonly node?: Maybe<PostMetadata>
  readonly updatedFields?: Maybe<ReadonlyArray<Scalars['String']>>
  readonly previousValues?: Maybe<PostMetadataPreviousValues>
Severity: Major
Found in packages/api/src/types.ts and 7 other locations - About 2 hrs to fix
packages/api/src/types.ts on lines 134..139
packages/api/src/types.ts on lines 469..474
packages/api/src/types.ts on lines 1294..1299
packages/api/src/types.ts on lines 1931..1936
packages/api/src/types.ts on lines 2102..2107
packages/api/src/types.ts on lines 2267..2272
packages/api/src/types.ts on lines 2544..2549

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

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

export const isMutation = (obj: { __typename: String }): obj is Mutation => {
  if (!obj.__typename) throw new Error('__typename is missing')
  return Mutation_possibleTypes.includes(obj.__typename)
}
Severity: Major
Found in packages/api/client/generated/schema.ts and 6 other locations - About 1 hr to fix
packages/api/client/generated/schema.ts on lines 700..703
packages/api/client/generated/schema.ts on lines 706..709
packages/api/client/generated/schema.ts on lines 712..715
packages/api/client/generated/schema.ts on lines 718..721
packages/api/client/generated/schema.ts on lines 724..727
packages/api/client/generated/schema.ts on lines 730..733

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

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

export const isMedia = (obj: { __typename: String }): obj is Media => {
  if (!obj.__typename) throw new Error('__typename is missing')
  return Media_possibleTypes.includes(obj.__typename)
}
Severity: Major
Found in packages/api/client/generated/schema.ts and 6 other locations - About 1 hr to fix
packages/api/client/generated/schema.ts on lines 700..703
packages/api/client/generated/schema.ts on lines 706..709
packages/api/client/generated/schema.ts on lines 718..721
packages/api/client/generated/schema.ts on lines 724..727
packages/api/client/generated/schema.ts on lines 730..733
packages/api/client/generated/schema.ts on lines 736..739

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

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

export const isQuery = (obj: { __typename: String }): obj is Query => {
  if (!obj.__typename) throw new Error('__typename is missing')
  return Query_possibleTypes.includes(obj.__typename)
}
Severity: Major
Found in packages/api/client/generated/schema.ts and 6 other locations - About 1 hr to fix
packages/api/client/generated/schema.ts on lines 706..709
packages/api/client/generated/schema.ts on lines 712..715
packages/api/client/generated/schema.ts on lines 718..721
packages/api/client/generated/schema.ts on lines 724..727
packages/api/client/generated/schema.ts on lines 730..733
packages/api/client/generated/schema.ts on lines 736..739

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

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

      <Box
        width={{ xs: 1, md: 1, lg: '60%' }}
        order={{ xs: 2, md: 2, lg: 1 }}
        pt={{ xs: 8, md: 0, lg: 0 }}
      >
Severity: Major
Found in packages/platform/src/pages/index.tsx and 3 other locations - About 1 hr to fix
packages/platform/src/pages/index.tsx on lines 258..297
packages/platform/src/pages/index.tsx on lines 458..543
packages/platform/src/pages/index.tsx on lines 544..579

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

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

      <Box
        width={{ xs: 1, md: 1, lg: '40%' }}
        pt={{ xs: 0, md: 0, lg: 6 }}
        order={{ xs: 1, md: 1, lg: 2 }}
      >
Severity: Major
Found in packages/platform/src/pages/index.tsx and 3 other locations - About 1 hr to fix
packages/platform/src/pages/index.tsx on lines 258..297
packages/platform/src/pages/index.tsx on lines 344..441
packages/platform/src/pages/index.tsx on lines 458..543

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

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

export const isPostMetadata = (obj: { __typename: String }): obj is PostMetadata => {
  if (!obj.__typename) throw new Error('__typename is missing')
  return PostMetadata_possibleTypes.includes(obj.__typename)
}
Severity: Major
Found in packages/api/client/generated/schema.ts and 6 other locations - About 1 hr to fix
packages/api/client/generated/schema.ts on lines 700..703
packages/api/client/generated/schema.ts on lines 706..709
packages/api/client/generated/schema.ts on lines 712..715
packages/api/client/generated/schema.ts on lines 718..721
packages/api/client/generated/schema.ts on lines 724..727
packages/api/client/generated/schema.ts on lines 736..739

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

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

      <Box
        width={{ xs: 1, md: 1, lg: '50%' }}
        mr={{ xs: 0, md: 0, lg: 10 }}
        order={{ xs: 2, md: 2, lg: 1 }}
      >
Severity: Major
Found in packages/platform/src/pages/index.tsx and 3 other locations - About 1 hr to fix
packages/platform/src/pages/index.tsx on lines 258..297
packages/platform/src/pages/index.tsx on lines 344..441
packages/platform/src/pages/index.tsx on lines 544..579

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

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

export const isAccount = (obj: { __typename: String }): obj is Account => {
  if (!obj.__typename) throw new Error('__typename is missing')
  return Account_possibleTypes.includes(obj.__typename)
}
Severity: Major
Found in packages/api/client/generated/schema.ts and 6 other locations - About 1 hr to fix
packages/api/client/generated/schema.ts on lines 700..703
packages/api/client/generated/schema.ts on lines 706..709
packages/api/client/generated/schema.ts on lines 712..715
packages/api/client/generated/schema.ts on lines 724..727
packages/api/client/generated/schema.ts on lines 730..733
packages/api/client/generated/schema.ts on lines 736..739

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

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

export const isSphere = (obj: { __typename: String }): obj is Sphere => {
  if (!obj.__typename) throw new Error('__typename is missing')
  return Sphere_possibleTypes.includes(obj.__typename)
}
Severity: Major
Found in packages/api/client/generated/schema.ts and 6 other locations - About 1 hr to fix
packages/api/client/generated/schema.ts on lines 700..703
packages/api/client/generated/schema.ts on lines 706..709
packages/api/client/generated/schema.ts on lines 712..715
packages/api/client/generated/schema.ts on lines 718..721
packages/api/client/generated/schema.ts on lines 730..733
packages/api/client/generated/schema.ts on lines 736..739

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

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

          <ContentBox
            width={{ xs: 1, md: 1, lg: '40%' }}
            px={{ xs: 6, md: 6, lg: 8 }}
            py={{ xs: 6, md: 6, lg: 6 }}
          >
Severity: Major
Found in packages/platform/src/pages/index.tsx and 3 other locations - About 1 hr to fix
packages/platform/src/pages/index.tsx on lines 344..441
packages/platform/src/pages/index.tsx on lines 458..543
packages/platform/src/pages/index.tsx on lines 544..579

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

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

export const isPost = (obj: { __typename: String }): obj is Post => {
  if (!obj.__typename) throw new Error('__typename is missing')
  return Post_possibleTypes.includes(obj.__typename)
}
Severity: Major
Found in packages/api/client/generated/schema.ts and 6 other locations - About 1 hr to fix
packages/api/client/generated/schema.ts on lines 700..703
packages/api/client/generated/schema.ts on lines 712..715
packages/api/client/generated/schema.ts on lines 718..721
packages/api/client/generated/schema.ts on lines 724..727
packages/api/client/generated/schema.ts on lines 730..733
packages/api/client/generated/schema.ts on lines 736..739

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

Function VerifySphereResolver has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const VerifySphereResolver = async (
  _,
  args: { input: VerifySphereInput },
  context: ServerContext,
) => {
Severity: Minor
Found in packages/api/src/modules/account/resolvers/Mutation/VerifySphere.ts - About 1 hr to fix

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

    export type SphereWhereUniqueInput = {
      readonly id?: Maybe<Scalars['ID']>
      readonly alias?: Maybe<Scalars['String']>
      readonly aliasSlug?: Maybe<Scalars['String']>
    }
    Severity: Major
    Found in packages/api/src/types.ts and 2 other locations - About 1 hr to fix
    packages/api/src/types.ts on lines 1960..1964
    packages/api/src/types.ts on lines 1966..1970

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

    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

    export type SphereUpdateManyDataInput = {
      readonly alias?: Maybe<Scalars['String']>
      readonly aliasSlug?: Maybe<Scalars['String']>
      readonly slugPrefix?: Maybe<Scalars['String']>
    }
    Severity: Major
    Found in packages/api/src/types.ts and 2 other locations - About 1 hr to fix
    packages/api/src/types.ts on lines 1966..1970
    packages/api/src/types.ts on lines 2458..2462

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

    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

    export type SphereUpdateManyMutationInput = {
      readonly alias?: Maybe<Scalars['String']>
      readonly aliasSlug?: Maybe<Scalars['String']>
      readonly slugPrefix?: Maybe<Scalars['String']>
    }
    Severity: Major
    Found in packages/api/src/types.ts and 2 other locations - About 1 hr to fix
    packages/api/src/types.ts on lines 1960..1964
    packages/api/src/types.ts on lines 2458..2462

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

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

    export const Search = () => {
      const [value, setValue] = React.useState('')
      const searchInput = React.createRef<HTMLInputElement>()
    
      const onClear = (e: React.SyntheticEvent<HTMLButtonElement>) => {
    Severity: Minor
    Found in packages/platform/src/components/Search/Search.tsx - About 1 hr to fix

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

      export const fragmentWithArgs = info => {
        const fields = graphqlFields(info)
        const fieldsWithArgs = graphqlFields(info, {}, { processArguments: true })
      
        let fragmentStr = `{`
      Severity: Minor
      Found in packages/api/src/utils/index.ts - About 1 hr to fix

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

        export type AccountUpdateOneRequiredInput = {
          readonly create?: Maybe<AccountCreateInput>
          readonly update?: Maybe<AccountUpdateDataInput>
          readonly upsert?: Maybe<AccountUpsertNestedInput>
          readonly connect?: Maybe<AccountWhereUniqueInput>
        Severity: Major
        Found in packages/api/src/types.ts and 6 other locations - About 1 hr to fix
        packages/api/src/types.ts on lines 186..191
        packages/api/src/types.ts on lines 193..198
        packages/api/src/types.ts on lines 1091..1096
        packages/api/src/types.ts on lines 1995..2000
        packages/api/src/types.ts on lines 2145..2150
        packages/api/src/types.ts on lines 2304..2309

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

        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