jefer94/choco

View on GitHub

Showing 266 of 266 total issues

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

export default function Error({ error }: ErrorProps): ReactElement {
  return (
    error ? <Base>{error}</Base> : <></>
  )
}
Severity: Major
Found in services/algorithm/src/components/FormError.tsx and 1 other location - About 1 hr to fix
services/algorithm/src/components/FormSuccess.tsx on lines 21..25

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

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

export default function reducer(state = getDefaults(), action: LazyActions): readonly Tab[] {
  switch (action.type) {
    case 'ADD_TAB':
      return add(state)

Severity: Minor
Found in services/algorithm/src/reducers/tabs.ts - About 1 hr to fix

    Function callback has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      nc.subscribe(host, { callback: async (error, msg) => {
        const { decode, encode } = JSONCodec()
        const { reply, data } = msg
    
        if (reply) {
    Severity: Minor
    Found in services/authenticator/src/server.ts - About 1 hr to fix

      Function callback has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        subscription = await nc.subscribe(host, { callback: async (err, msg) => {
          const { decode, encode } = JSONCodec()
          const { reply, data } = msg
      
          if (reply) {
      Severity: Minor
      Found in services/activity/src/server.ts - About 1 hr to fix

        Function Data has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function Data(): ReactElement {
            return (
              <div>
                <div>
                  <Field
        Severity: Minor
        Found in services/algorithm/src/containers/NewProjectContainer.tsx - About 1 hr to fix

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

              if (comments[0] && comments.some((exp) => exp[0].test(s))) return <Comment dark>{s}</Comment>
          Severity: Major
          Found in packages/editor/src/Editor.tsx and 4 other locations - About 1 hr to fix
          packages/editor/src/Editor.tsx on lines 36..36
          packages/editor/src/Editor.tsx on lines 37..37
          packages/editor/src/Editor.tsx on lines 38..38
          packages/editor/src/Editor.tsx on lines 39..39

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

          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

            return { data: await Promise.all(activities.map(async ({ user, ...activity }) => ({
              ...activity,
              user: await getUser(user)
            }))) }
          Severity: Major
          Found in services/activity/src/actions/fetchActivities.ts and 1 other location - About 1 hr to fix
          services/activity/src/actions/fetchAllActivities.ts on lines 20..23

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

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

              if (handlers[0] && handlers.some((exp) => exp[0].test(s))) return <Handler dark>{s}</Handler>
          Severity: Major
          Found in packages/editor/src/Editor.tsx and 4 other locations - About 1 hr to fix
          packages/editor/src/Editor.tsx on lines 35..35
          packages/editor/src/Editor.tsx on lines 37..37
          packages/editor/src/Editor.tsx on lines 38..38
          packages/editor/src/Editor.tsx on lines 39..39

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

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

              if (numbers[0] && numbers.some((exp) => exp[0].test(s))) return <Number dark>{s}</Number>
          Severity: Major
          Found in packages/editor/src/Editor.tsx and 4 other locations - About 1 hr to fix
          packages/editor/src/Editor.tsx on lines 35..35
          packages/editor/src/Editor.tsx on lines 36..36
          packages/editor/src/Editor.tsx on lines 38..38
          packages/editor/src/Editor.tsx on lines 39..39

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

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

              if (strings[0] && strings.some((exp) => exp[0].test(s))) return <String dark>{s}</String>
          Severity: Major
          Found in packages/editor/src/Editor.tsx and 4 other locations - About 1 hr to fix
          packages/editor/src/Editor.tsx on lines 35..35
          packages/editor/src/Editor.tsx on lines 36..36
          packages/editor/src/Editor.tsx on lines 37..37
          packages/editor/src/Editor.tsx on lines 39..39

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

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

              if (types[0] && types.some((exp) => exp[0].test(s))) return <Type dark>{s}</Type>
          Severity: Major
          Found in packages/editor/src/Editor.tsx and 4 other locations - About 1 hr to fix
          packages/editor/src/Editor.tsx on lines 35..35
          packages/editor/src/Editor.tsx on lines 36..36
          packages/editor/src/Editor.tsx on lines 37..37
          packages/editor/src/Editor.tsx on lines 38..38

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

          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

            return { data: await Promise.all(activities.map(async ({ user, ...activity }) => ({
              ...activity,
              user: await getUser(user)
            }))) }
          Severity: Major
          Found in services/activity/src/actions/fetchAllActivities.ts and 1 other location - About 1 hr to fix
          services/activity/src/actions/fetchActivities.ts on lines 21..24

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

          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

            return word
              .replace(/=/g, ' = ')
              .replace(/ /g, '')
              .replace(/\t/g, '')
              .replace(/,/g, '')
          Severity: Major
          Found in packages/algorithm-transpiler/src/variables.ts and 1 other location - About 1 hr to fix
          packages/algorithm-transpiler/src/variables.ts on lines 111..117

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

          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

            return word
              .replace(/=/g, ' = ')
              .replace(/ /g, '')
              .replace(/\t/g, '')
              .replace(/,/g, '')
          Severity: Major
          Found in packages/algorithm-transpiler/src/variables.ts and 1 other location - About 1 hr to fix
          packages/algorithm-transpiler/src/variables.ts on lines 86..92

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

          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 default async function deleteCode(id: string): Promise<DeleteScope> {
            return { data: await Code.findOneAndDelete({ _id: id }) }
          }
          Severity: Major
          Found in services/projects/src/actions/deleteCode.ts and 2 other locations - About 55 mins to fix
          services/projects/src/actions/deleteProject.ts on lines 13..15
          services/projects/src/actions/deleteProjectPermission.ts on lines 13..16

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 54.

          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 default async function deleteProjectPermission(id: string):
            Promise<DeleteProjectPermission> {
            return { data: await ProjectPermission.findOneAndDelete({ _id: id }) }
          }
          Severity: Major
          Found in services/projects/src/actions/deleteProjectPermission.ts and 2 other locations - About 55 mins to fix
          services/projects/src/actions/deleteCode.ts on lines 13..15
          services/projects/src/actions/deleteProject.ts on lines 13..15

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

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

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

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

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

          Refactorings

          Further Reading

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

          export function useFetchSharedCodes(project: string): QueryResult<readonly Code[]> {
            return useQuery(query, { variables: { project } })
            //
          }
          Severity: Minor
          Found in services/algorithm/src/hooks/useFetchSharedCodes.tsx and 1 other location - About 55 mins to fix
          services/algorithm/src/hooks/useFetchCodes.tsx on lines 19..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 54.

          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

            context: ({ req }) => {
              const currentReq = req as RequestWithAuth
              const auth = currentReq.auth || null
              return { auth }
            },
          Severity: Minor
          Found in services/graphql-gateway/src/gateway.ts and 1 other location - About 55 mins to fix
          services/gateway/src/server.ts on lines 43..47

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

          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 default async function deleteProject(id: string): Promise<DeleteProject> {
            return { data: await Project.findOneAndDelete({ _id: id }) }
          }
          Severity: Major
          Found in services/projects/src/actions/deleteProject.ts and 2 other locations - About 55 mins to fix
          services/projects/src/actions/deleteCode.ts on lines 13..15
          services/projects/src/actions/deleteProjectPermission.ts on lines 13..16

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 54.

          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

            context: ({ req }) => {
              const currentReq = req as RequestWithAuth
              const user = currentReq.user || null
              return { user }
            }
          Severity: Minor
          Found in services/gateway/src/server.ts and 1 other location - About 55 mins to fix
          services/graphql-gateway/src/gateway.ts on lines 31..35

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

          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