vorteil/direktiv

View on GitHub

Showing 1,235 of 1,235 total issues

Avoid deeply nested control flow statements.
Open

          if (!flow[i + 1]) {
            for (let j = 0; j < newElements.length; j++) {
              if (
                (newElements[j] as Edge).source === flow[i] &&
                (newElements[j] as Edge).target === "endNode" &&
Severity: Major
Found in ui/src/design/WorkflowDiagram/utils.ts - About 45 mins to fix

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

    func (o *NoopState) GetTransitions() []string {
        transitions := make([]string, 0)
        if o.Transition != "" {
            transitions = append(transitions, o.Transition)
        }
    Severity: Major
    Found in pkg/model/state-noop.go and 7 other locations - About 45 mins to fix
    pkg/model/state-action.go on lines 36..49
    pkg/model/state-consume.go on lines 35..48
    pkg/model/state-delay.go on lines 34..47
    pkg/model/state-events-and.go on lines 35..48
    pkg/model/state-generate-event.go on lines 59..72
    pkg/model/state-parallel.go on lines 36..49
    pkg/model/state-setter.go on lines 116..129

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

    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 Header has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    const Header = ({ serviceId }: { serviceId: string }) => {
      const pages = usePages();
      const { data: service, refetch, isFetching } = useService(serviceId);
    
      const { t } = useTranslation();
    Severity: Minor
    Found in ui/src/pages/namespace/Services/Detail/Header.tsx - About 45 mins 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 8 locations. Consider refactoring.
    Open

    func (o *ActionState) GetTransitions() []string {
        transitions := make([]string, 0)
        if o.Transition != "" {
            transitions = append(transitions, o.Transition)
        }
    Severity: Major
    Found in pkg/model/state-action.go and 7 other locations - About 45 mins to fix
    pkg/model/state-consume.go on lines 35..48
    pkg/model/state-delay.go on lines 34..47
    pkg/model/state-events-and.go on lines 35..48
    pkg/model/state-generate-event.go on lines 59..72
    pkg/model/state-noop.go on lines 32..45
    pkg/model/state-parallel.go on lines 36..49
    pkg/model/state-setter.go on lines 116..129

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

    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

    func (o *ParallelState) GetTransitions() []string {
        transitions := make([]string, 0)
        if o.Transition != "" {
            transitions = append(transitions, o.Transition)
        }
    Severity: Major
    Found in pkg/model/state-parallel.go and 7 other locations - About 45 mins to fix
    pkg/model/state-action.go on lines 36..49
    pkg/model/state-consume.go on lines 35..48
    pkg/model/state-delay.go on lines 34..47
    pkg/model/state-events-and.go on lines 35..48
    pkg/model/state-generate-event.go on lines 59..72
    pkg/model/state-noop.go on lines 32..45
    pkg/model/state-setter.go on lines 116..129

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

    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

    func (o *GenerateEventState) GetTransitions() []string {
        transitions := make([]string, 0)
        if o.Transition != "" {
            transitions = append(transitions, o.Transition)
        }
    Severity: Major
    Found in pkg/model/state-generate-event.go and 7 other locations - About 45 mins to fix
    pkg/model/state-action.go on lines 36..49
    pkg/model/state-consume.go on lines 35..48
    pkg/model/state-delay.go on lines 34..47
    pkg/model/state-events-and.go on lines 35..48
    pkg/model/state-noop.go on lines 32..45
    pkg/model/state-parallel.go on lines 36..49
    pkg/model/state-setter.go on lines 116..129

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

    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

    func (o *EventsAndState) GetTransitions() []string {
        transitions := make([]string, 0)
        if o.Transition != "" {
            transitions = append(transitions, o.Transition)
        }
    Severity: Major
    Found in pkg/model/state-events-and.go and 7 other locations - About 45 mins to fix
    pkg/model/state-action.go on lines 36..49
    pkg/model/state-consume.go on lines 35..48
    pkg/model/state-delay.go on lines 34..47
    pkg/model/state-generate-event.go on lines 59..72
    pkg/model/state-noop.go on lines 32..45
    pkg/model/state-parallel.go on lines 36..49
    pkg/model/state-setter.go on lines 116..129

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

    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

    func (o *ConsumeEventState) GetTransitions() []string {
        transitions := make([]string, 0)
        if o.Transition != "" {
            transitions = append(transitions, o.Transition)
        }
    Severity: Major
    Found in pkg/model/state-consume.go and 7 other locations - About 45 mins to fix
    pkg/model/state-action.go on lines 36..49
    pkg/model/state-delay.go on lines 34..47
    pkg/model/state-events-and.go on lines 35..48
    pkg/model/state-generate-event.go on lines 59..72
    pkg/model/state-noop.go on lines 32..45
    pkg/model/state-parallel.go on lines 36..49
    pkg/model/state-setter.go on lines 116..129

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

    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 ServicesTableRow has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    }> = ({ service, setRebuildService }) => {
      const pages = usePages();
      const namespace = useNamespace();
      const navigate = useNavigate();
      const { t } = useTranslation();
    Severity: Minor
    Found in ui/src/pages/namespace/Services/List/Row/index.tsx - About 45 mins 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 8 locations. Consider refactoring.
    Open

    func (o *SetterState) GetTransitions() []string {
        transitions := make([]string, 0)
        if o.Transition != "" {
            transitions = append(transitions, o.Transition)
        }
    Severity: Major
    Found in pkg/model/state-setter.go and 7 other locations - About 45 mins to fix
    pkg/model/state-action.go on lines 36..49
    pkg/model/state-consume.go on lines 35..48
    pkg/model/state-delay.go on lines 34..47
    pkg/model/state-events-and.go on lines 35..48
    pkg/model/state-generate-event.go on lines 59..72
    pkg/model/state-noop.go on lines 32..45
    pkg/model/state-parallel.go on lines 36..49

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 115.

    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

    func (o *DelayState) GetTransitions() []string {
        transitions := make([]string, 0)
        if o.Transition != "" {
            transitions = append(transitions, o.Transition)
        }
    Severity: Major
    Found in pkg/model/state-delay.go and 7 other locations - About 45 mins to fix
    pkg/model/state-action.go on lines 36..49
    pkg/model/state-consume.go on lines 35..48
    pkg/model/state-events-and.go on lines 35..48
    pkg/model/state-generate-event.go on lines 59..72
    pkg/model/state-noop.go on lines 32..45
    pkg/model/state-parallel.go on lines 36..49
    pkg/model/state-setter.go on lines 116..129

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

    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 MirrorDetail has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    const MirrorDetail = () => {
      const { data, isAllowed, noPermissionMessage, isFetched } = useListSyncs();
      const namespace = useNamespace();
      const namespaceDetail = useNamespaceDetail();
    
    
    Severity: Minor
    Found in ui/src/pages/namespace/Mirror/Detail/index.tsx - About 45 mins 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

    Function EndpointPage has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    const EndpointPage: FC = () => {
      const pages = usePages();
      const { path } = pages.explorer.useParams();
      const namespace = useNamespace();
      const { segments } = analyzePath(path);
    Severity: Minor
    Found in ui/src/pages/namespace/Explorer/Endpoint/index.tsx - About 45 mins 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

    Function JqPlaygroundPage has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    const JqPlaygroundPage: FC = () => {
      const { t } = useTranslation();
      const theme = useTheme();
      const {
        setData: storePlaygroundDataInLocalstorage,
    Severity: Minor
    Found in ui/src/pages/namespace/JqPlayground/index.tsx - About 45 mins 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 16 locations. Consider refactoring.
    Open

      const submitForm = (e: FormEvent<HTMLFormElement>) => {
        e.stopPropagation(); // prevent the parent form from submitting
        handleSubmit(onSubmit)(e);
      };
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Auth/BasicAuthForm.tsx on lines 51..54
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Auth/KeyAuthForm.tsx on lines 54..57
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Auth/WebhookAuthForm.tsx on lines 45..48
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/EventFilterForm.tsx on lines 53..56
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/HeaderManipulationForm/index.tsx on lines 52..55
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/JsInboundForm.tsx on lines 45..48
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/RequestConvertForm.tsx on lines 52..55
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Outbound/JsOutboundForm.tsx on lines 45..48
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/InstantResponseForm.tsx on lines 53..56
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetEventForm.tsx on lines 48..51
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetFlowForm.tsx on lines 60..63
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetFlowVarForm.tsx on lines 54..57
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetNamespaceFileForm.tsx on lines 54..57
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetNamespaceVarForm.tsx on lines 55..58
    ui/src/pages/namespace/Explorer/Service/ServiceEditor/Form/Patches/Item.tsx on lines 55..58

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

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

      const submitForm = (e: FormEvent<HTMLFormElement>) => {
        e.stopPropagation(); // prevent the parent form from submitting
        handleSubmit(onSubmit)(e);
      };
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Auth/BasicAuthForm.tsx on lines 51..54
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Auth/KeyAuthForm.tsx on lines 54..57
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Auth/WebhookAuthForm.tsx on lines 45..48
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/AclForm/index.tsx on lines 47..50
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/EventFilterForm.tsx on lines 53..56
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/HeaderManipulationForm/index.tsx on lines 52..55
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/RequestConvertForm.tsx on lines 52..55
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Outbound/JsOutboundForm.tsx on lines 45..48
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/InstantResponseForm.tsx on lines 53..56
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetEventForm.tsx on lines 48..51
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetFlowForm.tsx on lines 60..63
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetFlowVarForm.tsx on lines 54..57
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetNamespaceFileForm.tsx on lines 54..57
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetNamespaceVarForm.tsx on lines 55..58
    ui/src/pages/namespace/Explorer/Service/ServiceEditor/Form/Patches/Item.tsx on lines 55..58

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

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

      const submitForm = (e: FormEvent<HTMLFormElement>) => {
        e.stopPropagation(); // prevent the parent form from submitting
        handleSubmit(onSubmit)(e);
      };
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Auth/BasicAuthForm.tsx on lines 51..54
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Auth/KeyAuthForm.tsx on lines 54..57
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Auth/WebhookAuthForm.tsx on lines 45..48
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/AclForm/index.tsx on lines 47..50
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/EventFilterForm.tsx on lines 53..56
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/HeaderManipulationForm/index.tsx on lines 52..55
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/JsInboundForm.tsx on lines 45..48
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/RequestConvertForm.tsx on lines 52..55
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Outbound/JsOutboundForm.tsx on lines 45..48
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/InstantResponseForm.tsx on lines 53..56
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetFlowForm.tsx on lines 60..63
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetFlowVarForm.tsx on lines 54..57
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetNamespaceFileForm.tsx on lines 54..57
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetNamespaceVarForm.tsx on lines 55..58
    ui/src/pages/namespace/Explorer/Service/ServiceEditor/Form/Patches/Item.tsx on lines 55..58

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

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

      const submitForm = (e: FormEvent<HTMLFormElement>) => {
        e.stopPropagation(); // prevent the parent form from submitting
        handleSubmit(onSubmit)(e);
      };
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Auth/BasicAuthForm.tsx on lines 51..54
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Auth/KeyAuthForm.tsx on lines 54..57
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Auth/WebhookAuthForm.tsx on lines 45..48
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/AclForm/index.tsx on lines 47..50
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/EventFilterForm.tsx on lines 53..56
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/HeaderManipulationForm/index.tsx on lines 52..55
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/JsInboundForm.tsx on lines 45..48
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/RequestConvertForm.tsx on lines 52..55
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Outbound/JsOutboundForm.tsx on lines 45..48
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/InstantResponseForm.tsx on lines 53..56
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetEventForm.tsx on lines 48..51
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetFlowVarForm.tsx on lines 54..57
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetNamespaceFileForm.tsx on lines 54..57
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetNamespaceVarForm.tsx on lines 55..58
    ui/src/pages/namespace/Explorer/Service/ServiceEditor/Form/Patches/Item.tsx on lines 55..58

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

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

      const submitForm = (e: FormEvent<HTMLFormElement>) => {
        e.stopPropagation(); // prevent the parent form from submitting
        handleSubmit(onSubmit)(e);
      };
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Auth/BasicAuthForm.tsx on lines 51..54
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Auth/KeyAuthForm.tsx on lines 54..57
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Auth/WebhookAuthForm.tsx on lines 45..48
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/AclForm/index.tsx on lines 47..50
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/EventFilterForm.tsx on lines 53..56
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/JsInboundForm.tsx on lines 45..48
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/RequestConvertForm.tsx on lines 52..55
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Outbound/JsOutboundForm.tsx on lines 45..48
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/InstantResponseForm.tsx on lines 53..56
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetEventForm.tsx on lines 48..51
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetFlowForm.tsx on lines 60..63
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetFlowVarForm.tsx on lines 54..57
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetNamespaceFileForm.tsx on lines 54..57
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetNamespaceVarForm.tsx on lines 55..58
    ui/src/pages/namespace/Explorer/Service/ServiceEditor/Form/Patches/Item.tsx on lines 55..58

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

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

      const submitForm = (e: FormEvent<HTMLFormElement>) => {
        e.stopPropagation(); // prevent the parent form from submitting
        handleSubmit(onSubmit)(e);
      };
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Auth/BasicAuthForm.tsx on lines 51..54
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Auth/KeyAuthForm.tsx on lines 54..57
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Auth/WebhookAuthForm.tsx on lines 45..48
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/AclForm/index.tsx on lines 47..50
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/EventFilterForm.tsx on lines 53..56
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/HeaderManipulationForm/index.tsx on lines 52..55
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/JsInboundForm.tsx on lines 45..48
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/RequestConvertForm.tsx on lines 52..55
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/InstantResponseForm.tsx on lines 53..56
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetEventForm.tsx on lines 48..51
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetFlowForm.tsx on lines 60..63
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetFlowVarForm.tsx on lines 54..57
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetNamespaceFileForm.tsx on lines 54..57
    ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetNamespaceVarForm.tsx on lines 55..58
    ui/src/pages/namespace/Explorer/Service/ServiceEditor/Form/Patches/Item.tsx on lines 55..58

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

    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