Showing 33 of 36 total issues
Function WriteResponseToMemory
has 8 return statements (exceeds 4 allowed). Open
Open
func WriteResponseToMemory(module api.Module, msg proto.Message) (uint64, error) {
if module == nil {
return 0, errors.New("module cannot be nil")
}
Method Tail.startWorker
has 7 return statements (exceeds 4 allowed). Open
Open
func (t *Tail) startWorker(looper director.Looper, stream protos.Internal_SendTailClient) {
if stream == nil {
t.log.Error("stream is nil, unable to start tail worker")
return
}
Method Streamdal.Process
has 7 return statements (exceeds 4 allowed). Open
Open
func (s *Streamdal) Process(ctx context.Context, req *ProcessRequest) *ProcessResponse {
resp := &ProcessResponse{
PipelineStatus: make([]*protos.PipelineStatus, 0),
Metadata: make(map[string]string),
}
Function Audience
has 6 return statements (exceeds 4 allowed). Open
Open
func Audience(aud *protos.Audience) error {
if aud == nil {
return ErrNilInput
}
Method HostFunc.HTTPRequest
has 6 return statements (exceeds 4 allowed). Open
Open
func (h *HostFunc) HTTPRequest(_ context.Context, module api.Module, ptr, length int32) uint64 {
request := &steps.HttpRequest{}
if err := helper.ReadRequestFromMemory(module, request, ptr, length); err != nil {
return httpRequestResponse(module, http.StatusInternalServerError, "unable to read HTTP request params: "+err.Error(), nil)
Function TailRequestStartCommand
has 6 return statements (exceeds 4 allowed). Open
Open
func TailRequestStartCommand(cmd *protos.Command) error {
if cmd == nil {
return ErrNilInput
}
Function ReadRequestFromMemory
has 6 return statements (exceeds 4 allowed). Open
Open
func ReadRequestFromMemory(module api.Module, msg proto.Message, ptr, length int32) error {
if length <= 0 {
return errors.New("length must be greater than 0")
}
Function TailRequestStopCommand
has 6 return statements (exceeds 4 allowed). Open
Open
func TailRequestStopCommand(cmd *protos.Command) error {
if cmd == nil {
return ErrNilInput
}
Function TailRequestPauseCommand
has 6 return statements (exceeds 4 allowed). Open
Open
func TailRequestPauseCommand(cmd *protos.Command) error {
if cmd == nil {
return ErrNilInput
}
Function TailRequestResumeCommand
has 6 return statements (exceeds 4 allowed). Open
Open
func TailRequestResumeCommand(cmd *protos.Command) error {
if cmd == nil {
return ErrNilInput
}
Method Streamdal.runStep
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func (s *Streamdal) runStep(ctx context.Context, aud *protos.Audience, step *protos.PipelineStep, data []byte, isr *protos.InterStepResult) (*protos.WASMResponse, error) {
Method Streamdal.createFunction
has 5 return statements (exceeds 4 allowed). Open
Open
func (s *Streamdal) createFunction(step *protos.PipelineStep) (*function, error) {
inst, err := s.createWASMInstance(step.GetXWasmBytes())
if err != nil {
return nil, errors.Wrap(err, "unable to create WASM instance")
}
Method Streamdal.runStep
has 5 return statements (exceeds 4 allowed). Open
Open
func (s *Streamdal) runStep(ctx context.Context, aud *protos.Audience, step *protos.PipelineStep, data []byte, isr *protos.InterStepResult) (*protos.WASMResponse, error) {
s.config.Logger.Debugf("Running step '%s'", step.Name)
// Get WASM module
f, err := s.getFunction(ctx, step)