hongbo-miao/hongbomiao.com

View on GitHub
api-go/internal/graphql_server/controllers/upload.go

Summary

Maintainability
A
1 hr
Test Coverage

Function Upload has 55 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func Upload(minioClient *minio.Client) gin.HandlerFunc {
    fn := func(c *gin.Context) {
        fileHeader, err := c.FormFile("file")
        if err != nil {
            log.Error().Err(err).Msg("c.FormFile")
Severity: Minor
Found in api-go/internal/graphql_server/controllers/upload.go - About 1 hr to fix

    Function Upload has 5 return statements (exceeds 4 allowed).
    Open

    func Upload(minioClient *minio.Client) gin.HandlerFunc {
        fn := func(c *gin.Context) {
            fileHeader, err := c.FormFile("file")
            if err != nil {
                log.Error().Err(err).Msg("c.FormFile")
    Severity: Major
    Found in api-go/internal/graphql_server/controllers/upload.go - About 35 mins to fix

      There are no issues that match your filters.

      Category
      Status