services/scribe/api/server.go
Function Start
has 57 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func Start(ctx context.Context, cfg Config, handler metrics.Handler) error {
logger.Warnf("starting api server")
router := ginhelper.New(logger)
// wrap gin with metrics
router.GET(ginhelper.MetricsEndpoint, gin.WrapH(handler.Handler()))
Function Start
has 12 return statements (exceeds 4 allowed). Open
Open
func Start(ctx context.Context, cfg Config, handler metrics.Handler) error {
logger.Warnf("starting api server")
router := ginhelper.New(logger)
// wrap gin with metrics
router.GET(ginhelper.MetricsEndpoint, gin.WrapH(handler.Handler()))
Function InitDB
has 6 return statements (exceeds 4 allowed). Open
Open
func InitDB(ctx context.Context, databaseType string, path string, metrics metrics.Handler, skipMigrations bool) (db.EventDB, error) {
logger.Warnf("Starting database connection from api")
switch {
case databaseType == "sqlite":
Function InitDB
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func InitDB(ctx context.Context, databaseType string, path string, metrics metrics.Handler, skipMigrations bool) (db.EventDB, error) {