contrib/screener-api/screener/screener.go
Method screenerImpl.blacklistAddress
has 59 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (s *screenerImpl) blacklistAddress(c *gin.Context) {
var err error
ctx, span := s.metrics.Tracer().Start(c.Request.Context(), "blacklistAddress")
defer metrics.EndSpanWithErr(span, err)
Method screenerImpl.authMiddleware
has 56 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (s *screenerImpl) authMiddleware(cfg config.Config) gin.HandlerFunc {
return func(c *gin.Context) {
_, span := s.metrics.Tracer().Start(c.Request.Context(), "authMiddleware")
defer span.End()
Method screenerImpl.blacklistAddress
has 8 return statements (exceeds 4 allowed). Open
Open
func (s *screenerImpl) blacklistAddress(c *gin.Context) {
var err error
ctx, span := s.metrics.Tracer().Start(c.Request.Context(), "blacklistAddress")
defer metrics.EndSpanWithErr(span, err)
Method screenerImpl.screenAddress
has 8 return statements (exceeds 4 allowed). Open
Open
func (s *screenerImpl) screenAddress(c *gin.Context) {
address := strings.ToLower(c.Param("address"))
if address == "" {
logger.Errorf("address is required")
c.JSON(http.StatusBadRequest, gin.H{"error": "address is required"})
Function NewScreener
has 5 return statements (exceeds 4 allowed). Open
Open
func NewScreener(ctx context.Context, cfg config.Config, metricHandler metrics.Handler) (_ Screener, err error) {
screener := screenerImpl{
metrics: metricHandler,
cfg: cfg,
requestMux: mapmutex.NewStringMapMutex(),