vorteil/direktiv

View on GitHub

Showing 829 of 1,234 total issues

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

func ForEach(instance Instance, state model.State) (Logic, error) {
    forEach, ok := state.(*model.ForEachState)
    if !ok {
        return nil, derrors.NewInternalError(errors.New("bad state object"))
    }
Severity: Major
Found in pkg/flow/states/foreach.go and 6 other locations - About 45 mins to fix
pkg/flow/states/action.go on lines 29..40
pkg/flow/states/delay.go on lines 26..37
pkg/flow/states/error.go on lines 23..34
pkg/flow/states/noop.go on lines 22..33
pkg/flow/states/parallel.go on lines 29..40
pkg/flow/states/switch.go on lines 24..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 113.

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

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

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

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

Refactorings

Further Reading

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

func Parallel(instance Instance, state model.State) (Logic, error) {
    parallel, ok := state.(*model.ParallelState)
    if !ok {
        return nil, derrors.NewInternalError(errors.New("bad state object"))
    }
Severity: Major
Found in pkg/flow/states/parallel.go and 6 other locations - About 45 mins to fix
pkg/flow/states/action.go on lines 29..40
pkg/flow/states/delay.go on lines 26..37
pkg/flow/states/error.go on lines 23..34
pkg/flow/states/foreach.go on lines 33..44
pkg/flow/states/noop.go on lines 22..33
pkg/flow/states/switch.go on lines 24..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 113.

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

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

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

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

Refactorings

Further Reading

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

func Delay(instance Instance, state model.State) (Logic, error) {
    delay, ok := state.(*model.DelayState)
    if !ok {
        return nil, derrors.NewInternalError(errors.New("bad state object"))
    }
Severity: Major
Found in pkg/flow/states/delay.go and 6 other locations - About 45 mins to fix
pkg/flow/states/action.go on lines 29..40
pkg/flow/states/error.go on lines 23..34
pkg/flow/states/foreach.go on lines 33..44
pkg/flow/states/noop.go on lines 22..33
pkg/flow/states/parallel.go on lines 29..40
pkg/flow/states/switch.go on lines 24..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 113.

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

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

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

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

Refactorings

Further Reading

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

func Action(instance Instance, state model.State) (Logic, error) {
    action, ok := state.(*model.ActionState)
    if !ok {
        return nil, derrors.NewInternalError(errors.New("bad state object"))
    }
Severity: Major
Found in pkg/flow/states/action.go and 6 other locations - About 45 mins to fix
pkg/flow/states/delay.go on lines 26..37
pkg/flow/states/error.go on lines 23..34
pkg/flow/states/foreach.go on lines 33..44
pkg/flow/states/noop.go on lines 22..33
pkg/flow/states/parallel.go on lines 29..40
pkg/flow/states/switch.go on lines 24..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 113.

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

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

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

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

Refactorings

Further Reading

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

func Noop(instance Instance, state model.State) (Logic, error) {
    noop, ok := state.(*model.NoopState)
    if !ok {
        return nil, derrors.NewInternalError(errors.New("bad state object"))
    }
Severity: Major
Found in pkg/flow/states/noop.go and 6 other locations - About 45 mins to fix
pkg/flow/states/action.go on lines 29..40
pkg/flow/states/delay.go on lines 26..37
pkg/flow/states/error.go on lines 23..34
pkg/flow/states/foreach.go on lines 33..44
pkg/flow/states/parallel.go on lines 29..40
pkg/flow/states/switch.go on lines 24..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 113.

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

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

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

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

Refactorings

Further Reading

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

func Switch(instance Instance, state model.State) (Logic, error) {
    s, ok := state.(*model.SwitchState)
    if !ok {
        return nil, derrors.NewInternalError(errors.New("bad state object"))
    }
Severity: Major
Found in pkg/flow/states/switch.go and 6 other locations - About 45 mins to fix
pkg/flow/states/action.go on lines 29..40
pkg/flow/states/delay.go on lines 26..37
pkg/flow/states/error.go on lines 23..34
pkg/flow/states/foreach.go on lines 33..44
pkg/flow/states/noop.go on lines 22..33
pkg/flow/states/parallel.go on lines 29..40

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

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

func (a *BranchMode) UnmarshalYAML(unmarshal func(interface{}) error) error {
    var s string

    err := unmarshal(&s)
    if err != nil {
Severity: Major
Found in pkg/model/enums.go and 4 other locations - About 40 mins to fix
pkg/model/enums.go on lines 145..161
pkg/model/enums.go on lines 255..271
pkg/model/enums.go on lines 337..353
pkg/model/function-common.go on lines 74..90

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

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

func (a *Size) UnmarshalYAML(unmarshal func(interface{}) error) error {
    var s string

    err := unmarshal(&s)
    if err != nil {
Severity: Major
Found in pkg/model/enums.go and 4 other locations - About 40 mins to fix
pkg/model/enums.go on lines 66..82
pkg/model/enums.go on lines 255..271
pkg/model/enums.go on lines 337..353
pkg/model/function-common.go on lines 74..90

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

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

func (a *StateType) UnmarshalYAML(unmarshal func(interface{}) error) error {
    var s string

    err := unmarshal(&s)
    if err != nil {
Severity: Major
Found in pkg/model/enums.go and 4 other locations - About 40 mins to fix
pkg/model/enums.go on lines 66..82
pkg/model/enums.go on lines 145..161
pkg/model/enums.go on lines 337..353
pkg/model/function-common.go on lines 74..90

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

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

func (a *FunctionType) UnmarshalYAML(unmarshal func(interface{}) error) error {
    var s string

    err := unmarshal(&s)
    if err != nil {
Severity: Major
Found in pkg/model/function-common.go and 4 other locations - About 40 mins to fix
pkg/model/enums.go on lines 66..82
pkg/model/enums.go on lines 145..161
pkg/model/enums.go on lines 255..271
pkg/model/enums.go on lines 337..353

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

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 expect(
    page
      .getByTestId("consumer-table")
      .locator("tr")
      .getByRole("textbox")
Severity: Major
Found in ui/e2e/gateway/consumers/index.spec.ts and 2 other locations - About 40 mins to fix
ui/e2e/gateway/consumers/index.spec.ts on lines 73..80
ui/e2e/gateway/consumers/index.spec.ts on lines 136..143

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

func (a *StartType) UnmarshalYAML(unmarshal func(interface{}) error) error {
    var s string

    err := unmarshal(&s)
    if err != nil {
Severity: Major
Found in pkg/model/enums.go and 4 other locations - About 40 mins to fix
pkg/model/enums.go on lines 66..82
pkg/model/enums.go on lines 145..161
pkg/model/enums.go on lines 255..271
pkg/model/function-common.go on lines 74..90

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

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

        {selectedDialog === "new-workflow" && (
          <NewWorkflow
            path={data?.path}
            unallowedNames={existingNames}
            close={() => setDialogOpen(false)}
Severity: Major
Found in ui/src/pages/namespace/Explorer/Tree/NewFile.tsx and 4 other locations - About 40 mins to fix
ui/src/pages/namespace/Explorer/Tree/NewFile.tsx on lines 43..49
ui/src/pages/namespace/Explorer/Tree/NewFile.tsx on lines 57..63
ui/src/pages/namespace/Explorer/Tree/NewFile.tsx on lines 64..70
ui/src/pages/namespace/Explorer/Tree/NewFile.tsx on lines 71..77

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

  await expect(
    page
      .getByTestId("consumer-table")
      .locator("tr")
      .getByRole("textbox")
Severity: Major
Found in ui/e2e/gateway/consumers/index.spec.ts and 2 other locations - About 40 mins to fix
ui/e2e/gateway/consumers/index.spec.ts on lines 73..80
ui/e2e/gateway/consumers/index.spec.ts on lines 173..180

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

  const {
    register,
    setValue,
    handleSubmit,
    watch,
Severity: Major
Found in ui/src/pages/namespace/Permissions/Tokens/Create/index.tsx and 2 other locations - About 40 mins to fix
ui/src/pages/namespace/Permissions/Groups/Create.tsx on lines 48..61
ui/src/pages/namespace/Permissions/Groups/Edit.tsx on lines 51..64

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

        {selectedDialog === "new-dir" && (
          <NewDirectory
            path={data?.path}
            unallowedNames={existingNames}
            close={() => setDialogOpen(false)}
Severity: Major
Found in ui/src/pages/namespace/Explorer/Tree/NewFile.tsx and 4 other locations - About 40 mins to fix
ui/src/pages/namespace/Explorer/Tree/NewFile.tsx on lines 50..56
ui/src/pages/namespace/Explorer/Tree/NewFile.tsx on lines 57..63
ui/src/pages/namespace/Explorer/Tree/NewFile.tsx on lines 64..70
ui/src/pages/namespace/Explorer/Tree/NewFile.tsx on lines 71..77

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

    await expect(
      instanceItemRow.getByTestId("instance-column-ended-time"),
      `the "endedAt" column should display a relative time of the endedAt api response`
    ).toContainText(moment(instanceDetail.endedAt).fromNow(true));
Severity: Minor
Found in ui/e2e/instances/list/index.spec.ts and 1 other location - About 40 mins to fix
ui/e2e/instances/list/index.spec.ts on lines 155..158

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

func traceAddtoEventlog(ctx context.Context) (context.Context, func()) {
    tp := otel.GetTracerProvider()
    tr := tp.Tracer("direktiv/flow")
    ctx, span := tr.Start(ctx, "addToEventLog", trace.WithSpanKind(trace.SpanKindInternal))
    finish := func() {
Severity: Minor
Found in pkg/flow/trace.go and 1 other location - About 40 mins to fix
pkg/flow/trace.go on lines 224..234

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

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

func traceProcessingMessage(ctx context.Context) (context.Context, func()) {
    tp := otel.GetTracerProvider()
    tr := tp.Tracer("direktiv/flow")
    ctx, span := tr.Start(ctx, "processingCloudevent", trace.WithSpanKind(trace.SpanKindInternal))

Severity: Minor
Found in pkg/flow/trace.go and 1 other location - About 40 mins to fix
pkg/flow/trace.go on lines 179..188

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

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

  const {
    register,
    setValue,
    handleSubmit,
    watch,
Severity: Major
Found in ui/src/pages/namespace/Permissions/Groups/Edit.tsx and 2 other locations - About 40 mins to fix
ui/src/pages/namespace/Permissions/Groups/Create.tsx on lines 48..61
ui/src/pages/namespace/Permissions/Tokens/Create/index.tsx on lines 36..49

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

Severity
Category
Status
Source
Language