vorteil/direktiv

View on GitHub

Showing 1,235 of 1,235 total issues

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

func LoadInstanceDescentInfo(data []byte) (*InstanceDescentInfo, error) {
    m := make(map[string]interface{})

    err := json.Unmarshal(data, &m)
    if err != nil {
Severity: Major
Found in pkg/engine/descent-info.go and 1 other location - About 3 hrs to fix
pkg/engine/child-info.go on lines 50..86

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

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

Method fsController.updateFile has 100 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (e *fsController) updateFile(w http.ResponseWriter, r *http.Request) {
    ns := extractContextNamespace(r)

    db, err := e.db.BeginTx(r.Context())
    if err != nil {
Severity: Major
Found in pkg/api/filesystem.go - About 3 hrs to fix

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

      await Promise.all(
        expectNewPatches.map(async (item, index) => {
          const currentElement = page.getByTestId("patch-row").nth(index);
          await expect(currentElement).toContainText(item.op);
          await expect(currentElement).toContainText(item.path);
    Severity: Major
    Found in ui/e2e/explorer/service/index.spec.ts and 2 other locations - About 3 hrs to fix
    ui/e2e/explorer/service/index.spec.ts on lines 200..206
    ui/e2e/explorer/service/index.spec.ts on lines 293..299

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

    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

      await Promise.all(
        patches.map(async (item, index) => {
          const currentElement = page.getByTestId("patch-row").nth(index);
          await expect(currentElement).toContainText(item.op);
          await expect(currentElement).toContainText(item.path);
    Severity: Major
    Found in ui/e2e/explorer/service/index.spec.ts and 2 other locations - About 3 hrs to fix
    ui/e2e/explorer/service/index.spec.ts on lines 252..258
    ui/e2e/explorer/service/index.spec.ts on lines 293..299

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

    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

      await Promise.all(
        expectNewPatches.map(async (item, index) => {
          const currentElement = page.getByTestId("patch-row").nth(index);
          await expect(currentElement).toContainText(item.op);
          await expect(currentElement).toContainText(item.path);
    Severity: Major
    Found in ui/e2e/explorer/service/index.spec.ts and 2 other locations - About 3 hrs to fix
    ui/e2e/explorer/service/index.spec.ts on lines 200..206
    ui/e2e/explorer/service/index.spec.ts on lines 252..258

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

    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 const Table = React.forwardRef<
      HTMLTableElement,
      React.TableHTMLAttributes<HTMLTableElement>
    >(({ children, className, ...props }, ref) => (
      <table
    Severity: Major
    Found in ui/src/design/Table/index.tsx and 1 other location - About 3 hrs to fix
    ui/src/design/Table/index.tsx on lines 35..51

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

    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 const TableBody = React.forwardRef<
      HTMLTableSectionElement,
      React.HTMLProps<HTMLTableSectionElement>
    >(({ children, className, ...props }, ref) => (
      <tbody
    Severity: Major
    Found in ui/src/design/Table/index.tsx and 1 other location - About 3 hrs to fix
    ui/src/design/Table/index.tsx on lines 6..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 95.

    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 initLegacyServer has 99 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func initLegacyServer(circuit *core.Circuit, config *core.Config, db *gorm.DB, dbManager *database.SQLStore) (*server, error) {
        srv := new(server)
        srv.ID = uuid.New()
        srv.initJQ()
        srv.config = config
    Severity: Major
    Found in pkg/flow/server.go - About 2 hrs to fix

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

        await Promise.all(
          patches.map(async (item, index) => {
            const currentElement = page.getByTestId("patch-row").nth(index);
            await expect(currentElement).toContainText(item.op);
            await expect(currentElement).toContainText(item.path);
      Severity: Major
      Found in ui/e2e/explorer/service/index.spec.ts and 2 other locations - About 2 hrs to fix
      ui/e2e/explorer/service/index.spec.ts on lines 221..227
      ui/e2e/explorer/service/index.spec.ts on lines 239..245

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

      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

        await Promise.all(
          expectNewPatches.map(async (item, index) => {
            const currentElement = page.getByTestId("patch-row").nth(index);
            await expect(currentElement).toContainText(item.op);
            await expect(currentElement).toContainText(item.path);
      Severity: Major
      Found in ui/e2e/explorer/service/index.spec.ts and 2 other locations - About 2 hrs to fix
      ui/e2e/explorer/service/index.spec.ts on lines 169..175
      ui/e2e/explorer/service/index.spec.ts on lines 221..227

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

      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

        await Promise.all(
          expectNewPatches.map(async (item, index) => {
            const currentElement = page.getByTestId("patch-row").nth(index);
            await expect(currentElement).toContainText(item.op);
            await expect(currentElement).toContainText(item.path);
      Severity: Major
      Found in ui/e2e/explorer/service/index.spec.ts and 2 other locations - About 2 hrs to fix
      ui/e2e/explorer/service/index.spec.ts on lines 169..175
      ui/e2e/explorer/service/index.spec.ts on lines 239..245

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

      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 variables = Array.from({ length: amount }, () => ({
          name: faker.internet.domainWord(),
          content: encode(faker.git.shortSha()),
          mimeType:
            supportedMimeTypes[Math.floor(Math.random() * supportedMimeTypes.length)],
      Severity: Major
      Found in ui/e2e/utils/variables.ts and 1 other location - About 2 hrs to fix
      ui/e2e/utils/variables.ts on lines 13..18

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

      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 PublicValidationSchema = z.object({
        formType: z.literal("public"),
        url: z
          .string()
          .url()
      Severity: Major
      Found in ui/src/api/namespaces/schema/mirror/validation.ts and 1 other location - About 2 hrs to fix
      ui/src/api/namespaces/schema/mirror/validation.ts on lines 44..52

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

      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 variables = Array.from({ length: amount }, () => ({
          name: faker.internet.domainWord(),
          content: encode(faker.lorem.sentence()),
          mimeType:
            supportedMimeTypes[Math.floor(Math.random() * supportedMimeTypes.length)],
      Severity: Major
      Found in ui/e2e/utils/variables.ts and 1 other location - About 2 hrs to fix
      ui/e2e/utils/variables.ts on lines 50..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 93.

      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 KeepTokenValidationSchema = z.object({
        formType: z.literal("keep-token"),
        url: z
          .string()
          .url()
      Severity: Major
      Found in ui/src/api/namespaces/schema/mirror/validation.ts and 1 other location - About 2 hrs to fix
      ui/src/api/namespaces/schema/mirror/validation.ts on lines 11..19

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

      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 const TableCell = React.forwardRef<
        HTMLTableCellElement,
        React.HTMLProps<HTMLTableCellElement>
      >(({ children, className, ...props }, ref) => (
        <td
      Severity: Major
      Found in ui/src/design/Table/index.tsx and 1 other location - About 2 hrs to fix
      ui/src/design/Table/index.tsx on lines 97..111

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

      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 const TableRow = React.forwardRef<
        HTMLTableRowElement,
        React.HTMLProps<HTMLTableRowElement>
      >(({ children, className, ...props }, ref) => (
        <tr
      Severity: Major
      Found in ui/src/design/Table/index.tsx and 1 other location - About 2 hrs to fix
      ui/src/design/Table/index.tsx on lines 54..68

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

      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

        test("should update minutes", () => {
          const updatedDate = updateDateByTime(date, "45", "minutes");
          expect(updatedDate.getMinutes()).toEqual(45);
          expect(updatedDate.getSeconds()).toEqual(21);
          expect(updatedDate.getHours()).toEqual(8);
      Severity: Major
      Found in ui/src/design/Timepicker/__tests__/utils.test.ts and 2 other locations - About 2 hrs to fix
      ui/src/design/Timepicker/__tests__/utils.test.ts on lines 88..93
      ui/src/design/Timepicker/__tests__/utils.test.ts on lines 95..100

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

      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

        test("should update seconds", () => {
          const updatedDate = updateDateByTime(date, "15", "seconds");
          expect(updatedDate.getSeconds()).toEqual(15);
          expect(updatedDate.getMinutes()).toEqual(37);
          expect(updatedDate.getHours()).toEqual(8);
      Severity: Major
      Found in ui/src/design/Timepicker/__tests__/utils.test.ts and 2 other locations - About 2 hrs to fix
      ui/src/design/Timepicker/__tests__/utils.test.ts on lines 81..86
      ui/src/design/Timepicker/__tests__/utils.test.ts on lines 95..100

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

      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

        test("should update hours", () => {
          const updatedDate = updateDateByTime(date, "18", "hours");
          expect(updatedDate.getHours()).toEqual(18);
          expect(updatedDate.getMinutes()).toEqual(37);
          expect(updatedDate.getSeconds()).toEqual(21);
      Severity: Major
      Found in ui/src/design/Timepicker/__tests__/utils.test.ts and 2 other locations - About 2 hrs to fix
      ui/src/design/Timepicker/__tests__/utils.test.ts on lines 81..86
      ui/src/design/Timepicker/__tests__/utils.test.ts on lines 88..93

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

      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