vorteil/direktiv

View on GitHub

Showing 1,235 of 1,235 total issues

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

export const getVariableDetails = apiFactory({
  url: ({ namespace, id }: { namespace: string; id: string }) =>
    `/api/v2/namespaces/${namespace}/variables/${id}`,
  method: "GET",
  schema: VarContentSchema,
Severity: Major
Found in ui/src/api/variables/query/details.ts and 4 other locations - About 1 hr to fix
ui/src/api/enterprise/groups/mutation/delete.ts on lines 30..35
ui/src/api/enterprise/tokens/mutate/delete.ts on lines 30..35
ui/src/api/registries/mutate/deleteRegistry.ts on lines 34..39
ui/src/api/variables/mutate/delete.ts on lines 12..17

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

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

        case instancestore.FieldCreatedAt:
            if t, ok := filter.Value.(time.Time); ok {
                filter.Value = t.UTC()
            }

Severity: Major
Found in pkg/instancestore/instancestoresql/sql_builders.go and 1 other location - About 1 hr to fix
pkg/instancestore/instancestoresql/sql_builders.go on lines 93..110

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

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

const deleteRegistry = apiFactory({
  url: ({ namespace, gegistryId }: { namespace: string; gegistryId: string }) =>
    `/api/v2/namespaces/${namespace}/registries/${gegistryId}`,
  method: "DELETE",
  schema: RegistryDeletedSchema,
Severity: Major
Found in ui/src/api/registries/mutate/deleteRegistry.ts and 4 other locations - About 1 hr to fix
ui/src/api/enterprise/groups/mutation/delete.ts on lines 30..35
ui/src/api/enterprise/tokens/mutate/delete.ts on lines 30..35
ui/src/api/variables/mutate/delete.ts on lines 12..17
ui/src/api/variables/query/details.ts on lines 9..14

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

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

const deleteGroup = apiFactory({
  url: ({ namespace, groupId }: { namespace: string; groupId: string }) =>
    `/api/v2/namespaces/${namespace}/groups/${groupId}`,
  method: "DELETE",
  schema: GroupDeletedSchema,
Severity: Major
Found in ui/src/api/enterprise/groups/mutation/delete.ts and 4 other locations - About 1 hr to fix
ui/src/api/enterprise/tokens/mutate/delete.ts on lines 30..35
ui/src/api/registries/mutate/deleteRegistry.ts on lines 34..39
ui/src/api/variables/mutate/delete.ts on lines 12..17
ui/src/api/variables/query/details.ts on lines 9..14

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

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

        case fieldDeadline:
            if t, ok := filter.Value.(time.Time); ok {
                filter.Value = t.UTC()
            }

Severity: Major
Found in pkg/instancestore/instancestoresql/sql_builders.go and 1 other location - About 1 hr to fix
pkg/instancestore/instancestoresql/sql_builders.go on lines 74..91

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

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

const deleteToken = apiFactory({
  url: ({ namespace, tokenId }: { namespace: string; tokenId: string }) =>
    `/api/v2/namespaces/${namespace}/tokens/${tokenId}`,
  method: "DELETE",
  schema: TokenDeletedSchema,
Severity: Major
Found in ui/src/api/enterprise/tokens/mutate/delete.ts and 4 other locations - About 1 hr to fix
ui/src/api/enterprise/groups/mutation/delete.ts on lines 30..35
ui/src/api/registries/mutate/deleteRegistry.ts on lines 34..39
ui/src/api/variables/mutate/delete.ts on lines 12..17
ui/src/api/variables/query/details.ts on lines 9..14

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

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

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

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

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

Refactorings

Further Reading

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

  const setExistingVariable = (name: string) => {
    const foundVariable = variables.find((variable) => variable.name === name);
    if (foundVariable) {
      onChange(foundVariable?.name, foundVariable?.mimeType);
      setInput(name);
Severity: Major
Found in ui/src/components/WorkflowVariablepicker/index.tsx and 1 other location - About 1 hr to fix
ui/src/components/NamespaceVariablepicker/index.tsx on lines 47..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 74.

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

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

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

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

Refactorings

Further Reading

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

  const setExistingVariable = (name: string) => {
    const foundVariable = variables.find((element) => element.name === name);
    if (foundVariable) {
      onChange(foundVariable?.name, foundVariable?.mimeType);
      setInput(name);
Severity: Major
Found in ui/src/components/NamespaceVariablepicker/index.tsx and 1 other location - About 1 hr to fix
ui/src/components/WorkflowVariablepicker/index.tsx on lines 49..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 74.

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

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

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

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

Refactorings

Further Reading

Function UpdateWorkflow has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const UpdateWorkflow = () => {
  const [workflow, setWorkflow] = useState(exampleWorkflow);
  const [orientation, setOrientation] = useState<Orientation>("horizontal");

  return (
Severity: Minor
Found in ui/src/design/WorkflowDiagram/index.stories.tsx - About 1 hr to fix

    Function useEventSource has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    export const useEventSource = ({
      url,
      apiKey,
      onOpen,
      onMessage,
    Severity: Minor
    Found in ui/src/api/streaming.ts - About 1 hr 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 4 locations. Consider refactoring.
    Open

    func (o *DirektivApplyer) copyServicesIntoRoot(ctx context.Context) error {
        paths := []string{}
        for k := range o.parser.Services {
            paths = append(paths, k)
        }
    Severity: Major
    Found in pkg/mirror/apply.go and 3 other locations - About 1 hr to fix
    pkg/mirror/apply.go on lines 144..163
    pkg/mirror/apply.go on lines 186..205
    pkg/mirror/apply.go on lines 207..226

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

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

    func (o *DirektivApplyer) copyWorkflowsIntoRoot(ctx context.Context) error {
        paths := []string{}
        for k := range o.parser.Workflows {
            paths = append(paths, k)
        }
    Severity: Major
    Found in pkg/mirror/apply.go and 3 other locations - About 1 hr to fix
    pkg/mirror/apply.go on lines 165..184
    pkg/mirror/apply.go on lines 186..205
    pkg/mirror/apply.go on lines 207..226

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

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

    func (o *DirektivApplyer) copyConsumersIntoRoot(ctx context.Context) error {
        paths := []string{}
        for k := range o.parser.Consumers {
            paths = append(paths, k)
        }
    Severity: Major
    Found in pkg/mirror/apply.go and 3 other locations - About 1 hr to fix
    pkg/mirror/apply.go on lines 144..163
    pkg/mirror/apply.go on lines 165..184
    pkg/mirror/apply.go on lines 186..205

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

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

    func (o *DirektivApplyer) copyEndpointsIntoRoot(ctx context.Context) error {
        paths := []string{}
        for k := range o.parser.Endpoints {
            paths = append(paths, k)
        }
    Severity: Major
    Found in pkg/mirror/apply.go and 3 other locations - About 1 hr to fix
    pkg/mirror/apply.go on lines 144..163
    pkg/mirror/apply.go on lines 165..184
    pkg/mirror/apply.go on lines 207..226

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

    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

      varList: (
        namespace: string,
        { apiKey, workflowPath }: { apiKey?: string; workflowPath?: string }
      ) =>
        [
    Severity: Major
    Found in ui/src/api/variables/index.ts and 6 other locations - About 1 hr to fix
    ui/src/api/files/index.ts on lines 2..13
    ui/src/api/instances/index.ts on lines 28..39
    ui/src/api/instances/index.ts on lines 40..51
    ui/src/api/instances/index.ts on lines 52..63
    ui/src/api/services/index.ts on lines 10..27
    ui/src/api/variables/index.ts on lines 14..31

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

    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

      file: (
        namespace: string,
        { apiKey, path }: { apiKey?: string; path?: string }
      ) =>
        [
    Severity: Major
    Found in ui/src/api/files/index.ts and 6 other locations - About 1 hr to fix
    ui/src/api/instances/index.ts on lines 28..39
    ui/src/api/instances/index.ts on lines 40..51
    ui/src/api/instances/index.ts on lines 52..63
    ui/src/api/services/index.ts on lines 10..27
    ui/src/api/variables/index.ts on lines 2..13
    ui/src/api/variables/index.ts on lines 14..31

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

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

            <Fieldset
              label={t(
                "pages.explorer.endpoint.editor.form.plugins.inbound.headerManipulation.headers_to_modify"
              )}
            >
    ui/src/pages/namespace/Explorer/Consumer/ConsumerEditor/Form/index.tsx on lines 90..96
    ui/src/pages/namespace/Explorer/Consumer/ConsumerEditor/Form/index.tsx on lines 97..103
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/AclForm/index.tsx on lines 61..71
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/AclForm/index.tsx on lines 72..82
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/AclForm/index.tsx on lines 83..93
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/AclForm/index.tsx on lines 94..104
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/HeaderManipulationForm/index.tsx on lines 66..76
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/HeaderManipulationForm/index.tsx on lines 90..100

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 73.

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

            <Fieldset
              label={t(
                "pages.explorer.endpoint.editor.form.plugins.inbound.acl.allow_tags"
              )}
            >
    ui/src/pages/namespace/Explorer/Consumer/ConsumerEditor/Form/index.tsx on lines 90..96
    ui/src/pages/namespace/Explorer/Consumer/ConsumerEditor/Form/index.tsx on lines 97..103
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/AclForm/index.tsx on lines 61..71
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/AclForm/index.tsx on lines 72..82
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/AclForm/index.tsx on lines 94..104
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/HeaderManipulationForm/index.tsx on lines 66..76
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/HeaderManipulationForm/index.tsx on lines 78..88
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/HeaderManipulationForm/index.tsx on lines 90..100

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 73.

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

            <Fieldset
              label={t(
                "pages.explorer.endpoint.editor.form.plugins.inbound.headerManipulation.headers_to_add"
              )}
            >
    ui/src/pages/namespace/Explorer/Consumer/ConsumerEditor/Form/index.tsx on lines 90..96
    ui/src/pages/namespace/Explorer/Consumer/ConsumerEditor/Form/index.tsx on lines 97..103
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/AclForm/index.tsx on lines 61..71
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/AclForm/index.tsx on lines 72..82
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/AclForm/index.tsx on lines 83..93
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/AclForm/index.tsx on lines 94..104
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/HeaderManipulationForm/index.tsx on lines 78..88
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/HeaderManipulationForm/index.tsx on lines 90..100

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 73.

    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

      instanceDetails: (
        namespace: string,
        { apiKey, instanceId }: { apiKey?: string; instanceId: string }
      ) =>
        [
    Severity: Major
    Found in ui/src/api/instances/index.ts and 6 other locations - About 1 hr to fix
    ui/src/api/files/index.ts on lines 2..13
    ui/src/api/instances/index.ts on lines 40..51
    ui/src/api/instances/index.ts on lines 52..63
    ui/src/api/services/index.ts on lines 10..27
    ui/src/api/variables/index.ts on lines 2..13
    ui/src/api/variables/index.ts on lines 14..31

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

    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