vorteil/direktiv

View on GitHub

Showing 1,235 of 1,235 total issues

Method server.getInstance has 7 return statements (exceeds 4 allowed).
Open

func (srv *server) getInstance(ctx context.Context, namespace, instanceID string) (*enginerefactor.Instance, error) {
    id, err := uuid.Parse(instanceID)
    if err != nil {
        return nil, err
    }
Severity: Major
Found in pkg/flow/grpc-instances.go - About 45 mins to fix

    Method parallelLogic.Run has 7 return statements (exceeds 4 allowed).
    Open

    func (logic *parallelLogic) Run(ctx context.Context, wakedata []byte) (*Transition, error) {
        // first schedule
        if len(wakedata) == 0 {
            err := noMemory(logic)
            if err != nil {
    Severity: Major
    Found in pkg/flow/states/parallel.go - About 45 mins to fix

      Method engine.Transition has 7 return statements (exceeds 4 allowed).
      Open

      func (engine *engine) Transition(ctx context.Context, im *instanceMemory, nextState string, attempt int) *states.Transition {
          ctx, cleanup, err := tracing.NewSpan(ctx, "engine transitions: "+nextState)
          if err != nil {
              slog.Debug("transition failed to init telemetry", "error", err)
          }
      Severity: Major
      Found in pkg/flow/engine.go - About 45 mins to fix

        Method LocalServer.varHandler has 7 return statements (exceeds 4 allowed).
        Open

        func (srv *LocalServer) varHandler(w http.ResponseWriter, r *http.Request) {
            actionId := r.URL.Query().Get("aid")
        
            srv.requestsLock.Lock()
            req, ok := srv.requests[actionId]
        Severity: Major
        Found in cmd/sidecar/local-server.go - About 45 mins to fix

          Method LocalServer.setVar has 7 return statements (exceeds 4 allowed).
          Open

          func (srv *LocalServer) setVar(ctx context.Context, ir *functionRequest, r io.Reader, scope, key, vMimeType string) (int, error) {
              // Retrieve variable metadata
              varMeta, statusCode, err := getVariableMetaFromFlow(ctx, srv.flowToken, srv.flowAddr, ir, scope, key)
              if err != nil {
                  target := &RessourceNotFoundError{}
          Severity: Major
          Found in cmd/sidecar/local-server.go - About 45 mins to fix

            Method validateLogic.Run has 7 return statements (exceeds 4 allowed).
            Open

            func (logic *validateLogic) Run(ctx context.Context, wakedata []byte) (*Transition, error) {
                err := scheduleOnce(logic, wakedata)
                if err != nil {
                    return nil, err
                }
            Severity: Major
            Found in pkg/flow/states/validate.go - About 45 mins to fix

              Function GetSource has 7 return statements (exceeds 4 allowed).
              Open

              func GetSource(_ context.Context, cfg *datastore.MirrorConfig) (Source, error) {
                  insecureSkipTLS := cfg.Insecure
                  tempDir := ""
              
                  if cfg.AuthToken == "" {
              Severity: Major
              Found in pkg/mirror/source.go - About 45 mins to fix

                Method instanceMemory.GetVariables has 7 return statements (exceeds 4 allowed).
                Open

                func (im *instanceMemory) GetVariables(ctx context.Context, vars []states.VariableSelector) ([]states.Variable, error) {
                    x := make([]states.Variable, 0)
                
                    tx, err := im.engine.flow.beginSQLTx(ctx)
                    if err != nil {
                Severity: Major
                Found in pkg/flow/temporary.go - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                            if (item && item.source === "startNode" && item.target === flow[i]) {
                              // connection between start and first state
                              (newElements[j] as Edge).animated = true;
                            }
                  Severity: Major
                  Found in ui/src/design/WorkflowDiagram/utils.ts - About 45 mins to fix

                    Function NamespaceVariablePicker has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    const NamespaceVariablePicker = ({
                      namespace: givenNamespace,
                      defaultVariable,
                      onChange,
                    }: NamespaceVariablePickerProps) => {
                    Severity: Minor
                    Found in ui/src/components/NamespaceVariablepicker/index.tsx - About 45 mins 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 FileUpload has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    const FileUpload = ({ onChange }: FileUploadProps) => {
                      const { t } = useTranslation();
                      const [isUploading, setIsUploading] = useState(false);
                    
                      const onFileLoad = (e: ProgressEvent<FileReader>) => {
                    Severity: Minor
                    Found in ui/src/components/FileUpload/index.tsx - About 45 mins 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

                    Avoid deeply nested control flow statements.
                    Open

                              if (value.states[i]?.conditions[y]?.transition) {
                                newElements.push({
                                  id: `${value.states[i]?.id}-${value.states[i]?.conditions[y]?.transition}-${i}-${y}`,
                                  source: value.states[i]?.id || "",
                                  target: value.states[i]?.conditions[y]?.transition || "",
                    Severity: Major
                    Found in ui/src/design/WorkflowDiagram/utils.ts - About 45 mins to fix

                      Method sqlEventTopicsStore.Append has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      func (s *sqlEventTopicsStore) Append(ctx context.Context, namespaceID uuid.UUID, namespace string, eventListenerID uuid.UUID, topic string, filter string) error {
                      Severity: Minor
                      Found in pkg/datastore/datastoresql/eventstore_topic.go - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                            } else if p, ok := params["trace"]; ok {
                                return "flow.trace" + p, nil
                            }
                        Severity: Major
                        Found in pkg/api/plattformlogs.go - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                    if (value.states[i]?.events[j]?.transition) {
                                      transitions = true;
                                      newElements.push({
                                        id: `${value.states[i]?.id}-${value.states[i]?.events[j]?.transition}`,
                                        source: value.states[i]?.id || "",
                          Severity: Major
                          Found in ui/src/design/WorkflowDiagram/utils.ts - About 45 mins to fix

                            Method varController.listRaw has 7 return statements (exceeds 4 allowed).
                            Open

                            func (e *varController) listRaw(w http.ResponseWriter, r *http.Request) {
                                ns := extractContextNamespace(r)
                            
                                db, err := e.db.BeginTx(r.Context())
                                if err != nil {
                            Severity: Major
                            Found in pkg/api/variables.go - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                        if (item && item.target === flow[i] && item.source === flow[i - 1]) {
                                          // connection between two states
                                          (newElements[j] as Edge).animated = true;
                                        } else if (item && item.id === flow[i]) {
                                          if (
                              Severity: Major
                              Found in ui/src/design/WorkflowDiagram/utils.ts - About 45 mins to fix

                                Method logController.mountRouter has 7 return statements (exceeds 4 allowed).
                                Open

                                func (m *logController) mountRouter(r chi.Router) {
                                    r.Get("/subscribe", m.stream)
                                
                                    r.Get("/", func(w http.ResponseWriter, r *http.Request) {
                                        params := extractLogRequestParams(r)
                                Severity: Major
                                Found in pkg/api/plattformlogs.go - About 45 mins to fix

                                  Function sseHandlefunc has 7 return statements (exceeds 4 allowed).
                                  Open

                                  func sseHandlefunc(ctx context.Context, r *http.Request, c *eventsController, cursorTime time.Time, params []string) ([]CoursoredEvent, error) {
                                      ns := chi.URLParam(r, "namespace")
                                      if ns == "" {
                                          return nil, fmt.Errorf("namespace can not be empty")
                                      }
                                  Severity: Major
                                  Found in pkg/api/events.go - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                              if (value.states[i]?.catch[x]?.transition) {
                                                transitions = true;
                                    
                                                newElements.push({
                                                  id: `${value.states[i]?.id}-${value.states[i]?.catch[x]?.transition}`,
                                    Severity: Major
                                    Found in ui/src/design/WorkflowDiagram/utils.ts - About 45 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language