vorteil/direktiv

View on GitHub

Showing 463 of 1,333 total issues

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

    Function LogsPanel has 96 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 3 hrs to fix

      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

        Function NamespaceSelector has 94 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const NamespaceSelector = () => {
          const { t } = useTranslation();
          const namespace = useNamespace();
          const {
            data: availableNamespaces,
        Severity: Major
        Found in ui/src/components/Breadcrumb/NamespaceSelector.tsx - About 3 hrs to fix

          Function ToGRPCCloudEvents has a Cognitive Complexity of 41 (exceeds 20 allowed). Consider refactoring.
          Open

          func ToGRPCCloudEvents(r *http.Request) ([]cloudevents.Event, error) {
              var events []cloudevents.Event
              ct := r.Header.Get("Content-type")
              oct := ct
          
          
          Severity: Minor
          Found in pkg/api/flow.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

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

          func (engine *engine) NewInstance(ctx context.Context, args *newInstanceArgs) (*instanceMemory, error) {
              slog.Debug("Initializing new instance creation.", "namespace", args.Namespace.Name, "workflow", args.CalledAs, "invoker", args.Invoker)
              file, data, err := engine.mux(ctx, args.Namespace, args.CalledAs)
              loggingCtx := args.Namespace.WithTags(ctx)
              loggingCtx = enginerefactor.AddTag(loggingCtx, "calledAs", args.CalledAs)
          Severity: Major
          Found in pkg/flow/engine.go - About 3 hrs to fix

            Function InstancesListPage has 91 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, isFetched, isAllowed, noPermissionMessage } = useInstances({
            Severity: Major
            Found in ui/src/pages/namespace/Instances/List/index.tsx - 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 { toast } = useToast();
                const { t } = useTranslation();
                const theme = useTheme();
                const navigate = useNavigate();
              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

              File index.spec.ts has 314 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

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

                package flow
                
                import (
                    "context"
                    "log/slog"
                Severity: Minor
                Found in pkg/flow/grpc-instances.go - About 3 hrs to fix

                  Method gatewayManager.ServeHTTP has 111 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

                  func (ep *gatewayManager) ServeHTTP(w http.ResponseWriter, r *http.Request) {
                      ctx := r.Context()
                      span := trace.SpanFromContext(ctx)
                      defer span.End()
                      spanContext := span.SpanContext()
                  Severity: Major
                  Found in pkg/refactor/gateway/gateway.go - About 3 hrs to fix

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

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

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

                        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

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

                          import {
                            createHttpServiceFile,
                            findServiceWithApiRequest,
                            serviceWithAnError,
                          } from "./utils";
                          Severity: Minor
                          Found in ui/e2e/services/list.spec.ts - 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

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