vorteil/direktiv

View on GitHub

Showing 425 of 1,264 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

Function usePages has 462 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const usePages = (): PageType & EnterprisePageType => {
  const enterprisePages: EnterprisePageType = isEnterprise()
    ? {
        permissions: {
          name: "components.mainMenu.permissions",
Severity: Major
Found in ui/src/util/router/pages.tsx - 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

      File pages.tsx has 691 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 603 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

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

          import { checkIfFileExists, createDirectory } from "e2e/utils/files";
          import {
            checkIfNamespaceExists,
            createNamespace,
            createNamespaceName,
          Severity: Major
          Found in ui/e2e/explorer/index.spec.ts - About 1 day to fix

            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

              Function buildRouter has a Cognitive Complexity of 75 (exceeds 20 allowed). Consider refactoring.
              Open

              func buildRouter(endpoints []core.Endpoint, consumers []core.Consumer) *router {
                  serveMux := http.NewServeMux()
              
                  for i, item := range endpoints {
                      // don't process endpoints with errors
              Severity: Minor
              Found in pkg/gateway/router.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 JqPlaygroundPage has 214 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

                File engine.go has 762 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 usePages has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const usePages = (): PageType & EnterprisePageType => {
                    const enterprisePages: EnterprisePageType = isEnterprise()
                      ? {
                          permissions: {
                            name: "components.mainMenu.permissions",
                  Severity: Minor
                  Found in ui/src/util/router/pages.tsx - About 7 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 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

                        File index.tsx has 454 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 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

                            Method engine.runState has a Cognitive Complexity of 56 (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 := tracing.WithTrack(loggingCtx, tracing.BuildInstanceTrack(im.instance))
                                slog.Debug("Starting state execution.", tracing.GetSlogAttributesWithStatus(ctx, core.LogRunningStatus)...)
                            
                            
                            Severity: Minor
                            Found in pkg/flow/engine.go - About 6 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

                            File apiFactory.test.ts has 418 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 6 hrs to fix

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

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

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

                                import { createNamespace, deleteNamespace } from "e2e/utils/namespace";
                                import { createRouteYaml, removeLines } from "./utils";
                                import { expect, test } from "@playwright/test";
                                
                                import { createFile } from "e2e/utils/files";
                                Severity: Minor
                                Found in ui/e2e/explorer/route/index.spec.ts - About 5 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language