vorteil/direktiv

View on GitHub

Showing 407 of 1,235 total issues

Method parallelLogic.processActionResults has 120 lines of code (exceeds 50 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: Major
Found in pkg/flow/states/parallel.go - About 3 hrs to fix

    Method engine.NewInstance has 119 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func (engine *engine) NewInstance(ctx context.Context, args *newInstanceArgs) (*instanceMemory, error) {
        ctx = tracing.AddInstanceAttr(ctx, tracing.InstanceAttributes{
            Namespace:    args.Namespace.Name,
            InstanceID:   args.ID.String(),
            Invoker:      args.Invoker,
    Severity: Major
    Found in pkg/flow/engine.go - About 3 hrs to fix

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

      import { Plus, X } from "lucide-react";
      import { Popover, PopoverContent, PopoverTrigger } from "~/design/Popover";
      
      import Button from "~/design/Button";
      import { ButtonBar } from "~/design/ButtonBar";
      Severity: Minor
      Found in ui/src/pages/namespace/Instances/components/Filters/index.tsx - About 3 hrs to fix

        Function InstancesListPage has 93 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const InstancesListPage = () => {
          const [offset, setOffset] = useState(0);
          const [filters, setFilters] = useState<FiltersObj>({});
          const { t } = useTranslation();
          const { data, isSuccess, isAllowed, noPermissionMessage } = useInstances({
        Severity: Major
        Found in ui/src/pages/namespace/Instances/List/index.tsx - About 3 hrs to fix

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

          export const Instances = () => {
            const {
              data: dataSuccessfulInstances,
              isFetched: isFetchedSuccessfulInstances,
              isAllowed: isAllowedSuccessfulInstances,
          Severity: Major
          Found in ui/src/pages/namespace/Monitoring/Instances/index.tsx - About 3 hrs to fix

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

            import { createNamespace, deleteNamespace } from "../../utils/namespace";
            import { expect, test } from "@playwright/test";
            import {
              workflowWithFewLogs as fewLogsWorkflowContent,
              workflowWithManyLogs as manyLogsWorkflowContent,
            Severity: Minor
            Found in ui/e2e/instances/details/logs.spec.ts - About 3 hrs to fix

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

              import {
                PatchOperationType,
                PatchOperations,
                PatchSchemaType,
              } from "~/pages/namespace/Explorer/Service/ServiceEditor/schema";
              Severity: Minor
              Found in ui/e2e/explorer/service/index.spec.ts - About 3 hrs to fix

                Method setterLogic.Run has a Cognitive Complexity of 40 (exceeds 20 allowed). Consider refactoring.
                Open

                func (logic *setterLogic) Run(ctx context.Context, wakedata []byte) (*Transition, error) {
                    err := scheduleOnce(logic, wakedata)
                    if err != nil {
                        return nil, err
                    }
                Severity: Minor
                Found in pkg/flow/states/setter.go - About 3 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 describePagination has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                Open

                const describePagination = ({
                  pages,
                  currentPage: current,
                  neighbours = 1,
                }: {
                Severity: Minor
                Found in ui/src/components/Pagination/describePagination.ts - About 3 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 RunWorkflow has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                Open

                const RunWorkflow = ({ path }: { path: string }) => {
                  const pages = usePages();
                  const { toast } = useToast();
                  const { t } = useTranslation();
                  const theme = useTheme();
                Severity: Minor
                Found in ui/src/pages/namespace/Explorer/Workflow/components/RunWorkflow.tsx - About 3 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 Header has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const Header = () => {
                  const pages = usePages();
                  const instanceId = useInstanceId();
                  const { data: instance } = useInstanceDetails({ instanceId });
                  const { mutate: cancelInstance, isPending } = useCancelInstance();
                Severity: Major
                Found in ui/src/pages/namespace/Instances/Detail/Header/index.tsx - About 3 hrs to fix

                  Function TimePickerInput has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                  Open

                    (
                      {
                        className,
                        type = "tel",
                        value,
                  Severity: Minor
                  Found in ui/src/design/Timepicker/Input.tsx - About 3 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 index.stories.tsx has 308 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import Button from "../Button";
                  import { ButtonBar } from "../ButtonBar";
                  import { Card } from "../Card";
                  import { Orientation } from "./types";
                  import WorkflowDiagram from "./index";
                  Severity: Minor
                  Found in ui/src/design/WorkflowDiagram/index.stories.tsx - About 3 hrs to fix

                    Method engine.runState has 109 lines of code (exceeds 50 allowed). Consider refactoring.
                    Open

                    func (engine *engine) runState(ctx context.Context, im *instanceMemory, wakedata []byte, err error) *states.Transition {
                        ctx = tracing.AddNamespace(ctx, im.Namespace().Name)
                        ctx = tracing.WithTrack(ctx, tracing.BuildInstanceTrack(im.instance))
                        ctx, cleanup, err3 := tracing.NewSpan(ctx, "preparing instance for state execution")
                        if err != nil {
                    Severity: Major
                    Found in pkg/flow/engine.go - About 3 hrs to fix

                      File index.spec.ts has 305 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/list/index.spec.ts - About 3 hrs to fix

                        Method forEachLogic.processActionResults has a Cognitive Complexity of 38 (exceeds 20 allowed). Consider refactoring.
                        Open

                        func (logic *forEachLogic) 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/foreach.go - About 3 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 TokensPage has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const TokensPage = () => {
                          const { t } = useTranslation();
                          const { data, isFetched, isAllowed, noPermissionMessage } = useTokens();
                          const noResults = isFetched && data?.tokens.length === 0;
                          const [dialogOpen, setDialogOpen] = useState(false);
                        Severity: Major
                        Found in ui/src/pages/namespace/Permissions/Tokens/index.tsx - About 3 hrs to fix

                          Function ZoomPanDiagram has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export function ZoomPanDiagram(props: ZoomPanDiagramProps) {
                            const { elements, disabled, orientation } = props;
                            const { fitView, zoomIn, zoomOut } = useReactFlow();
                            const [showMinimap, setShowMinimap] = useState(true);
                            const nodesInitialized = useNodesInitialized();
                          Severity: Major
                          Found in ui/src/design/WorkflowDiagram/ZoomPanDiagram.tsx - About 3 hrs to fix

                            Method forEachLogic.processActionResults has 105 lines of code (exceeds 50 allowed). Consider refactoring.
                            Open

                            func (logic *forEachLogic) processActionResults(ctx context.Context, children []*ChildInfo, results *actionResultPayload) (*Transition, error) {
                                var err error
                            
                                var found bool
                                var idx int
                            Severity: Major
                            Found in pkg/flow/states/foreach.go - About 3 hrs to fix

                              File temporary.go has 550 lines of code (exceeds 500 allowed). Consider refactoring.
                              Open

                              package flow
                              
                              import (
                                  "context"
                                  "encoding/json"
                              Severity: Minor
                              Found in pkg/flow/temporary.go - About 3 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language