hongbo-miao/hongbomiao.com

View on GitHub
api-go/internal/graphql_server/utils/get_user_by_email.go

Summary

Maintainability
A
1 hr
Test Coverage

Function GetUserByEmail has 59 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func GetUserByEmail(email string) (*types.User, error) {
    config := GetConfig()
    conn, err := grpc.NewClient(
        config.DgraphHost+":"+config.DgraphGRPCPort,
        grpc.WithUnaryInterceptor(apmgrpc.NewUnaryClientInterceptor()),
Severity: Minor
Found in api-go/internal/graphql_server/utils/get_user_by_email.go - About 1 hr to fix

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

    func GetUserByEmail(email string) (*types.User, error) {
        config := GetConfig()
        conn, err := grpc.NewClient(
            config.DgraphHost+":"+config.DgraphGRPCPort,
            grpc.WithUnaryInterceptor(apmgrpc.NewUnaryClientInterceptor()),
    Severity: Major
    Found in api-go/internal/graphql_server/utils/get_user_by_email.go - About 35 mins to fix

      There are no issues that match your filters.

      Category
      Status