dotcloud/docker

View on GitHub
libnetwork/internal/resolvconf/resolvconf.go

Summary

Maintainability
A
2 hrs
Test Coverage

Method ResolvConf.Generate has 61 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (rc *ResolvConf) Generate(comments bool) ([]byte, error) {
    s := struct {
        Md          *metadata
        NameServers []netip.Addr
        Search      []string
Severity: Minor
Found in libnetwork/internal/resolvconf/resolvconf.go - About 1 hr to fix

    Function UserModified has 6 return statements (exceeds 4 allowed).
    Open

    func UserModified(rcPath, rcHashPath string) (bool, error) {
        currRCHash, err := os.ReadFile(rcHashPath)
        if err != nil {
            // If the hash file doesn't exist, can only assume it hasn't been written
            // yet (so, the user hasn't modified the file it hashes).
    Severity: Major
    Found in libnetwork/internal/resolvconf/resolvconf.go - About 40 mins to fix

      Method ResolvConf.WriteFile has 5 return statements (exceeds 4 allowed).
      Open

      func (rc *ResolvConf) WriteFile(path, hashPath string, perm os.FileMode) error {
          content, err := rc.Generate(true)
          if err != nil {
              return err
          }
      Severity: Major
      Found in libnetwork/internal/resolvconf/resolvconf.go - About 35 mins to fix

        There are no issues that match your filters.

        Category
        Status