getwtxt/getwtxt

View on GitHub
registry/user.go

Summary

Maintainability
A
2 hrs
Test Coverage

Method Registry.UpdateUser has 7 return statements (exceeds 4 allowed).
Open

func (registry *Registry) UpdateUser(urlKey string) error {
    if urlKey == "" || !strings.HasPrefix(urlKey, "http") {
        return fmt.Errorf("invalid URL: %v", urlKey)
    }

Severity: Major
Found in registry/user.go - About 45 mins to fix

Method Registry.CrawlRemoteRegistry has 5 return statements (exceeds 4 allowed).
Open

func (registry *Registry) CrawlRemoteRegistry(urlKey string) error {
    if urlKey == "" || !strings.HasPrefix(urlKey, "http") {
        return fmt.Errorf("invalid URL: %v", urlKey)
    }

Severity: Major
Found in registry/user.go - About 35 mins to fix

Method Registry.DelUser has 5 return statements (exceeds 4 allowed).
Open

func (registry *Registry) DelUser(urlKey string) error {

    if registry == nil {
        return fmt.Errorf("can't delete user from empty registry")

Severity: Major
Found in registry/user.go - About 35 mins to fix

Method Registry.AddUser has 5 return statements (exceeds 4 allowed).
Open

func (registry *Registry) AddUser(nickname, urlKey string, ipAddress net.IP, statuses TimeMap) error {

    if registry == nil {
        return fmt.Errorf("can't add user to uninitialized registry")

Severity: Major
Found in registry/user.go - About 35 mins to fix

There are no issues that match your filters.

Category
Status