vorteil/direktiv

View on GitHub

Showing 1,235 of 1,235 total issues

Function Initialize has 153 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func Initialize(app core.App, db *database.SQLStore, bus *pubsub2.Bus, instanceManager *instancestore.InstanceManager, wakeByEvents events.WakeEventsWaiter, startByEvents events.WorkflowStart, circuit *core.Circuit) error {
    funcCtr := &serviceController{
        manager: app.ServiceManager,
    }
    fsCtr := &fsController{
Severity: Major
Found in pkg/api/api.go - About 5 hrs to fix

    Function RegistriesList has 128 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const RegistriesList: FC = () => {
      const { t } = useTranslation();
    
      const [dialogOpen, setDialogOpen] = useState(false);
      const [deleteRegistry, setDeleteRegistry] = useState<RegistrySchemaType>();
    Severity: Major
    Found in ui/src/pages/namespace/Settings/Registries/index.tsx - About 5 hrs to fix

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

              <LogSegment display={isChildInstanceEntry && hasWorkflowInformation}>
                <span className="opacity-60">
                  <Link to={workflowLink} className="underline" target="_blank">
                    {workflowPath}
                  </Link>{" "}
      Severity: Major
      Found in ui/src/pages/namespace/Instances/Detail/Main/Logs/Entry.tsx and 1 other location - About 5 hrs to fix
      ui/src/pages/namespace/Monitoring/Logs/Entry.tsx on lines 48..60

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

      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

              <LogSegment display={isWorkflowLog && hasNamespaceInformation}>
                <span className="opacity-60">
                  <Link to={workflowLink} className="underline" target="_blank">
                    {workflowPath}
                  </Link>{" "}
      Severity: Major
      Found in ui/src/pages/namespace/Monitoring/Logs/Entry.tsx and 1 other location - About 5 hrs to fix
      ui/src/pages/namespace/Instances/Detail/Main/Logs/Entry.tsx on lines 63..75

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

      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

                  <Select
                    value={formControls.getValues("size")}
                    onValueChange={(value) => formControls.setValue("size", value)}
                  >
                    <SelectTrigger variant="outline" id="size">
      ui/src/pages/namespace/Explorer/Service/ServiceEditor/Form/index.tsx on lines 101..126

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

      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

                  <Select
                    value={formControls.getValues("scale")?.toString()}
                    onValueChange={(value) =>
                      formControls.setValue("scale", Number(value))
                    }
      ui/src/pages/namespace/Explorer/Service/ServiceEditor/Form/index.tsx on lines 133..156

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

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

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

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

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

      Refactorings

      Further Reading

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

      export const useInstanceDetails = ({ instanceId }: { instanceId: string }) => {
        const apiKey = useApiKey();
        const namespace = useNamespace();
      
        if (!namespace) {
      Severity: Major
      Found in ui/src/api/instances/query/details/index.ts and 1 other location - About 4 hrs to fix
      ui/src/api/instances/query/input.ts on lines 34..51

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

      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

              {isAllowedSuccessfulInstances ? (
                <>
                  {successfulInstances.length === 0 ? (
                    <NoResult icon={Boxes}>
                      {t("pages.monitoring.instances.successfulExecutions.empty")}
      Severity: Major
      Found in ui/src/pages/namespace/Monitoring/Instances/index.tsx and 1 other location - About 4 hrs to fix
      ui/src/pages/namespace/Monitoring/Instances/index.tsx on lines 85..105

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

      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

              {isAllowedFailedInstances ? (
                <>
                  {failedInstances.length === 0 ? (
                    <NoResult icon={Boxes}>
                      {t("pages.monitoring.instances.failedExecutions.empty")}
      Severity: Major
      Found in ui/src/pages/namespace/Monitoring/Instances/index.tsx and 1 other location - About 4 hrs to fix
      ui/src/pages/namespace/Monitoring/Instances/index.tsx on lines 57..79

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

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

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

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

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

      Refactorings

      Further Reading

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

      export const useInstanceInput = ({ instanceId }: { instanceId: string }) => {
        const apiKey = useApiKey();
        const namespace = useNamespace();
      
        if (!namespace) {
      Severity: Major
      Found in ui/src/api/instances/query/input.ts and 1 other location - About 4 hrs to fix
      ui/src/api/instances/query/details/index.ts on lines 32..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 134.

      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

                route: {
                  path: "permissions",
                  element: <PermissionsPage />,
                  handle: { permissions: true, isPermissionsPage: true },
                  children: [
      Severity: Major
      Found in ui/src/util/router/pages.tsx and 1 other location - About 4 hrs to fix
      ui/src/util/router/pages.tsx on lines 598..619

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

      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

            route: {
              path: "gateway",
              element: <GatewayPage />,
              handle: { gateway: true, isGatewayPage: true },
              children: [
      Severity: Major
      Found in ui/src/util/router/pages.tsx and 1 other location - About 4 hrs to fix
      ui/src/util/router/pages.tsx on lines 294..315

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

      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 ExplorerPage has 119 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const ExplorerPage: FC = () => {
        const pages = usePages();
        const namespace = useNamespace();
        const { path } = pages.explorer.useParams();
        const { data, isSuccess, isFetched, isAllowed, noPermissionMessage } =
      Severity: Major
      Found in ui/src/pages/namespace/Explorer/Tree/index.tsx - About 4 hrs to fix

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

                <Fieldset
                  label={t(
                    "pages.explorer.endpoint.editor.form.plugins.inbound.jsInbound.script"
                  )}
                >
        ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/EventFilterForm.tsx on lines 69..88
        ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Outbound/JsOutboundForm.tsx on lines 61..80
        ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/InstantResponseForm.tsx on lines 99..118
        ui/src/pages/namespace/Explorer/Service/ServiceEditor/Form/Patches/Item.tsx on lines 97..114

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 130.

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

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

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

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

        Refactorings

        Further Reading

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

                <Fieldset
                  label={t(
                    "pages.explorer.endpoint.editor.form.plugins.outbound.jsOutbound.script"
                  )}
                >
        ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/EventFilterForm.tsx on lines 69..88
        ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/JsInboundForm.tsx on lines 61..80
        ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/InstantResponseForm.tsx on lines 99..118
        ui/src/pages/namespace/Explorer/Service/ServiceEditor/Form/Patches/Item.tsx on lines 97..114

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 130.

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

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

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

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

        Refactorings

        Further Reading

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

              <Fieldset
                label={t("pages.explorer.service.editor.form.patches.modal.value")}
              >
                <Card className="h-[200px] w-full p-5" background="weight-1" noShadow>
                  <Controller
        ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/EventFilterForm.tsx on lines 69..88
        ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/JsInboundForm.tsx on lines 61..80
        ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Outbound/JsOutboundForm.tsx on lines 61..80
        ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/InstantResponseForm.tsx on lines 99..118

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 130.

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

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

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

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

        Refactorings

        Further Reading

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

                <Fieldset
                  label={t(
                    "pages.explorer.endpoint.editor.form.plugins.target.instantResponse.statusMessage"
                  )}
                >
        ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/EventFilterForm.tsx on lines 69..88
        ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Inbound/JsInboundForm.tsx on lines 61..80
        ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Outbound/JsOutboundForm.tsx on lines 61..80
        ui/src/pages/namespace/Explorer/Service/ServiceEditor/Form/Patches/Item.tsx on lines 97..114

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 130.

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

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

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

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

        Refactorings

        Further Reading

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

                  {error && (
                    <Popover defaultOpen>
                      <PopoverTrigger asChild>
                        <span className="flex items-center gap-x-1 text-danger-11 dark:text-danger-dark-11">
                          <Bug className="h-5" />
        Severity: Major
        Found in ui/src/pages/namespace/Permissions/Policy/Editor.tsx and 1 other location - About 4 hrs to fix
        ui/src/pages/namespace/Explorer/Workflow/Edit/CodeEditor.tsx on lines 64..78

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 130.

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

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

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

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

        Refactorings

        Further Reading

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

        export const TargetFlowVarFormSchema = z.object({
          type: z.literal(targetPluginTypes.targetFlowVar.name),
          configuration: z.object({
            namespace: z.string().optional(),
            flow: z.string().nonempty(),
        ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/schema/plugins/target/targetFlow.ts on lines 4..12

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 130.

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

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

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

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

        Refactorings

        Further Reading

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

                {error && (
                  <Popover defaultOpen>
                    <PopoverTrigger asChild>
                      <span className="flex items-center gap-x-1 text-danger-11 dark:text-danger-dark-11">
                        <Bug className="h-5" />
        Severity: Major
        Found in ui/src/pages/namespace/Explorer/Workflow/Edit/CodeEditor.tsx and 1 other location - About 4 hrs to fix
        ui/src/pages/namespace/Permissions/Policy/Editor.tsx on lines 64..78

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 130.

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

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

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

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

        Refactorings

        Further Reading

        Severity
        Category
        Status
        Source
        Language