Showing 407 of 1,235 total issues
Function findProjectRoot
has 5 return statements (exceeds 4 allowed). Open
Open
func findProjectRoot(path string) (string, error) {
fi, err := os.Stat(path)
if err != nil {
return "", err
}
Method Manager.Execute
has 5 return statements (exceeds 4 allowed). Open
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'?
Method KeyAuthPlugin.Execute
has 5 return statements (exceeds 4 allowed). Open
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
}
Function getVariables
has 5 return statements (exceeds 4 allowed). Open
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
}
Function getVariableDataViaID
has 5 return statements (exceeds 4 allowed). Open
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 {
Method BasicAuthPlugin.Execute
has 5 return statements (exceeds 4 allowed). Open
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
}
Method FlowPlugin.Execute
has 5 return statements (exceeds 4 allowed). Open
Open
func (tf *FlowPlugin) Execute(w http.ResponseWriter, r *http.Request) *http.Request {
currentNS := gateway.ExtractContextEndpoint(r).Namespace
if tf.Namespace == "" {
tf.Namespace = currentNS
}
Function parseFetchSecretExpressionTwoArgs
has 5 return statements (exceeds 4 allowed). Open
Open
func parseFetchSecretExpressionTwoArgs(callExpression string) (*fetchSecretArgs, error) {
// parse fetchSecret( g1 ) pattern
pattern := `^[ ]{0,}fetchSecret[ ]{0,}\((.*)\)[ ]{0,}$`
regex := regexp.MustCompile(pattern)
matches := regex.FindStringSubmatch(callExpression)
Function handleResponse
has 5 return statements (exceeds 4 allowed). Open
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
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(),
Method timers.addOneShot
has 5 return statements (exceeds 4 allowed). Open
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 {
Method NamespaceVarPlugin.Execute
has 5 return statements (exceeds 4 allowed). Open
Open
func (tnv *NamespaceVarPlugin) Execute(w http.ResponseWriter, r *http.Request) *http.Request {
currentNS := gateway.ExtractContextEndpoint(r).Namespace
if tnv.Namespace == "" {
tnv.Namespace = currentNS
}
Function jq
has 5 return statements (exceeds 4 allowed). Open
Open
func jq(input interface{}, command string) ([]interface{}, error) {
data, err := json.Marshal(input)
if err != nil {
return nil, err
}
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
}
Function preprocessRetry
has 5 return statements (exceeds 4 allowed). Open
Open
func preprocessRetry(retry *model.RetryDefinition, attempt int, err error) (time.Duration, error) {
var d time.Duration
if retry == nil {
return d, err
Method engine.handleInstanceMessage
has 5 return statements (exceeds 4 allowed). Open
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(),
Method generateEventLogic.Run
has 5 return statements (exceeds 4 allowed). Open
Open
func (logic *generateEventLogic) Run(ctx context.Context, wakedata []byte) (*Transition, error) {
err := scheduleOnce(logic, wakedata)
if err != nil {
return nil, err
}
Method sqlEventListenerStore.Append
has 5 return statements (exceeds 4 allowed). Open
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);`
Method Workflow.unmStart
has 5 return statements (exceeds 4 allowed). Open
Open
func (o *Workflow) unmStart(m map[string]interface{}) (err error) {
// split start out from the rest
y, startFound := m["start"]
if startFound {
// Start
Method secretsController.create
has 5 return statements (exceeds 4 allowed). Open
Open
func (e *secretsController) create(w http.ResponseWriter, r *http.Request) {
ns := extractContextNamespace(r)
db, err := e.db.BeginTx(r.Context())
if err != nil {