vorteil/direktiv

View on GitHub

Showing 1,235 of 1,235 total issues

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

                  <fieldset className="flex items-center gap-5">
                    <label
                      className="w-[112px] overflow-hidden text-right text-[14px]"
                      htmlFor="public-key"
                    >
Severity: Major
Found in ui/src/components/NamespaceEdit/index.tsx and 4 other locations - About 4 hrs to fix
ui/src/components/NamespaceEdit/index.tsx on lines 319..337
ui/src/components/NamespaceEdit/index.tsx on lines 369..389
ui/src/components/NamespaceEdit/index.tsx on lines 394..414
ui/src/components/NamespaceEdit/index.tsx on lines 437..457

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

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

        <Fieldset
          label={t(
            "pages.explorer.endpoint.editor.form.plugins.target.targetFlow.workflow"
          )}
        >
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetNamespaceFileForm.tsx on lines 88..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 118.

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

        <Fieldset
          label={t(
            "pages.explorer.endpoint.editor.form.plugins.target.targetNamespaceFile.file"
          )}
        >
ui/src/pages/namespace/Explorer/Endpoint/EndpointEditor/Form/plugins/Target/TargetFlowForm.tsx on lines 94..111

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

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 className="flex items-center gap-5">
                    <label
                      className="w-[112px] overflow-hidden text-right text-[14px]"
                      htmlFor="passphrase"
                    >
Severity: Major
Found in ui/src/components/NamespaceEdit/index.tsx and 4 other locations - About 4 hrs to fix
ui/src/components/NamespaceEdit/index.tsx on lines 319..337
ui/src/components/NamespaceEdit/index.tsx on lines 369..389
ui/src/components/NamespaceEdit/index.tsx on lines 415..435
ui/src/components/NamespaceEdit/index.tsx on lines 437..457

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

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

