vorteil/direktiv

View on GitHub

Showing 463 of 1,333 total issues

Function generateElements has a Cognitive Complexity of 145 (exceeds 5 allowed). Consider refactoring.
Open

export function generateElements(
  getLayoutedElements: (
    incomingEles: (Node | Edge)[],
    orientation: Orientation
  ) => (Node | Edge)[],
Severity: Minor
Found in ui/src/design/WorkflowDiagram/utils.ts - About 2 days 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

File flow.go has 1224 lines of code (exceeds 500 allowed). Consider refactoring.
Open

package api

import (
    "bytes"
    "context"
Severity: Major
Found in pkg/api/flow.go - About 2 days to fix

    File languageSamples.ts has 861 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    export const HtmlSample = `
    <!DOCTYPE HTML>
    <!--Example of comments in HTML-->
    <html>
    <head>
    Severity: Major
    Found in ui/src/design/Editor/languageSamples.ts - About 2 days to fix

      Method node.findRoute has a Cognitive Complexity of 103 (exceeds 20 allowed). Consider refactoring.
      Open

      func (n *node) findRoute(rctx *Context, method methodTyp, path string) *node {
          nn := n
          search := path
      
          for t, nds := range nn.children {
      Severity: Minor
      Found in pkg/refactor/gateway/endpoints/tree.go - About 1 day 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

      File pages.tsx has 677 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import {
        ActivitySquare,
        BadgeCheck,
        Boxes,
        FolderTree,
      Severity: Major
      Found in ui/src/util/router/pages.tsx - About 1 day to fix

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

        import { createNamespace, deleteNamespace } from "../../utils/namespace";
        import { expect, test } from "@playwright/test";
        import {
          jsonSchemaFormWorkflow,
          jsonSchemaWithRequiredEnum,
        Severity: Major
        Found in ui/e2e/explorer/workflow/run.spec.ts - About 1 day to fix

          Method flowHandler.WaitWorkflow has a Cognitive Complexity of 77 (exceeds 20 allowed). Consider refactoring.
          Open

          func (h *flowHandler) WaitWorkflow(w http.ResponseWriter, r *http.Request) {
              slog.Debug("Handling request", "this", this())
          
              ctx := r.Context()
              namespace := mux.Vars(r)["ns"]
          Severity: Minor
          Found in pkg/api/flow.go - About 1 day 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 MoreDetailedShell has 236 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const MoreDetailedShell = () => {
            const [theme, setTheme] = useState<"light" | "dark" | undefined>();
          
            useEffect(() => {
              const html = document.documentElement;
          Severity: Major
          Found in ui/src/design/Appshell/index.stories.tsx - About 1 day to fix

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

            import {
              checkIfNamespaceExists,
              createNamespace,
              createNamespaceName,
              deleteNamespace,
            Severity: Major
            Found in ui/e2e/explorer/index.spec.ts - About 1 day to fix

              File engine.go has 788 lines of code (exceeds 500 allowed). Consider refactoring.
              Open

              package flow
              
              import (
                  "context"
                  "encoding/base64"
              Severity: Major
              Found in pkg/flow/engine.go - About 1 day to fix

                Function generateElements has 184 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function generateElements(
                  getLayoutedElements: (
                    incomingEles: (Node | Edge)[],
                    orientation: Orientation
                  ) => (Node | Edge)[],
                Severity: Major
                Found in ui/src/design/WorkflowDiagram/utils.ts - About 7 hrs to fix

                  Function SecretsList has 183 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const SecretsList: FC = () => {
                    const { t } = useTranslation();
                    const [dialogOpen, setDialogOpen] = useState(false);
                    const [deleteSecret, setDeleteSecret] = useState<SecretSchemaType>();
                    const [editItem, setEditItem] = useState<SecretSchemaType>();
                  Severity: Major
                  Found in ui/src/pages/namespace/Settings/Secrets/index.tsx - About 7 hrs to fix

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

                    import {
                      Box,
                      Bug,
                      Calendar,
                      ChevronsUpDown,
                    Severity: Minor
                    Found in ui/src/design/Appshell/index.stories.tsx - About 7 hrs to fix

                      Pubsub has 50 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      type Pubsub struct {
                          id       uuid.UUID
                          notifier Notifier
                      
                          handlers map[string]func(*PubsubUpdate)
                      Severity: Minor
                      Found in pkg/flow/pubsub/pubsub.go - About 7 hrs to fix

                        Function VariablesList has 165 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const VariablesList: FC = () => {
                          const { t } = useTranslation();
                          const [dialogOpen, setDialogOpen] = useState(false);
                          const [deleteItem, setDeleteItem] = useState<VarSchemaType>();
                          const [editItem, setEditItem] = useState<VarSchemaType>();
                        Severity: Major
                        Found in ui/src/pages/namespace/Settings/Variables/index.tsx - About 6 hrs to fix

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

                          import {
                            DialogClose,
                            DialogFooter,
                            DialogHeader,
                            DialogTitle,
                          Severity: Minor
                          Found in ui/src/components/NamespaceEdit/index.tsx - About 6 hrs to fix

                            Function JqPlaygroundPage has 155 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const JqPlaygroundPage: FC = () => {
                              const { t } = useTranslation();
                              const theme = useTheme();
                              const {
                                setInput: storeInputInLocalstorage,
                            Severity: Major
                            Found in ui/src/pages/namespace/JqPlayground/index.tsx - About 6 hrs to fix

                              File apiFactory.test.ts has 414 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import "cross-fetch/polyfill";
                              
                              import { ResponseParser, apiFactory } from "../apiFactory";
                              import {
                                afterAll,
                              Severity: Minor
                              Found in ui/src/api/__tests__/apiFactory.test.ts - About 5 hrs to fix

                                Function Header has 148 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const Header: FC = () => {
                                  const { t } = useTranslation();
                                  const {
                                    path,
                                    isWorkflowEditorPage,
                                Severity: Major
                                Found in ui/src/pages/namespace/Explorer/Workflow/index.tsx - About 5 hrs to fix

                                  Method engine.runState has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring.
                                  Open

                                  func (engine *engine) runState(ctx context.Context, im *instanceMemory, wakedata []byte, err error) *states.Transition {
                                      loggingCtx := im.Namespace().WithTags(ctx)
                                      instanceTrackCtx := enginerefactor.WithTrack(loggingCtx, enginerefactor.BuildInstanceTrack(im.instance))
                                      slog.Debug("Starting state execution.", enginerefactor.GetSlogAttributesWithStatus(ctx, core.LogRunningStatus)...)
                                  
                                  
                                  Severity: Minor
                                  Found in pkg/flow/engine.go - About 5 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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language