vorteil/direktiv

View on GitHub

Showing 407 of 1,235 total issues

Method parallelLogic.processActionResults has a Cognitive Complexity of 50 (exceeds 20 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: Minor
Found in pkg/flow/states/parallel.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

Function Layout has 131 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const Layout = () => {
  const pages = usePages();
  const { t } = useTranslation();
  const { usesAccounts } = useApiKeyHandling();
  const {
Severity: Major
Found in ui/src/pages/OnboardingPage/index.tsx - About 5 hrs to fix

    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

        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

          Function ChildInstances has 117 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const ChildInstances = () => {
            const pages = usePages();
            const instanceId = useInstanceId();
            const namespace = useNamespace();
            const [popoverOpen, setPopoverOpen] = useState(false);
          Severity: Major
          Found in ui/src/pages/namespace/Instances/Detail/Header/ChildInstances.tsx - About 4 hrs to fix

            Function recurseIntoString has a Cognitive Complexity of 46 (exceeds 20 allowed). Consider refactoring.
            Open

            func recurseIntoString(data interface{}, s string) ([]interface{}, error) {
                out := make([]interface{}, 0)
            
                if TrimWhitespaceOnQueryStrings {
                    s = strings.TrimSpace(s)
            Severity: Minor
            Found in pkg/jqer/jqer.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 generateGetInstancesFilters has a Cognitive Complexity of 46 (exceeds 20 allowed). Consider refactoring.
            Open

            func generateGetInstancesFilters(opts *instancestore.ListOpts) ([]string, []interface{}, error) {
                if opts == nil {
                    return []string{}, []interface{}{}, nil
                }
            
            
            Severity: Minor
            Found in pkg/instancestore/instancestoresql/sql_builders.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

            File instances.go has 601 lines of code (exceeds 500 allowed). Consider refactoring.
            Open

            package api
            
            import (
                "bytes"
                "context"
            Severity: Minor
            Found in pkg/api/instances.go - About 4 hrs to fix

              File templates.tsx has 350 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              export const noop = {
                name: "noop",
                data: `direktiv_api: workflow/v1
              description: A simple 'no-op' state that returns 'Hello world!'
              states:

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

                import { createFile, deleteFile } from "e2e/utils/files";
                import {
                  createHttpServiceFile,
                  findServiceWithApiRequest,
                  serviceWithAnError,
                Severity: Minor
                Found in ui/e2e/services/list.spec.ts - About 4 hrs to fix

                  Function NamespaceEdit has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const NamespaceEdit = ({
                    mirror,
                    close,
                  }: {
                    mirror?: MirrorSchemaType;
                  Severity: Minor
                  Found in ui/src/components/NamespaceEdit/index.tsx - 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 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

                      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
                                Severity
                                Category
                                Status
                                Source
                                Language