eduardomoroni/trading-card-manager

View on GitHub

Showing 244 of 244 total issues

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

  upsertSet: (
    args: {
      where: SetWhereUniqueInput;
      create: SetCreateInput;
      update: SetUpdateInput;
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 219..225
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 235..241
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 267..273
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 286..292
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 302..308
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 318..324

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

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 interface SetSubscriptionPayload {
  mutation: MutationType;
  node: Set;
  updatedFields: String[];
  previousValues: SetPreviousValues;
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 2921..2926
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3183..3188
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3388..3393
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3537..3542
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3562..3567
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3823..3828

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

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 interface TypeSubscriptionPayload {
  mutation: MutationType;
  node: Type;
  updatedFields: String[];
  previousValues: TypePreviousValues;
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 2921..2926
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3183..3188
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3388..3393
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3562..3567
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3679..3684
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3823..3828

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

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 interface TokenSubscriptionPayload {
  mutation: MutationType;
  node: Token;
  updatedFields: String[];
  previousValues: TokenPreviousValues;
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 2921..2926
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3388..3393
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3537..3542
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3562..3567
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3679..3684
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3823..3828

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

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 interface SuperTypeSubscriptionPayload {
  mutation: MutationType;
  node: SuperType;
  updatedFields: String[];
  previousValues: SuperTypePreviousValues;
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3183..3188
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3388..3393
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3537..3542
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3562..3567
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3679..3684
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3823..3828

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

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 interface SubTypeSubscriptionPayload {
  mutation: MutationType;
  node: SubType;
  updatedFields: String[];
  previousValues: SubTypePreviousValues;
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 2921..2926
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3183..3188
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3388..3393
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3537..3542
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3562..3567
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3679..3684

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

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

  upsertSuperType: (
    args: {
      where: SuperTypeWhereUniqueInput;
      create: SuperTypeCreateInput;
      update: SuperTypeUpdateInput;
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 219..225
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 235..241
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 251..257
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 267..273
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 302..308
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 318..324

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

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

  upsertToken: (
    args: {
      where: TokenWhereUniqueInput;
      create: TokenCreateInput;
      update: TokenUpdateInput;
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 219..225
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 235..241
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 251..257
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 267..273
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 286..292
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 318..324

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

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

  upsertCard: (
    args: {
      where: CardWhereUniqueInput;
      create: CardCreateInput;
      update: CardUpdateInput;
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 235..241
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 251..257
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 267..273
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 286..292
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 302..308
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 318..324

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

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

  upsertSubType: (
    args: {
      where: SubTypeWhereUniqueInput;
      create: SubTypeCreateInput;
      update: SubTypeUpdateInput;
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 219..225
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 235..241
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 251..257
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 286..292
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 302..308
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 318..324

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

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 interface CardSubscriptionPayload {
  mutation: MutationType;
  node: Card;
  updatedFields: String[];
  previousValues: CardPreviousValues;
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 2921..2926
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3183..3188
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3537..3542
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3562..3567
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3679..3684
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3823..3828

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

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

  upsertPrinting: (
    args: {
      where: PrintingWhereUniqueInput;
      create: PrintingCreateInput;
      update: PrintingUpdateInput;
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 219..225
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 251..257
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 267..273
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 286..292
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 302..308
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 318..324

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

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

  upsertType: (
    args: {
      where: TypeWhereUniqueInput;
      create: TypeCreateInput;
      update: TypeUpdateInput;
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 219..225
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 235..241
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 251..257
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 267..273
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 286..292
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 302..308

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

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 interface PrintingSubscriptionPayload {
  mutation: MutationType;
  node: Printing;
  updatedFields: String[];
  previousValues: PrintingPreviousValues;
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 2921..2926
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3183..3188
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3388..3393
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3537..3542
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3679..3684
packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3823..3828

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

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 Button has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const Button: React.FC<ButtonProps> = (props: ButtonProps) => {
  const [state, setState] = useSetStateIfMounted<ButtonState>(ButtonState.IDLE);

  async function avoidClickingWhenPromiseIsResolving(): Promise<void> {
    try {
Severity: Minor
Found in packages/frontend/src/presentation/components/button/Button.tsx - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Avoid too many return statements within this function.
Open

    return Colors.numberManaBackground;
Severity: Major
Found in packages/frontend/src/presentation/components/ManaCost.tsx - About 30 mins to fix

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

    export interface SetUpdateOneRequiredWithoutCardsInput {
      create?: SetCreateWithoutCardsInput;
      update?: SetUpdateWithoutCardsDataInput;
      upsert?: SetUpsertWithoutCardsInput;
      connect?: SetWhereUniqueInput;
    packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 2006..2011
    packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3101..3106

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

    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

    Avoid too many return statements within this function.
    Open

          return Colors.greenManaBackground;
    Severity: Major
    Found in packages/frontend/src/presentation/components/ManaCost.tsx - About 30 mins to fix

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

            superTypes: {
              connect: <SuperType[]>card.supertypes.map((name: string) => ({ name }))
            },
      Severity: Major
      Found in packages/backend/db-migration/prisma/seed/card.ts and 3 other locations - About 30 mins to fix
      packages/backend/db-migration/prisma/seed/card.ts on lines 45..47
      packages/backend/db-migration/prisma/seed/card.ts on lines 48..50
      packages/backend/db-migration/prisma/seed/card.ts on lines 54..56

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

      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 interface SetUpdateOneRequiredWithoutTokensInput {
        create?: SetCreateWithoutTokensInput;
        update?: SetUpdateWithoutTokensDataInput;
        upsert?: SetUpsertWithoutTokensInput;
        connect?: SetWhereUniqueInput;
      packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 1013..1018
      packages/backend/db-migration/prisma/generated/prisma-client/index.ts on lines 3101..3106

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

      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