vorteil/direktiv

View on GitHub

Showing 1,235 of 1,235 total issues

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

export const deleteFile = apiFactory({
  url: ({
    baseUrl,
    namespace,
    path,
Severity: Major
Found in ui/src/api/files/mutate/deleteFile.ts and 1 other location - About 3 hrs to fix
ui/src/api/files/query/file.ts on lines 11..26

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

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

type FormProps = {
  defaultConfig?: ServiceFormSchemaType;
  onSave: (value: ServiceFormSchemaType) => void;
  children: (args: {
    formControls: UseFormReturn<ServiceFormSchemaType>;
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/index.tsx on lines 25..33

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

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

type FormProps = {
  defaultConfig?: EndpointFormSchemaType;
  onSave: (value: EndpointFormSchemaType) => void;
  children: (args: {
    formControls: UseFormReturn<EndpointFormSchemaType>;
ui/src/pages/namespace/Explorer/Service/ServiceEditor/Form/index.tsx on lines 39..47

Duplicated Code

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

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

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

Tuning

This issue has a mass of 101.

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 forEachLogic.processActionResults has a Cognitive Complexity of 38 (exceeds 20 allowed). Consider refactoring.
Open

func (logic *forEachLogic) processActionResults(ctx context.Context, children []*ChildInfo, results *actionResultPayload) (*Transition, error) {
    var err error

    var found bool
    var idx int
Severity: Minor
Found in pkg/flow/states/foreach.go - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

const CommandItem = React.forwardRef<
  React.ElementRef<typeof CommandPrimitive.Item>,
  React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
>(({ className, ...props }, ref) => (
  <CommandPrimitive.Item
Severity: Major
Found in ui/src/design/Command/index.tsx and 5 other locations - About 3 hrs to fix
ui/src/design/Command/index.tsx on lines 87..101
ui/src/design/ContextMenu/index.tsx on lines 43..57
ui/src/design/Dropdown/index.tsx on lines 44..58
ui/src/design/Select/index.tsx on lines 73..87
ui/src/design/Select/index.tsx on lines 117..131

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

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

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

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

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

Refactorings

Further Reading

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

export const getJsOutboundConfigAtIndex = (
  fields: OutboundPluginFormSchemaType[] | undefined,
  index: number | undefined
): JsOutboundFormSchemaType["configuration"] | undefined => {
  const plugin = index !== undefined ? fields?.[index] : undefined;
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 17..25
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 27..35
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 37..45
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 47..55
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 57..65
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 77..85
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 87..95

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

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

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

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

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

Refactorings

Further Reading

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

export const getKeyAuthConfigAtIndex = (
  fields: AuthPluginFormSchemaType[] | undefined,
  index: number | undefined
): KeyAuthFormSchemaType["configuration"] | undefined => {
  const plugin = index !== undefined ? fields?.[index] : undefined;
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 17..25
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 27..35
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 37..45
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 47..55
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 57..65
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 67..75
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 77..85

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

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

const SelectSeparator = React.forwardRef<
  React.ElementRef<typeof SelectPrimitive.Separator>,
  React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
>(({ className, ...props }, ref) => (
  <SelectPrimitive.Separator
Severity: Major
Found in ui/src/design/Select/index.tsx and 5 other locations - About 3 hrs to fix
ui/src/design/Command/index.tsx on lines 87..101
ui/src/design/Command/index.tsx on lines 129..143
ui/src/design/ContextMenu/index.tsx on lines 43..57
ui/src/design/Dropdown/index.tsx on lines 44..58
ui/src/design/Select/index.tsx on lines 73..87

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

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

const CommandGroup = React.forwardRef<
  React.ElementRef<typeof CommandPrimitive.Group>,
  React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>
>(({ className, ...props }, ref) => (
  <CommandPrimitive.Group
Severity: Major
Found in ui/src/design/Command/index.tsx and 5 other locations - About 3 hrs to fix
ui/src/design/Command/index.tsx on lines 129..143
ui/src/design/ContextMenu/index.tsx on lines 43..57
ui/src/design/Dropdown/index.tsx on lines 44..58
ui/src/design/Select/index.tsx on lines 73..87
ui/src/design/Select/index.tsx on lines 117..131

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

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

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

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

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

Refactorings

Further Reading

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

export const getAclConfigAtIndex = (
  fields: InboundPluginFormSchemaType[] | undefined,
  index: number | undefined
): AclFormSchemaType["configuration"] | undefined => {
  const plugin = index !== undefined ? fields?.[index] : undefined;
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 17..25
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 27..35
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 47..55
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 57..65
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 67..75
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 77..85
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 87..95

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

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

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

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

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

Refactorings

Further Reading

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

export const getJsInboundConfigAtIndex = (
  fields: InboundPluginFormSchemaType[] | undefined,
  index: number | undefined
): JsInboundFormSchemaType["configuration"] | undefined => {
  const plugin = index !== undefined ? fields?.[index] : undefined;
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 17..25
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 37..45
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 47..55
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 57..65
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 67..75
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 77..85
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 87..95

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

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

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

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

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

Refactorings

Further Reading

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

export const getEventFilterConfigAtIndex = (
  fields: InboundPluginFormSchemaType[] | undefined,
  index: number | undefined
): EventFilterFormSchemaType["configuration"] | undefined => {
  const plugin = index !== undefined ? fields?.[index] : undefined;
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 17..25
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 27..35
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 37..45
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 47..55
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 67..75
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 77..85
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 87..95

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

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

const DropdownMenuSubContent = React.forwardRef<
  React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
  React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
>(({ className, ...props }, ref) => (
  <DropdownMenuPrimitive.SubContent
Severity: Major
Found in ui/src/design/Dropdown/index.tsx and 5 other locations - About 3 hrs to fix
ui/src/design/Command/index.tsx on lines 87..101
ui/src/design/Command/index.tsx on lines 129..143
ui/src/design/ContextMenu/index.tsx on lines 43..57
ui/src/design/Select/index.tsx on lines 73..87
ui/src/design/Select/index.tsx on lines 117..131

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

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

const ContextMenuSubContent = React.forwardRef<
  React.ElementRef<typeof ContextMenuPrimitive.SubContent>,
  React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>
>(({ className, ...props }, ref) => (
  <ContextMenuPrimitive.SubContent
Severity: Major
Found in ui/src/design/ContextMenu/index.tsx and 5 other locations - About 3 hrs to fix
ui/src/design/Command/index.tsx on lines 87..101
ui/src/design/Command/index.tsx on lines 129..143
ui/src/design/Dropdown/index.tsx on lines 44..58
ui/src/design/Select/index.tsx on lines 73..87
ui/src/design/Select/index.tsx on lines 117..131

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

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

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

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

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

Refactorings

Further Reading

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

export const getBasicAuthConfigAtIndex = (
  fields: AuthPluginFormSchemaType[] | undefined,
  index: number | undefined
): BasicAuthFormSchemaType["configuration"] | undefined => {
  const plugin = index !== undefined ? fields?.[index] : undefined;
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 17..25
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 27..35
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 37..45
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 47..55
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 57..65
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 67..75
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 87..95

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

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

const SelectLabel = React.forwardRef<
  React.ElementRef<typeof SelectPrimitive.Label>,
  React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
>(({ className, ...props }, ref) => (
  <SelectPrimitive.Label
Severity: Major
Found in ui/src/design/Select/index.tsx and 5 other locations - About 3 hrs to fix
ui/src/design/Command/index.tsx on lines 87..101
ui/src/design/Command/index.tsx on lines 129..143
ui/src/design/ContextMenu/index.tsx on lines 43..57
ui/src/design/Dropdown/index.tsx on lines 44..58
ui/src/design/Select/index.tsx on lines 117..131

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

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

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

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

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

Refactorings

Further Reading

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

export const getRequestConvertConfigAtIndex = (
  fields: InboundPluginFormSchemaType[] | undefined,
  index: number | undefined
): RequestConvertFormSchemaType["configuration"] | undefined => {
  const plugin = index !== undefined ? fields?.[index] : undefined;
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 27..35
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 37..45
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 47..55
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 57..65
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 67..75
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 77..85
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 87..95

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

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

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

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

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

Refactorings

Further Reading

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

export const getHeaderManipulationConfigAtIndex = (
  fields: InboundPluginFormSchemaType[] | undefined,
  index: number | undefined
): HeaderManipulationFormSchemaType["configuration"] | undefined => {
  const plugin = index !== undefined ? fields?.[index] : undefined;
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 17..25
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 27..35
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 37..45
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 57..65
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 67..75
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 77..85
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/utils.ts on lines 87..95

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

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 editGroup = apiFactory<GroupFormSchemaType>({
  url: ({
    namespace,
    baseUrl,
    groupId,
Severity: Major
Found in ui/src/api/enterprise/groups/mutation/edit.ts and 2 other locations - About 3 hrs to fix
ui/src/api/instances/mutate/cancel.ts on lines 11..24
ui/src/api/variables/mutate/update.ts on lines 15..27

Duplicated Code

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

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

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

Tuning

This issue has a mass of 100.

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 updateVar = apiFactory<VarFormCreateEditSchemaType>({
  url: ({
    baseUrl,
    namespace,
    id,
Severity: Major
Found in ui/src/api/variables/mutate/update.ts and 2 other locations - About 3 hrs to fix
ui/src/api/enterprise/groups/mutation/edit.ts on lines 12..24
ui/src/api/instances/mutate/cancel.ts on lines 11..24

Duplicated Code

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

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

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

Tuning

This issue has a mass of 100.

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