vorteil/direktiv

View on GitHub

Showing 463 of 1,333 total issues

flowHandler has 40 methods (exceeds 20 allowed). Consider refactoring.
Open

type flowHandler struct {
    client     grpc.FlowClient
    prometheus prometheus.Client

    apiV2Address string
Severity: Minor
Found in pkg/api/flow.go - About 5 hrs to fix

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

      const Layout = () => {
        const { t } = useTranslation();
        const {
          data: availableNamespaces,
          isFetched,
      Severity: Major
      Found in ui/src/pages/OnboardingPage.tsx - About 4 hrs to fix

        Function Instances has 116 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const Instances = () => {
          const {
            data: sucessfullInstances,
            isFetched: isFetchedSucessfullInstances,
            isFetching: isFetchingSucessfullinstances,
        Severity: Major
        Found in ui/src/pages/namespace/Monitoring/Instances/index.tsx - About 4 hrs to fix

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

          const ChildInstances = () => {
            const instanceId = useInstanceId();
            const namespace = useNamespace();
            const [popoverOpen, setPopoverOpen] = useState(false);
            const { data, refetch, isFetching } = useInstances({
          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/refactor/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

            Function initLegacyServer has 136 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func initLegacyServer(circuit *core.Circuit, config *core.Config, db *gorm.DB, dbManager *database.SQLStore) (*server, error) {
                srv := new(server)
                srv.ID = uuid.New()
                srv.initJQ()
                srv.config = config
            Severity: Major
            Found in pkg/flow/server.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:

                Function checkInstanceRender has 107 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 4 hrs to fix

                  Function Initialize has 131 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

                  func Initialize(app core.App, db *database.SQLStore, bus *pubsub2.Bus, instanceManager *instancestore.InstanceManager, addr string, circuit *core.Circuit) error {
                      funcCtr := &serviceController{
                          manager: app.ServiceManager,
                      }
                      fsCtr := &fsController{
                  Severity: Major
                  Found in pkg/refactor/api/api.go - About 4 hrs to fix

                    Method flowHandler.WaitWorkflow has 130 lines of code (exceeds 50 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: Major
                    Found in pkg/api/flow.go - About 4 hrs to fix

                      Function Activities has 105 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const Activities = () => {
                        const { data, isAllowed, noPermissionMessage, isFetched } = useMirrorInfo();
                        const { t } = useTranslation();
                        const queryClient = useQueryClient();
                        const apiKey = useApiKey();
                      Severity: Major
                      Found in ui/src/pages/namespace/Mirror/Activities/index.tsx - About 4 hrs to fix

                        Function InitTelemetry has 128 lines of code (exceeds 50 allowed). Consider refactoring.
                        Open

                        func InitTelemetry(addr string, svcName, imName string) (func(), error) {
                            instrumentationName = imName
                        
                            var prop propagation.TextMapPropagator
                            prop = propagation.TraceContext{}
                        Severity: Major
                        Found in pkg/util/telemetry.go - About 4 hrs to fix

                          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 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)
                                        os.Exit(1)
                            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 NamespaceEdit has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                            Open

                            const NamespaceEdit = ({
                              mirror,
                              close,
                            }: {
                              mirror?: MirrorInfoSchemaType;
                            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 ExplorerPage has 102 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const ExplorerPage: FC = () => {
                              const namespace = useNamespace();
                              const { path } = pages.explorer.useParams();
                              const { data, isSuccess, isFetched, isAllowed, noPermissionMessage } =
                                useFile({
                            Severity: Major
                            Found in ui/src/pages/namespace/Explorer/Tree/index.tsx - About 4 hrs to fix

                              File index.spec.ts has 333 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
                                Severity
                                Category
                                Status
                                Source
                                Language