pkg/flow/db-events.go
Function appendEventListenersToDB
has 64 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func appendEventListenersToDB(ctx context.Context, nsID uuid.UUID, nsName string, file *filestore.File, lifespan time.Duration, ms *muxStart, tx *database.SQLStore) error {
fEv := &datastore.EventListener{
ID: uuid.New(),
CreatedAt: time.Now().UTC(),
UpdatedAt: time.Now().UTC(),
Method events.addInstanceEventListener
has 60 lines of code (exceeds 50 allowed). Consider refactoring. Open
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(),
Function appendEventListenersToDB
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func appendEventListenersToDB(ctx context.Context, nsID uuid.UUID, nsName string, file *filestore.File, lifespan time.Duration, ms *muxStart, tx *database.SQLStore) error {
Function renderStartEventListener
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func renderStartEventListener(ctx context.Context, nsID uuid.UUID, nsName string, file *filestore.File, ms *muxStart, tx *database.SQLStore) error {
Method events.addInstanceEventListener
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func (events *events) addInstanceEventListener(ctx context.Context, namespace uuid.UUID, nsName string, instance uuid.UUID, sevents []*model.ConsumeEventDefinition, all bool) error {
Method events.deleteWorkflowEventListeners
has 5 return statements (exceeds 4 allowed). Open
Open
func (events *events) deleteWorkflowEventListeners(ctx context.Context, nsID uuid.UUID, fileID uuid.UUID) error {
err := events.runSQLTx(ctx, func(tx *database.SQLStore) error {
ids, err := tx.DataStore().EventListener().DeleteAllForWorkflow(ctx, fileID)
if err != nil {
return err
Method events.deleteInstanceEventListeners
has 5 return statements (exceeds 4 allowed). Open
Open
func (events *events) deleteInstanceEventListeners(ctx context.Context, im *instanceMemory) error {
err := events.runSQLTx(ctx, func(tx *database.SQLStore) error {
ids, err := tx.DataStore().EventListener().DeleteAllForWorkflow(ctx, im.instance.Instance.ID)
if err != nil {
return err
Method events.addInstanceEventListener
has 5 return statements (exceeds 4 allowed). Open
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(),
Function renderStartEventListener
has 5 return statements (exceeds 4 allowed). Open
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
}