vorteil/direktiv

View on GitHub

Showing 407 of 1,235 total issues

Function writeDataStoreError has 6 return statements (exceeds 4 allowed).
Open

func writeDataStoreError(w http.ResponseWriter, err error) {
    if errors.Is(err, datastore.ErrNotFound) {
        writeError(w, &Error{
            Code:    "resource_not_found",
            Message: "requested resource is not found",
Severity: Major
Found in pkg/api/errors.go - About 40 mins to fix

    Method knativeClient.createService has 6 return statements (exceeds 4 allowed).
    Open

    func (c *knativeClient) createService(sv *core.ServiceFileData) error {
        if sv.Image == "" {
            return errors.New("image field is empty or not set")
        }
    
    
    Severity: Major
    Found in pkg/service/knative_client.go - About 40 mins to fix

      Method sqlEventListenerStore.GetByID has 6 return statements (exceeds 4 allowed).
      Open

      func (s *sqlEventListenerStore) GetByID(ctx context.Context, id uuid.UUID) (*datastore.EventListener, error) {
          q := "SELECT id, namespace_id, namespace, created_at, updated_at, received_events, trigger_type, events_lifespan, event_types, trigger_info, metadata, event_context_filters FROM event_listeners WHERE id = $1 ;"
          var l gormEventListener
          tx := s.db.WithContext(ctx).Raw(q, id).First(&l)
          if tx.Error != nil {
      Severity: Major
      Found in pkg/datastore/datastoresql/eventstore_listener.go - About 40 mins to fix

        Method fsController.createFile has 6 return statements (exceeds 4 allowed).
        Open

        func (e *fsController) createFile(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/filesystem.go - About 40 mins to fix

          Method ActionState.Validate has 6 return statements (exceeds 4 allowed).
          Open

          func (o *ActionState) Validate() error {
              if err := o.commonValidate(); err != nil {
                  return err
              }
          
          
          Severity: Major
          Found in pkg/model/state-action.go - About 40 mins to fix

            Method eventsController.registerCoudEvent has 6 return statements (exceeds 4 allowed).
            Open

            func (c *eventsController) registerCoudEvent(w http.ResponseWriter, r *http.Request) {
                ns := extractContextNamespace(r)
                cType := r.Header.Get("Content-type")
                limit := int64(1024 * 1024 * 32)
            
            
            Severity: Major
            Found in pkg/api/events.go - About 40 mins to fix

              Method sqlRuntimeVariablesStore.Patch has 6 return statements (exceeds 4 allowed).
              Open

              func (s *sqlRuntimeVariablesStore) Patch(ctx context.Context, id uuid.UUID, patch *datastore.RuntimeVariablePatch) (*datastore.RuntimeVariable, error) {
                  if patch.Name != nil {
                      if *patch.Name == "" {
                          return nil, datastore.ErrInvalidRuntimeVariableName
                      }
              Severity: Major
              Found in pkg/datastore/datastoresql/runtime_variables.go - About 40 mins to fix

                Method RootQuery.GetFile has 6 return statements (exceeds 4 allowed).
                Open

                func (q *RootQuery) GetFile(ctx context.Context, path string) (*filestore.File, error) {
                    path, err := filestore.SanitizePath(path)
                    if err != nil {
                        return nil, fmt.Errorf("%w: %w", filestore.ErrInvalidPathParameter, err)
                    }
                Severity: Major
                Found in pkg/filestore/filestoresql/root_query.go - About 40 mins to fix

                  Method RootQuery.ReadDirectory has 6 return statements (exceeds 4 allowed).
                  Open

                  func (q *RootQuery) ReadDirectory(ctx context.Context, path string) ([]*filestore.File, error) {
                      var list []*filestore.File
                      path, err := filestore.SanitizePath(path)
                      if err != nil {
                          return nil, fmt.Errorf("%w: %w", filestore.ErrInvalidPathParameter, err)
                  Severity: Major
                  Found in pkg/filestore/filestoresql/root_query.go - About 40 mins to fix

                    Method varController.update has 6 return statements (exceeds 4 allowed).
                    Open

                    func (e *varController) update(w http.ResponseWriter, r *http.Request) {
                        id, err := uuid.Parse(chi.URLParam(r, "variableID"))
                        if err != nil {
                            writeError(w, &Error{
                                Code:    "request_data_invalid",
                    Severity: Major
                    Found in pkg/api/variables.go - About 40 mins to fix

                      Method sqlRuntimeVariablesStore.Create has 6 return statements (exceeds 4 allowed).
                      Open

                      func (s *sqlRuntimeVariablesStore) Create(ctx context.Context, variable *datastore.RuntimeVariable) (*datastore.RuntimeVariable, error) {
                          if variable.Name == "" {
                              return nil, datastore.ErrInvalidRuntimeVariableName
                          }
                          if matched, _ := regexp.MatchString(datastore.RuntimeVariableNameRegexPattern, variable.Name); !matched {
                      Severity: Major
                      Found in pkg/datastore/datastoresql/runtime_variables.go - About 40 mins to fix

                        Method EventsAndState.Validate has 6 return statements (exceeds 4 allowed).
                        Open

                        func (o *EventsAndState) Validate() error {
                            if err := o.commonValidate(); err != nil {
                                return err
                            }
                        
                        
                        Severity: Major
                        Found in pkg/model/state-events-and.go - About 40 mins to fix

                          Method varController.create has 6 return statements (exceeds 4 allowed).
                          Open

                          func (e *varController) create(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 40 mins to fix

                            Method sqlMirrorStore.UpdateConfig has 6 return statements (exceeds 4 allowed).
                            Open

                            func (s sqlMirrorStore) UpdateConfig(ctx context.Context, config *datastore.MirrorConfig) (*datastore.MirrorConfig, error) {
                                config, err := cryptDecryptConfig(config, s.configEncryptionKey, true)
                                if err != nil {
                                    return nil, err
                                }
                            Severity: Major
                            Found in pkg/datastore/datastoresql/mirror.go - About 40 mins to fix

                              Method EventsXorState.Validate has 6 return statements (exceeds 4 allowed).
                              Open

                              func (o *EventsXorState) Validate() error {
                                  if err := o.commonValidate(); err != nil {
                                      return err
                                  }
                              
                              
                              Severity: Major
                              Found in pkg/model/state-events-xor.go - About 40 mins to fix

                                Method RootQuery.checkRootExists has 6 return statements (exceeds 4 allowed).
                                Open

                                func (q *RootQuery) checkRootExists(ctx context.Context) error {
                                    zeroUUID := (uuid.UUID{}).String()
                                
                                    if zeroUUID == q.rootID.String() {
                                        n := &filestore.Root{}
                                Severity: Major
                                Found in pkg/filestore/filestoresql/root_query.go - About 40 mins to fix

                                  Method ParallelState.Validate has 6 return statements (exceeds 4 allowed).
                                  Open

                                  func (o *ParallelState) Validate() error {
                                      if err := o.commonValidate(); err != nil {
                                          return err
                                      }
                                  
                                  
                                  Severity: Major
                                  Found in pkg/model/state-parallel.go - About 40 mins to fix

                                    Method nsController.create has 6 return statements (exceeds 4 allowed).
                                    Open

                                    func (e *nsController) create(w http.ResponseWriter, r *http.Request) {
                                        // Parse request.
                                    
                                        req := struct {
                                            Name   string `json:"name"`
                                    Severity: Major
                                    Found in pkg/api/namespaces.go - About 40 mins to fix

                                      Method logController.stream has 6 return statements (exceeds 4 allowed).
                                      Open

                                      func (m logController) stream(w http.ResponseWriter, r *http.Request) {
                                          // cursor is set to multiple seconds before the current time to mitigate data loss
                                          // that may occur due to delays between submitting and processing the request, or when a sequence of client requests is necessary.
                                          cursor := time.Now().UTC().Add(-time.Second * 3)
                                      
                                      
                                      Severity: Major
                                      Found in pkg/api/plattformlogs.go - About 40 mins to fix

                                        Function determineTrack has 6 return statements (exceeds 4 allowed).
                                        Open

                                        func determineTrack(params map[string]string) (string, error) {
                                            if p, ok := params["instance"]; ok {
                                                return "flow.instance." + "%" + p + "%", nil
                                            } else if p, ok := params["route"]; ok {
                                                return "flow.route." + params["namespace"] + "." + p, nil
                                        Severity: Major
                                        Found in pkg/api/plattformlogs.go - About 40 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language