export const Authdialog = () => {
  const { t } = useTranslation();
  const [showKey, setShowKey] = useState(false);
  const { setApiKey: storeApiKey } = useApiActions();
  const apiKeyFromLocalStorage = useApiKey();
Severity: Major
Found in ui/src/components/Authdialog/index.tsx - About 4 hrs to fix

    Function MirrorDetail has 103 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const MirrorDetail = () => {
      const { data, isAllowed, noPermissionMessage, isFetched } = useListSyncs();
      const namespace = useNamespace();
      const namespaceDetail = useNamespaceDetail();
    
    
    Severity: Major
    Found in ui/src/pages/namespace/Mirror/Detail/index.tsx - About 4 hrs to fix

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

            if (value.states[i]?.transition) {
              transitions = true;
      
              newElements.push({
                id: `${value.states[i]?.id}-${value.states[i]?.transition}`,
      Severity: Major
      Found in ui/src/design/WorkflowDiagram/utils.ts and 1 other location - About 4 hrs to fix
      ui/src/design/WorkflowDiagram/utils.ts on lines 166..185

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

      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

            } else if (value.states[i]?.defaultTransition) {
              transitions = true;
      
              newElements.push({
                id: `${value.states[i]?.id}-${value.states[i]?.defaultTransition}`,
      Severity: Major
      Found in ui/src/design/WorkflowDiagram/utils.ts and 1 other location - About 4 hrs to fix
      ui/src/design/WorkflowDiagram/utils.ts on lines 156..185

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

      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

      File index.spec.ts has 337 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { createNamespace, deleteNamespace } from "e2e/utils/namespace";
      import { expect, test } from "@playwright/test";
      import {
        expectedSnippetOutput,
        getCommonElements,
      Severity: Minor
      Found in ui/e2e/jqplayground/index.spec.ts - About 4 hrs to fix

        Function InitPubSub has a Cognitive Complexity of 43 (exceeds 20 allowed). Consider refactoring.
        Open

        func InitPubSub(notifier Notifier, database string) (*Pubsub, error) {
            reportProblem := func(ev pq.ListenerEventType, err error) {
                if err != nil {
                    slog.Error("PubSub listener encountered an error.", "error", err, "event_type", ev)
        
        
        Severity: Minor
        Found in pkg/flow/pubsub/pubsub.go - About 4 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function LogsPanel has 102 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const LogsPanel = () => {
          const { t } = useTranslation();
          const { setVerboseLogs, setMaximizedPanel } = useLogsPreferencesActions();
        
          const instanceId = useInstanceId();
        Severity: Major
        Found in ui/src/pages/namespace/Instances/Detail/Main/Logs/index.tsx - About 4 hrs to fix

          File index.spec.ts has 332 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import { createNamespace, deleteNamespace } from "../../utils/namespace";
          import { expect, test } from "@playwright/test";
          import {
            parentWorkflow as parentWorkflowContent,
            simpleWorkflow as simpleWorkflowContent,
          Severity: Minor
          Found in ui/e2e/instances/filter/index.spec.ts - About 4 hrs to fix

            Function checkInstanceRender has 98 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              const checkInstanceRender = async (instance: Instance) => {
                const instancesList = await getInstances({
                  urlParams: {
                    baseUrl: process.env.PLAYWRIGHT_UI_BASE_URL,
                    namespace,
            Severity: Major
            Found in ui/e2e/instances/list/index.spec.ts - About 3 hrs to fix

              Function GroupsPage has 96 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const GroupsPage = () => {
                const { t } = useTranslation();
                const { data, isFetched, isAllowed, noPermissionMessage } = useGroups();
                const noResults = isFetched && data?.groups.length === 0;
                const [dialogOpen, setDialogOpen] = useState(false);
              Severity: Major
              Found in ui/src/pages/namespace/Permissions/Groups/index.tsx - About 3 hrs to fix

                Method parallelLogic.processActionResults has 120 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                func (logic *parallelLogic) processActionResults(ctx context.Context, children []*ChildInfo, results *actionResultPayload) (*Transition, error) {
                    var err error
                
                    var found bool
                    var idx int
                Severity: Major
                Found in pkg/flow/states/parallel.go - About 3 hrs to fix

                  Method engine.NewInstance has 119 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

                  func (engine *engine) NewInstance(ctx context.Context, args *newInstanceArgs) (*instanceMemory, error) {
                      ctx = tracing.AddInstanceAttr(ctx, tracing.InstanceAttributes{
                          Namespace:    args.Namespace.Name,
                          InstanceID:   args.ID.String(),
                          Invoker:      args.Invoker,
                  Severity: Major
                  Found in pkg/flow/engine.go - About 3 hrs to fix

                    File index.tsx has 323 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import { Plus, X } from "lucide-react";
                    import { Popover, PopoverContent, PopoverTrigger } from "~/design/Popover";
                    
                    import Button from "~/design/Button";
                    import { ButtonBar } from "~/design/ButtonBar";
                    Severity: Minor
                    Found in ui/src/pages/namespace/Instances/components/Filters/index.tsx - About 3 hrs to fix

                      Function InstancesListPage has 93 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const InstancesListPage = () => {
                        const [offset, setOffset] = useState(0);
                        const [filters, setFilters] = useState<FiltersObj>({});
                        const { t } = useTranslation();
                        const { data, isSuccess, isAllowed, noPermissionMessage } = useInstances({
                      Severity: Major
                      Found in ui/src/pages/namespace/Instances/List/index.tsx - About 3 hrs to fix

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

                        const updateCache = (
                          oldData: TokenListSchemaType | undefined,
                          variables: Parameters<ReturnType<typeof useDeleteToken>["mutate"]>[0]
                        ) => {
                          if (!oldData) return undefined;
                        Severity: Major
                        Found in ui/src/api/enterprise/tokens/mutate/delete.ts and 1 other location - About 3 hrs to fix
                        ui/src/api/enterprise/groups/mutation/delete.ts on lines 16..28

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

                        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 updateCache = (
                          oldData: GroupsListSchemaType | undefined,
                          variables: Parameters<ReturnType<typeof useDeleteGroup>["mutate"]>[0]
                        ) => {
                          if (!oldData) return undefined;
                        Severity: Major
                        Found in ui/src/api/enterprise/groups/mutation/delete.ts and 1 other location - About 3 hrs to fix
                        ui/src/api/enterprise/tokens/mutate/delete.ts on lines 16..28

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

                        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