vorteil/direktiv

View on GitHub

Showing 407 of 1,235 total issues

Function findProjectRoot has 5 return statements (exceeds 4 allowed).
Open

func findProjectRoot(path string) (string, error) {
    fi, err := os.Stat(path)
    if err != nil {
        return "", err
    }
Severity: Major
Found in cmd/exec/cli/utils.go - About 35 mins to fix

    Method Manager.Execute has 5 return statements (exceeds 4 allowed).
    Open

    func (d *Manager) Execute(ctx context.Context, p *datastore.MirrorProcess, m *datastore.MirrorConfig, applyer Applyer) {
        ctx, cancel := context.WithCancel(ctx)
        defer func() {
            cancel()
            // TODO: find a way to store a separate status 'cancelled' instead of 'error'?
    Severity: Major
    Found in pkg/mirror/manager.go - About 35 mins to fix

      Method KeyAuthPlugin.Execute has 5 return statements (exceeds 4 allowed).
      Open

      func (ka *KeyAuthPlugin) Execute(w http.ResponseWriter, r *http.Request) *http.Request {
          // check request is already authenticated
          if gateway.ExtractContextActiveConsumer(r) != nil {
              return r
          }
      Severity: Major
      Found in pkg/gateway/plugins/auth/key-auth.go - About 35 mins to fix

        Function getVariables has 5 return statements (exceeds 4 allowed).
        Open

        func getVariables(ctx context.Context, flowToken, addr string) (*variablesResponse, int, error) {
            resp, err := doRequest(ctx, http.MethodGet, flowToken, addr, nil)
            if err != nil {
                return nil, resp.StatusCode, err
            }
        Severity: Major
        Found in cmd/sidecar/api_v2_clients.go - About 35 mins to fix

          Function getVariableDataViaID has 5 return statements (exceeds 4 allowed).
          Open

          func getVariableDataViaID(ctx context.Context, flowToken string, flowAddr string, namespace string, id string) (variable, error) {
              addr := fmt.Sprintf("http://%v/api/v2/namespaces/%v/variables/%v", flowAddr, namespace, id)
              client := &http.Client{}
              req, err := http.NewRequestWithContext(ctx, http.MethodGet, addr, nil)
              if err != nil {
          Severity: Major
          Found in cmd/sidecar/api_v2_clients.go - About 35 mins to fix

            Method BasicAuthPlugin.Execute has 5 return statements (exceeds 4 allowed).
            Open

            func (ba *BasicAuthPlugin) Execute(w http.ResponseWriter, r *http.Request) *http.Request {
                // check request is already authenticated
                if gateway.ExtractContextActiveConsumer(r) != nil {
                    return r
                }
            Severity: Major
            Found in pkg/gateway/plugins/auth/basic-auth.go - About 35 mins to fix

              Method FlowPlugin.Execute has 5 return statements (exceeds 4 allowed).
              Open

              func (tf *FlowPlugin) Execute(w http.ResponseWriter, r *http.Request) *http.Request {
                  currentNS := gateway.ExtractContextEndpoint(r).Namespace
                  if tf.Namespace == "" {
                      tf.Namespace = currentNS
                  }
              Severity: Major
              Found in pkg/gateway/plugins/target/target-workflow.go - About 35 mins to fix

                Function parseFetchSecretExpressionTwoArgs has 5 return statements (exceeds 4 allowed).
                Open

                func parseFetchSecretExpressionTwoArgs(callExpression string) (*fetchSecretArgs, error) {
                    // parse fetchSecret( g1 ) pattern
                    pattern := `^[ ]{0,}fetchSecret[ ]{0,}\((.*)\)[ ]{0,}$`
                    regex := regexp.MustCompile(pattern)
                    matches := regex.FindStringSubmatch(callExpression)
                Severity: Major
                Found in pkg/gateway/fetch_secret.go - About 35 mins to fix

                  Function handleResponse has 5 return statements (exceeds 4 allowed).
                  Open

                  func handleResponse(resp *http.Response, next func(resp *http.Response) (int, error)) (int, error) {
                      defer resp.Body.Close()
                  
                      if resp.StatusCode != http.StatusOK {
                          var apiErrorResp apiError
                  Severity: Major
                  Found in cmd/sidecar/api_v2_clients.go - About 35 mins to fix

                    Method events.addInstanceEventListener has 5 return statements (exceeds 4 allowed).
                    Open

                    func (events *events) addInstanceEventListener(ctx context.Context, namespace uuid.UUID, nsName string, instance uuid.UUID, sevents []*model.ConsumeEventDefinition, all bool) error {
                        // var ev []map[string]interface{}
                    
                        fEv := &datastore.EventListener{
                            ID:                     uuid.New(),
                    Severity: Major
                    Found in pkg/flow/db-events.go - About 35 mins to fix

                      Method timers.addOneShot has 5 return statements (exceeds 4 allowed).
                      Open

                      func (timers *timers) addOneShot(name, fn string, timeos time.Time, data []byte) error {
                          utc := timeos.UTC()
                      
                          t, err := timers.newTimer(name, fn, data, &utc, "")
                          if err != nil {
                      Severity: Major
                      Found in pkg/flow/timers.go - About 35 mins to fix

                        Method NamespaceVarPlugin.Execute has 5 return statements (exceeds 4 allowed).
                        Open

                        func (tnv *NamespaceVarPlugin) Execute(w http.ResponseWriter, r *http.Request) *http.Request {
                            currentNS := gateway.ExtractContextEndpoint(r).Namespace
                            if tnv.Namespace == "" {
                                tnv.Namespace = currentNS
                            }
                        Severity: Major
                        Found in pkg/gateway/plugins/target/target-ns-var.go - About 35 mins to fix

                          Function jq has 5 return statements (exceeds 4 allowed).
                          Open

                          func jq(input interface{}, command string) ([]interface{}, error) {
                              data, err := json.Marshal(input)
                              if err != nil {
                                  return nil, err
                              }
                          Severity: Major
                          Found in pkg/jqer/jqer.go - About 35 mins to fix

                            Function renderStartEventListener has 5 return statements (exceeds 4 allowed).
                            Open

                            func renderStartEventListener(ctx context.Context, nsID uuid.UUID, nsName string, file *filestore.File, ms *muxStart, tx *database.SQLStore) error {
                                _, err := tx.DataStore().EventListener().DeleteAllForWorkflow(ctx, file.ID)
                                if err != nil {
                                    return err
                                }
                            Severity: Major
                            Found in pkg/flow/db-events.go - About 35 mins to fix

                              Function preprocessRetry has 5 return statements (exceeds 4 allowed).
                              Open

                              func preprocessRetry(retry *model.RetryDefinition, attempt int, err error) (time.Duration, error) {
                                  var d time.Duration
                              
                                  if retry == nil {
                                      return d, err
                              Severity: Major
                              Found in pkg/flow/states/action-helpers.go - About 35 mins to fix

                                Method engine.handleInstanceMessage has 5 return statements (exceeds 4 allowed).
                                Open

                                func (engine *engine) handleInstanceMessage(ctx context.Context, im *instanceMemory, msg *instancestore.InstanceMessageData) *states.Transition {
                                    instanceCtx := tracing.AddInstanceMemoryAttr(ctx,
                                        tracing.InstanceAttributes{
                                            Namespace:    im.Namespace().Name,
                                            InstanceID:   im.GetInstanceID().String(),
                                Severity: Major
                                Found in pkg/flow/instance_messages.go - About 35 mins to fix

                                  Method generateEventLogic.Run has 5 return statements (exceeds 4 allowed).
                                  Open

                                  func (logic *generateEventLogic) 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/generateEvent.go - About 35 mins to fix

                                    Method sqlEventListenerStore.Append has 5 return statements (exceeds 4 allowed).
                                    Open

                                    func (s *sqlEventListenerStore) Append(ctx context.Context, listener *datastore.EventListener) error {
                                        q := `INSERT INTO event_listeners
                                         (id, namespace_id, namespace, created_at, updated_at, deleted, received_events, trigger_type, events_lifespan, event_types, trigger_info, metadata, event_context_filters) 
                                          VALUES ( $1 , $2 , $3 , $4 , $5 , $6 , $7 , $8 , $9 , $10 , $11, $12, $13);`
                                    
                                    
                                    Severity: Major
                                    Found in pkg/datastore/datastoresql/eventstore_listener.go - About 35 mins to fix

                                      Method Workflow.unmStart has 5 return statements (exceeds 4 allowed).
                                      Open

                                      func (o *Workflow) unmStart(m map[string]interface{}) (err error) {
                                          // split start out from the rest
                                          y, startFound := m["start"]
                                          if startFound {
                                              // Start
                                      Severity: Major
                                      Found in pkg/model/workflow.go - About 35 mins to fix

                                        Method secretsController.create has 5 return statements (exceeds 4 allowed).
                                        Open

                                        func (e *secretsController) 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/secrets.go - About 35 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language