vorteil/direktiv

View on GitHub

Showing 829 of 1,234 total issues

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

func reconcileCreate(src []Item, target []Item) []string {
    result := []string{}

    keys := map[string]bool{}
    for _, item := range target {
Severity: Major
Found in pkg/reconcile/reconcile.go and 1 other location - About 1 hr to fix
pkg/reconcile/reconcile.go on lines 23..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 130.

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 MetaData = z.object({
  previousPage: z.string().nullable(),
  startingFrom: z.string().nullable(),
});
Severity: Major
Found in ui/src/api/events/schema/index.ts and 1 other location - About 1 hr to fix
ui/src/api/secrets/schema.ts on lines 40..43

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

          <ConditionalWrapper
            condition={isValidDate}
            wrapper={(children) => (
              <Tooltip>
                <TooltipTrigger>{children}</TooltipTrigger>
Severity: Major
Found in ui/src/pages/namespace/Monitoring/Instances/Row.tsx and 1 other location - About 1 hr to fix
ui/src/pages/namespace/Instances/List/Row.tsx on lines 117..141

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

export const useUpdateFile = ({
  onSuccess,
  onError,
}: {
  onSuccess?: () => void;
Severity: Major
Found in ui/src/api/files/mutate/updateFile.ts and 1 other location - About 1 hr to fix
ui/src/api/enterprise/policy/mutate/update.ts on lines 17..53

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

  await createFile({
    name: parentWorkflow,
    namespace,
    type: "workflow",
    yaml: parentWorkflowContent({
Severity: Minor
Found in ui/e2e/instances/list/index.spec.ts and 1 other location - About 55 mins to fix
ui/e2e/instances/filter/index.spec.ts on lines 53..61

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

          <Card className="flex flex-col gap-y-6">
            <ServicesTable
              services={serviceList?.data ?? []}
              isSuccess={isSuccess}
              setRebuildService={setRebuildService}
ui/src/pages/namespace/Services/List/index.tsx on lines 51..59

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

  test("empyt string", () => {
    expect(analyzePath("")).toEqual({
      path: null,
      isRoot: true,
      parent: null,
Severity: Minor
Found in ui/src/util/router/__tests___/utils.test.ts and 1 other location - About 55 mins to fix
ui/src/util/router/__tests___/utils.test.ts on lines 23..30

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

  test("/", () => {
    expect(analyzePath("/")).toEqual({
      path: null,
      isRoot: true,
      parent: null,
Severity: Minor
Found in ui/src/util/router/__tests___/utils.test.ts and 1 other location - About 55 mins to fix
ui/src/util/router/__tests___/utils.test.ts on lines 14..21

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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

        <Card>
          <ServicesTable
            services={serviceList?.data ?? []}
            isSuccess={isSuccess}
            setRebuildService={setRebuildService}
Severity: Minor
Found in ui/src/pages/namespace/Services/List/index.tsx and 1 other location - About 55 mins to fix
ui/src/pages/namespace/Explorer/Workflow/Services/ServicesList.tsx on lines 47..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 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

  await createFile({
    name: parentWorkflowName,
    namespace,
    type: "workflow",
    yaml: parentWorkflowContent({
Severity: Minor
Found in ui/e2e/instances/filter/index.spec.ts and 1 other location - About 55 mins to fix
ui/e2e/instances/list/index.spec.ts on lines 332..340

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

func (o *ConsumeEventState) getTransitions() map[string]string {
    transitions := make(map[string]string)
    if o.Transition != "" {
        transitions["transition"] = o.Transition
    }
Severity: Major
Found in pkg/model/state-consume.go and 10 other locations - About 55 mins to fix
pkg/model/state-action.go on lines 21..34
pkg/model/state-delay.go on lines 19..32
pkg/model/state-events-and.go on lines 20..33
pkg/model/state-foreach.go on lines 23..36
pkg/model/state-generate-event.go on lines 44..57
pkg/model/state-getter.go on lines 50..63
pkg/model/state-noop.go on lines 17..30
pkg/model/state-parallel.go on lines 21..34
pkg/model/state-setter.go on lines 101..114
pkg/model/state-validate.go on lines 22..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 125.

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

func (o *ValidateState) getTransitions() map[string]string {
    transitions := make(map[string]string)
    if o.Transition != "" {
        transitions["transition"] = o.Transition
    }
Severity: Major
Found in pkg/model/state-validate.go and 10 other locations - About 55 mins to fix
pkg/model/state-action.go on lines 21..34
pkg/model/state-consume.go on lines 20..33
pkg/model/state-delay.go on lines 19..32
pkg/model/state-events-and.go on lines 20..33
pkg/model/state-foreach.go on lines 23..36
pkg/model/state-generate-event.go on lines 44..57
pkg/model/state-getter.go on lines 50..63
pkg/model/state-noop.go on lines 17..30
pkg/model/state-parallel.go on lines 21..34
pkg/model/state-setter.go on lines 101..114

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

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

func (o *NoopState) getTransitions() map[string]string {
    transitions := make(map[string]string)
    if o.Transition != "" {
        transitions["transition"] = o.Transition
    }
Severity: Major
Found in pkg/model/state-noop.go and 10 other locations - About 55 mins to fix
pkg/model/state-action.go on lines 21..34
pkg/model/state-consume.go on lines 20..33
pkg/model/state-delay.go on lines 19..32
pkg/model/state-events-and.go on lines 20..33
pkg/model/state-foreach.go on lines 23..36
pkg/model/state-generate-event.go on lines 44..57
pkg/model/state-getter.go on lines 50..63
pkg/model/state-parallel.go on lines 21..34
pkg/model/state-setter.go on lines 101..114
pkg/model/state-validate.go on lines 22..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 125.

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

func (o *DelayState) getTransitions() map[string]string {
    transitions := make(map[string]string)
    if o.Transition != "" {
        transitions["transition"] = o.Transition
    }
Severity: Major
Found in pkg/model/state-delay.go and 10 other locations - About 55 mins to fix
pkg/model/state-action.go on lines 21..34
pkg/model/state-consume.go on lines 20..33
pkg/model/state-events-and.go on lines 20..33
pkg/model/state-foreach.go on lines 23..36
pkg/model/state-generate-event.go on lines 44..57
pkg/model/state-getter.go on lines 50..63
pkg/model/state-noop.go on lines 17..30
pkg/model/state-parallel.go on lines 21..34
pkg/model/state-setter.go on lines 101..114
pkg/model/state-validate.go on lines 22..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 125.

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

func (o *ActionState) getTransitions() map[string]string {
    transitions := make(map[string]string)
    if o.Transition != "" {
        transitions["transition"] = o.Transition
    }
Severity: Major
Found in pkg/model/state-action.go and 10 other locations - About 55 mins to fix
pkg/model/state-consume.go on lines 20..33
pkg/model/state-delay.go on lines 19..32
pkg/model/state-events-and.go on lines 20..33
pkg/model/state-foreach.go on lines 23..36
pkg/model/state-generate-event.go on lines 44..57
pkg/model/state-getter.go on lines 50..63
pkg/model/state-noop.go on lines 17..30
pkg/model/state-parallel.go on lines 21..34
pkg/model/state-setter.go on lines 101..114
pkg/model/state-validate.go on lines 22..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 125.

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

func (o *GenerateEventState) getTransitions() map[string]string {
    transitions := make(map[string]string)
    if o.Transition != "" {
        transitions["transition"] = o.Transition
    }
Severity: Major
Found in pkg/model/state-generate-event.go and 10 other locations - About 55 mins to fix
pkg/model/state-action.go on lines 21..34
pkg/model/state-consume.go on lines 20..33
pkg/model/state-delay.go on lines 19..32
pkg/model/state-events-and.go on lines 20..33
pkg/model/state-foreach.go on lines 23..36
pkg/model/state-getter.go on lines 50..63
pkg/model/state-noop.go on lines 17..30
pkg/model/state-parallel.go on lines 21..34
pkg/model/state-setter.go on lines 101..114
pkg/model/state-validate.go on lines 22..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 125.

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

func (o *GetterState) getTransitions() map[string]string {
    transitions := make(map[string]string)
    if o.Transition != "" {
        transitions["transition"] = o.Transition
    }
Severity: Major
Found in pkg/model/state-getter.go and 10 other locations - About 55 mins to fix
pkg/model/state-action.go on lines 21..34
pkg/model/state-consume.go on lines 20..33
pkg/model/state-delay.go on lines 19..32
pkg/model/state-events-and.go on lines 20..33
pkg/model/state-foreach.go on lines 23..36
pkg/model/state-generate-event.go on lines 44..57
pkg/model/state-noop.go on lines 17..30
pkg/model/state-parallel.go on lines 21..34
pkg/model/state-setter.go on lines 101..114
pkg/model/state-validate.go on lines 22..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 125.

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

func (o *SetterState) getTransitions() map[string]string {
    transitions := make(map[string]string)
    if o.Transition != "" {
        transitions["transition"] = o.Transition
    }
Severity: Major
Found in pkg/model/state-setter.go and 10 other locations - About 55 mins to fix
pkg/model/state-action.go on lines 21..34
pkg/model/state-consume.go on lines 20..33
pkg/model/state-delay.go on lines 19..32
pkg/model/state-events-and.go on lines 20..33
pkg/model/state-foreach.go on lines 23..36
pkg/model/state-generate-event.go on lines 44..57
pkg/model/state-getter.go on lines 50..63
pkg/model/state-noop.go on lines 17..30
pkg/model/state-parallel.go on lines 21..34
pkg/model/state-validate.go on lines 22..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 125.

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

func (o *ForEachState) getTransitions() map[string]string {
    transitions := make(map[string]string)
    if o.Transition != "" {
        transitions["transition"] = o.Transition
    }
Severity: Major
Found in pkg/model/state-foreach.go and 10 other locations - About 55 mins to fix
pkg/model/state-action.go on lines 21..34
pkg/model/state-consume.go on lines 20..33
pkg/model/state-delay.go on lines 19..32
pkg/model/state-events-and.go on lines 20..33
pkg/model/state-generate-event.go on lines 44..57
pkg/model/state-getter.go on lines 50..63
pkg/model/state-noop.go on lines 17..30
pkg/model/state-parallel.go on lines 21..34
pkg/model/state-setter.go on lines 101..114
pkg/model/state-validate.go on lines 22..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 125.

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

func (o *ParallelState) getTransitions() map[string]string {
    transitions := make(map[string]string)
    if o.Transition != "" {
        transitions["transition"] = o.Transition
    }
Severity: Major
Found in pkg/model/state-parallel.go and 10 other locations - About 55 mins to fix
pkg/model/state-action.go on lines 21..34
pkg/model/state-consume.go on lines 20..33
pkg/model/state-delay.go on lines 19..32
pkg/model/state-events-and.go on lines 20..33
pkg/model/state-foreach.go on lines 23..36
pkg/model/state-generate-event.go on lines 44..57
pkg/model/state-getter.go on lines 50..63
pkg/model/state-noop.go on lines 17..30
pkg/model/state-setter.go on lines 101..114
pkg/model/state-validate.go on lines 22..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 125.

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