jefer94/choco

View on GitHub

Showing 224 of 266 total issues

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

export default styled.span`
  ${(v: Comment) => (v.light ? 'color: #008000;' : v.dark ? 'color: #6a9955;' : '')}
`
Severity: Major
Found in packages/editor/src/keywords/Comment.tsx and 7 other locations - About 45 mins to fix
packages/editor/src/Background.tsx on lines 9..13
packages/editor/src/Line.tsx on lines 9..15
packages/editor/src/keywords/Handler.tsx on lines 9..11
packages/editor/src/keywords/Number.tsx on lines 10..12
packages/editor/src/keywords/String.tsx on lines 10..12
packages/editor/src/keywords/Text.tsx on lines 9..11
packages/editor/src/keywords/Type.tsx on lines 9..11

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

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 default styled.span`
  ${(v: Text) => (v.light ? 'color: #000000;' : v.dark ? 'color: #d4d4d4;' : '')}
`
Severity: Major
Found in packages/editor/src/keywords/Text.tsx and 7 other locations - About 45 mins to fix
packages/editor/src/Background.tsx on lines 9..13
packages/editor/src/Line.tsx on lines 9..15
packages/editor/src/keywords/Comment.tsx on lines 9..11
packages/editor/src/keywords/Handler.tsx on lines 9..11
packages/editor/src/keywords/Number.tsx on lines 10..12
packages/editor/src/keywords/String.tsx on lines 10..12
packages/editor/src/keywords/Type.tsx on lines 9..11

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

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 default styled.span`
  ${(v: String) => (v.light ? 'color: #a31515;' : v.dark ? 'color: #ce9178;' : '')}
`
Severity: Major
Found in packages/editor/src/keywords/String.tsx and 7 other locations - About 45 mins to fix
packages/editor/src/Background.tsx on lines 9..13
packages/editor/src/Line.tsx on lines 9..15
packages/editor/src/keywords/Comment.tsx on lines 9..11
packages/editor/src/keywords/Handler.tsx on lines 9..11
packages/editor/src/keywords/Number.tsx on lines 10..12
packages/editor/src/keywords/Text.tsx on lines 9..11
packages/editor/src/keywords/Type.tsx on lines 9..11

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

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 default styled.div`
  ${(v: Background) => (v.light ? 'background-color: #ffffff;' : v.dark ? 'background-color: #1e1e1e;' : '')}
  height: calc(100vh - 48px);
  overflow: auto;
`
Severity: Major
Found in packages/editor/src/Background.tsx and 7 other locations - About 45 mins to fix
packages/editor/src/Line.tsx on lines 9..15
packages/editor/src/keywords/Comment.tsx on lines 9..11
packages/editor/src/keywords/Handler.tsx on lines 9..11
packages/editor/src/keywords/Number.tsx on lines 10..12
packages/editor/src/keywords/String.tsx on lines 10..12
packages/editor/src/keywords/Text.tsx on lines 9..11
packages/editor/src/keywords/Type.tsx on lines 9..11

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

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 default styled.span`
  ${(v: Number) => (v.light ? 'color: #098658;' : v.dark ? 'color: #b5cea8;' : '')}
`
Severity: Major
Found in packages/editor/src/keywords/Number.tsx and 7 other locations - About 45 mins to fix
packages/editor/src/Background.tsx on lines 9..13
packages/editor/src/Line.tsx on lines 9..15
packages/editor/src/keywords/Comment.tsx on lines 9..11
packages/editor/src/keywords/Handler.tsx on lines 9..11
packages/editor/src/keywords/String.tsx on lines 10..12
packages/editor/src/keywords/Text.tsx on lines 9..11
packages/editor/src/keywords/Type.tsx on lines 9..11

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

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 default styled.span`
  ${(v: Handler) => (v.light ? 'color: #af00db;' : v.dark ? 'color: #c586c0;' : '')}
`
Severity: Major
Found in packages/editor/src/keywords/Handler.tsx and 7 other locations - About 45 mins to fix
packages/editor/src/Background.tsx on lines 9..13
packages/editor/src/Line.tsx on lines 9..15
packages/editor/src/keywords/Comment.tsx on lines 9..11
packages/editor/src/keywords/Number.tsx on lines 10..12
packages/editor/src/keywords/String.tsx on lines 10..12
packages/editor/src/keywords/Text.tsx on lines 9..11
packages/editor/src/keywords/Type.tsx on lines 9..11

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

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 default styled.pre`
  ${(v: Line) => (v.light ? 'color: #000000;' : v.dark ? 'color: #d4d4d4;' : '')}
  margin: 0;
  font-size: 16px;
  font-weight: 400;
Severity: Major
Found in packages/editor/src/Line.tsx and 7 other locations - About 45 mins to fix
packages/editor/src/Background.tsx on lines 9..13
packages/editor/src/keywords/Comment.tsx on lines 9..11
packages/editor/src/keywords/Handler.tsx on lines 9..11
packages/editor/src/keywords/Number.tsx on lines 10..12
packages/editor/src/keywords/String.tsx on lines 10..12
packages/editor/src/keywords/Text.tsx on lines 9..11
packages/editor/src/keywords/Type.tsx on lines 9..11

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

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

export type ActivityWithUser = {
  readonly user: Record<string, unknown>
  readonly activity: Pick<ActivityDocument, '_id' | 'name' | 'service'>
}
Severity: Minor
Found in services/activity/src/actions/fetchAllActivities.ts and 1 other location - About 40 mins to fix
services/activity/src/actions/fetchActivities.ts on lines 4..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 49.

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

          <IconButton aria-label="settings">
            <Skeleton animation="wave" variant="circle" width={24} height={24} />
          </IconButton>
Severity: Major
Found in services/algorithm/src/components/ProjectCardSkeleton.tsx and 2 other locations - About 40 mins to fix
services/algorithm/src/components/ProjectCardSkeleton.tsx on lines 53..55
services/algorithm/src/components/ProjectCardSkeleton.tsx on lines 56..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 49.

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

        <IconButton aria-label="share">
          <Skeleton animation="wave" variant="circle" width={24} height={24} />
        </IconButton>
Severity: Major
Found in services/algorithm/src/components/ProjectCardSkeleton.tsx and 2 other locations - About 40 mins to fix
services/algorithm/src/components/ProjectCardSkeleton.tsx on lines 36..38
services/algorithm/src/components/ProjectCardSkeleton.tsx on lines 53..55

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

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

export type ActivityWithUser = {
  readonly user: Record<string, unknown>
  readonly activity: Pick<ActivityDocument, '_id' | 'name' | 'service'>
}
Severity: Minor
Found in services/activity/src/actions/fetchActivities.ts and 1 other location - About 40 mins to fix
services/activity/src/actions/fetchAllActivities.ts on lines 4..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 49.

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

        <IconButton aria-label="share">
          <Skeleton animation="wave" variant="circle" width={24} height={24} />
        </IconButton>
Severity: Major
Found in services/algorithm/src/components/ProjectCardSkeleton.tsx and 2 other locations - About 40 mins to fix
services/algorithm/src/components/ProjectCardSkeleton.tsx on lines 36..38
services/algorithm/src/components/ProjectCardSkeleton.tsx on lines 56..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 49.

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 function useGetCode(id: string): QueryResult<Code> {
  return useQuery(query, { variables: { id } })
}
Severity: Minor
Found in services/algorithm/src/hooks/useGetCode.tsx and 2 other locations - About 40 mins to fix
services/algorithm/src/hooks/useGetProject.tsx on lines 19..21
services/algorithm/src/hooks/useGetProjectPermission.tsx on lines 25..27

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

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 function useGetProjectPermission(id: string): QueryResult<ProjectPermission> {
  return useQuery(query, { variables: { id } })
}
Severity: Minor
Found in services/algorithm/src/hooks/useGetProjectPermission.tsx and 2 other locations - About 40 mins to fix
services/algorithm/src/hooks/useGetCode.tsx on lines 19..21
services/algorithm/src/hooks/useGetProject.tsx on lines 19..21

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

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 function useGetProjects(id: string): QueryResult<Project> {
  return useQuery(query, { variables: { id } })
}
Severity: Minor
Found in services/algorithm/src/hooks/useGetProject.tsx and 2 other locations - About 40 mins to fix
services/algorithm/src/hooks/useGetCode.tsx on lines 19..21
services/algorithm/src/hooks/useGetProjectPermission.tsx on lines 25..27

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

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

function getDefaults(): readonly Tab[] {
  return [{
    id: '0',
    name: locale.one('editor'),
    content: locale.one('code'),
Severity: Minor
Found in services/algorithm/src/hooks/useTabs.ts and 1 other location - About 35 mins to fix
services/algorithm/src/reducers/tabs.ts on lines 24..31

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

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

function getDefaults(): readonly Tab[] {
  return [{
    id: '0',
    name: locale.one('editor'),
    content: locale.one('code'),
Severity: Minor
Found in services/algorithm/src/reducers/tabs.ts and 1 other location - About 35 mins to fix
services/algorithm/src/hooks/useTabs.ts on lines 15..22

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

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

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

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

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

Refactorings

Further Reading

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

  const user = await AuthUser.findOne({ _id: id }).select('-password').populate('scopes').exec()
Severity: Minor
Found in services/authenticator/src/actions/getUser.ts and 1 other location - About 35 mins to fix
services/activity/src/actions/fetchActivities.ts on lines 20..20

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

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

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

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

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

Refactorings

Further Reading

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

  const activities = await ActivityLog.find({ user }).populate('activity').populate('service').exec()
Severity: Minor
Found in services/activity/src/actions/fetchActivities.ts and 1 other location - About 35 mins to fix
services/authenticator/src/actions/getUser.ts on lines 14..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 46.

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

const canReadOwnCode = rule({ cache: 'contextual' })((parent, args, { auth }) =>
  auth.scopes.includes('read:own_code'))
Severity: Major
Found in services/graphql-gateway/src/permissions.ts and 24 other locations - About 30 mins to fix
services/graphql-gateway/src/permissions.ts on lines 8..9
services/graphql-gateway/src/permissions.ts on lines 11..12
services/graphql-gateway/src/permissions.ts on lines 14..15
services/graphql-gateway/src/permissions.ts on lines 17..18
services/graphql-gateway/src/permissions.ts on lines 20..21
services/graphql-gateway/src/permissions.ts on lines 23..24
services/graphql-gateway/src/permissions.ts on lines 26..27
services/graphql-gateway/src/permissions.ts on lines 29..30
services/graphql-gateway/src/permissions.ts on lines 32..33
services/graphql-gateway/src/permissions.ts on lines 35..36
services/graphql-gateway/src/permissions.ts on lines 38..39
services/graphql-gateway/src/permissions.ts on lines 41..42
services/graphql-gateway/src/permissions.ts on lines 44..45
services/graphql-gateway/src/permissions.ts on lines 47..48
services/graphql-gateway/src/permissions.ts on lines 50..51
services/graphql-gateway/src/permissions.ts on lines 56..57
services/graphql-gateway/src/permissions.ts on lines 59..60
services/graphql-gateway/src/permissions.ts on lines 62..63
services/graphql-gateway/src/permissions.ts on lines 65..66
services/graphql-gateway/src/permissions.ts on lines 68..69
services/graphql-gateway/src/permissions.ts on lines 71..72
services/graphql-gateway/src/permissions.ts on lines 74..75
services/graphql-gateway/src/permissions.ts on lines 77..78
services/graphql-gateway/src/permissions.ts on lines 80..81

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