vorteil/direktiv

View on GitHub

Showing 1,235 of 1,235 total issues

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

func (logic *eventsAndLogic) Deadline(ctx context.Context) time.Time {
    d, err := duration.ParseISO8601(logic.Timeout)
    if err != nil {
        logic.Log(ctx, log.Error, "failed to parse duration: %v", err)
        return time.Now().UTC().Add(DefaultLongDeadline)
Severity: Major
Found in pkg/flow/states/eventsAnd.go and 2 other locations - About 1 hr to fix
pkg/flow/states/consumeEvent.go on lines 39..49
pkg/flow/states/eventsXor.go on lines 39..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 145.

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

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

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

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

Refactorings

Further Reading

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

func (logic *consumeEventLogic) Deadline(ctx context.Context) time.Time {
    d, err := duration.ParseISO8601(logic.Timeout)
    if err != nil {
        logic.Log(ctx, log.Error, "failed to parse duration: %v", err)
        return time.Now().UTC().Add(DefaultLongDeadline)
Severity: Major
Found in pkg/flow/states/consumeEvent.go and 2 other locations - About 1 hr to fix
pkg/flow/states/eventsAnd.go on lines 40..50
pkg/flow/states/eventsXor.go on lines 39..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 145.

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

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

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

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

Refactorings

Further Reading

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

func (logic *eventsXorLogic) Deadline(ctx context.Context) time.Time {
    d, err := duration.ParseISO8601(logic.Timeout)
    if err != nil {
        logic.Log(ctx, log.Error, "failed to parse duration: %v", err)
        return time.Now().UTC().Add(DefaultLongDeadline)
Severity: Major
Found in pkg/flow/states/eventsXor.go and 2 other locations - About 1 hr to fix
pkg/flow/states/consumeEvent.go on lines 39..49
pkg/flow/states/eventsAnd.go on lines 40..50

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

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 edges: Edge[] = elements.filter(
      (ele: Node | Edge) => !!(ele as Edge).source
    ) as Edge[];
Severity: Major
Found in ui/src/design/WorkflowDiagram/ZoomPanDiagram.tsx and 1 other location - About 1 hr to fix
ui/src/design/WorkflowDiagram/ZoomPanDiagram.tsx on lines 39..41

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

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 nodes: Node[] = elements.filter(
      (ele: Node | Edge) => !!(ele as Node).position
    ) as Node[];
Severity: Major
Found in ui/src/design/WorkflowDiagram/ZoomPanDiagram.tsx and 1 other location - About 1 hr to fix
ui/src/design/WorkflowDiagram/ZoomPanDiagram.tsx on lines 43..45

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

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

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

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

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

Refactorings

Further Reading

Method RequestConvertPlugin.Execute has 56 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (rcp *RequestConvertPlugin) Execute(w http.ResponseWriter, r *http.Request) *http.Request {
    response := &RequestConvertResponse{
        URLParams:   make(map[string]string),
        QueryParams: make(map[string][]string),
        Consumer: RequestConsumer{
Severity: Minor
Found in pkg/gateway/plugins/inbound/request-convert.go - About 1 hr to fix

    Method engine.handleInstanceMessage has 56 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func (engine *engine) handleInstanceMessage(ctx context.Context, im *instanceMemory, msg *instancestore.InstanceMessageData) *states.Transition {
        instanceCtx := tracing.AddInstanceMemoryAttr(ctx,
            tracing.InstanceAttributes{
                Namespace:    im.Namespace().Name,
                InstanceID:   im.GetInstanceID().String(),
    Severity: Minor
    Found in pkg/flow/instance_messages.go - About 1 hr to fix

      Method actionLogic.scheduleAction has 56 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func (logic *actionLogic) scheduleAction(ctx context.Context, attempt int) error {
          input, files, err := generateActionInput(ctx, &generateActionInputArgs{
              Instance: logic.Instance,
              Source:   logic.GetInstanceData(),
              Action:   logic.Action,
      Severity: Minor
      Found in pkg/flow/states/action.go - About 1 hr to fix

        Method varController.list has 56 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func (e *varController) list(w http.ResponseWriter, r *http.Request) {
            // handle raw var read.
            if r.URL.Query().Get("raw") == "true" {
                e.listRaw(w, r)
                return
        Severity: Minor
        Found in pkg/api/variables.go - About 1 hr to fix

          Method engine.executor has 55 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func (engine *engine) executor(ctx context.Context, id uuid.UUID) {
              var im *instanceMemory
          
              for attempts := range 3 {
                  if attempts > 0 {
          Severity: Minor
          Found in pkg/flow/scheduling.go - About 1 hr to fix

            Function Breadcrumb has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const Breadcrumb = () => {
              const pages = usePages();
              const namespace = useNamespace();
              const { isExplorerPage } = pages.explorer.useParams();
              const { isInstancePage } = pages.instances.useParams();
            Severity: Minor
            Found in ui/src/components/Breadcrumb/index.tsx - About 1 hr to fix

              Function ScrollContainer has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const ScrollContainer = () => {
                const {
                  rowVirtualizer,
                  parentRef,
                  logLines,
              Severity: Minor
              Found in ui/src/pages/namespace/Monitoring/Logs/Scrollcontainer.tsx - About 1 hr to fix

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

                  page.on("dialog", async (dialog) => {
                    await expect(dialog.message()).toBe(expectedMsg);
                    dialogTriggered = true;
                    return dialog.accept();
                  });
                Severity: Major
                Found in ui/e2e/explorer/workflow/codeEditor.spec.ts and 3 other locations - About 1 hr to fix
                ui/e2e/explorer/workflow/codeEditor.spec.ts on lines 166..170
                ui/e2e/explorer/workflow/codeEditor.spec.ts on lines 199..203
                ui/e2e/explorer/workflow/codeEditor.spec.ts on lines 229..233

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

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

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

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

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

                Refactorings

                Further Reading

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

                  page.on("dialog", async (dialog) => {
                    await expect(dialog.message()).toBe(expectedMsg);
                    dialogTriggered = true;
                    return dialog.accept();
                  });
                Severity: Major
                Found in ui/e2e/explorer/workflow/codeEditor.spec.ts and 3 other locations - About 1 hr to fix
                ui/e2e/explorer/workflow/codeEditor.spec.ts on lines 166..170
                ui/e2e/explorer/workflow/codeEditor.spec.ts on lines 229..233
                ui/e2e/explorer/workflow/codeEditor.spec.ts on lines 268..272

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

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

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

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

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

                Refactorings

                Further Reading

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

                  page.on("dialog", async (dialog) => {
                    await expect(dialog.message()).toBe(expectedMsg);
                    dialogTriggered = true;
                    return dialog.dismiss();
                  });
                Severity: Major
                Found in ui/e2e/explorer/workflow/codeEditor.spec.ts and 3 other locations - About 1 hr to fix
                ui/e2e/explorer/workflow/codeEditor.spec.ts on lines 199..203
                ui/e2e/explorer/workflow/codeEditor.spec.ts on lines 229..233
                ui/e2e/explorer/workflow/codeEditor.spec.ts on lines 268..272

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

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

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

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

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

                Refactorings

                Further Reading

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

                  page.on("dialog", async (dialog) => {
                    await expect(dialog.message()).toBe(expectedMsg);
                    dialogTriggered = true;
                    return dialog.dismiss();
                  });
                Severity: Major
                Found in ui/e2e/explorer/workflow/codeEditor.spec.ts and 3 other locations - About 1 hr to fix
                ui/e2e/explorer/workflow/codeEditor.spec.ts on lines 166..170
                ui/e2e/explorer/workflow/codeEditor.spec.ts on lines 199..203
                ui/e2e/explorer/workflow/codeEditor.spec.ts on lines 268..272

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

                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

                  await expect(
                    page.getByTestId("route-details-header").getByRole("textbox"),
                    "it renders the text for the path"
                  ).toHaveValue(
                    `${process.env.PLAYWRIGHT_UI_BASE_URL}/ns/${namespace}/${path}`
                Severity: Major
                Found in ui/e2e/gateway/routes/details/index.spec.ts and 1 other location - About 1 hr to fix
                ui/e2e/gateway/routes/list/index.spec.ts on lines 79..84

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

                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 mutationFn = ({ variable }: { variable: VarSchemaType }) =>
                    deleteVar({
                      apiKey: apiKey ?? undefined,
                      urlParams: {
                        namespace,
                Severity: Major
                Found in ui/src/api/variables/mutate/delete.ts and 1 other location - About 1 hr to fix
                ui/src/api/registries/mutate/deleteRegistry.ts on lines 55..62

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

                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

                  await expect(
                    page.getByTestId("route-table").getByRole("textbox"),
                    "it renders the text for the path"
                  ).toHaveValue(
                    `${process.env.PLAYWRIGHT_UI_BASE_URL}/ns/${namespace}/${path}`
                Severity: Major
                Found in ui/e2e/gateway/routes/list/index.spec.ts and 1 other location - About 1 hr to fix
                ui/e2e/gateway/routes/details/index.spec.ts on lines 100..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 59.

                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

                    mutationFn: ({ registry }: { registry: RegistrySchemaType }) =>
                      deleteRegistry({
                        apiKey: apiKey ?? undefined,
                        urlParams: {
                          namespace,
                Severity: Major
                Found in ui/src/api/registries/mutate/deleteRegistry.ts and 1 other location - About 1 hr to fix
                ui/src/api/variables/mutate/delete.ts on lines 34..41

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

                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