Showing 407 of 1,235 total issues
Function writeDataStoreError
has 6 return statements (exceeds 4 allowed). Open
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",
Method knativeClient.createService
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *knativeClient) createService(sv *core.ServiceFileData) error {
if sv.Image == "" {
return errors.New("image field is empty or not set")
}
Method sqlEventListenerStore.GetByID
has 6 return statements (exceeds 4 allowed). Open
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 {
Method fsController.createFile
has 6 return statements (exceeds 4 allowed). Open
Open
func (e *fsController) createFile(w http.ResponseWriter, r *http.Request) {
ns := extractContextNamespace(r)
db, err := e.db.BeginTx(r.Context())
if err != nil {
Method ActionState.Validate
has 6 return statements (exceeds 4 allowed). Open
Open
func (o *ActionState) Validate() error {
if err := o.commonValidate(); err != nil {
return err
}
Method eventsController.registerCoudEvent
has 6 return statements (exceeds 4 allowed). Open
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)
Method sqlRuntimeVariablesStore.Patch
has 6 return statements (exceeds 4 allowed). Open
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
}
Method RootQuery.GetFile
has 6 return statements (exceeds 4 allowed). Open
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)
}
Method RootQuery.ReadDirectory
has 6 return statements (exceeds 4 allowed). Open
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)
Method varController.update
has 6 return statements (exceeds 4 allowed). Open
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",
Method sqlRuntimeVariablesStore.Create
has 6 return statements (exceeds 4 allowed). Open
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 {
Method EventsAndState.Validate
has 6 return statements (exceeds 4 allowed). Open
Open
func (o *EventsAndState) Validate() error {
if err := o.commonValidate(); err != nil {
return err
}
Method varController.create
has 6 return statements (exceeds 4 allowed). Open
Open
func (e *varController) create(w http.ResponseWriter, r *http.Request) {
ns := extractContextNamespace(r)
db, err := e.db.BeginTx(r.Context())
if err != nil {
Method sqlMirrorStore.UpdateConfig
has 6 return statements (exceeds 4 allowed). Open
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
}
Method EventsXorState.Validate
has 6 return statements (exceeds 4 allowed). Open
Open
func (o *EventsXorState) Validate() error {
if err := o.commonValidate(); err != nil {
return err
}
Method RootQuery.checkRootExists
has 6 return statements (exceeds 4 allowed). Open
Open
func (q *RootQuery) checkRootExists(ctx context.Context) error {
zeroUUID := (uuid.UUID{}).String()
if zeroUUID == q.rootID.String() {
n := &filestore.Root{}
Method ParallelState.Validate
has 6 return statements (exceeds 4 allowed). Open
Open
func (o *ParallelState) Validate() error {
if err := o.commonValidate(); err != nil {
return err
}
Method nsController.create
has 6 return statements (exceeds 4 allowed). Open
Open
func (e *nsController) create(w http.ResponseWriter, r *http.Request) {
// Parse request.
req := struct {
Name string `json:"name"`
Method logController.stream
has 6 return statements (exceeds 4 allowed). Open
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)
Function determineTrack
has 6 return statements (exceeds 4 allowed). Open
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