pedroMMM/goss

View on GitHub
system/system.go

Summary

Maintainability
A
1 hr
Test Coverage

Avoid deeply nested control flow statements.
Open

    } else if _, err := os.Stat("/etc/debian_version"); err == nil {
        return "debian"
    }
Severity: Major
Found in system/system.go - About 45 mins to fix

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

    func DetectDistro() string {
        if b, e := ioutil.ReadFile("/etc/lsb-release"); e == nil && bytes.Contains(b, []byte("Ubuntu")) {
            return "ubuntu"
        } else if isRedhat() {
            return "redhat"
    Severity: Major
    Found in system/system.go - About 40 mins to fix

      exported function New should have comment or be unexported
      Open

      func New(packageManager string) *System {
      Severity: Minor
      Found in system/system.go by golint

      exported method System.ProcMap should have comment or be unexported
      Open

      func (s *System) ProcMap() (map[string][]ps.Process, error) {
      Severity: Minor
      Found in system/system.go by golint

      receiver name sys should be consistent with previous receiver name s for System
      Open

      func (sys *System) detectService() {
      Severity: Minor
      Found in system/system.go by golint

      exported type System should have comment or be unexported
      Open

      type System struct {
      Severity: Minor
      Found in system/system.go by golint

      receiver name sys should be consistent with previous receiver name s for System
      Open

      func (sys *System) detectPackage(p string) {
      Severity: Minor
      Found in system/system.go by golint

      exported type Resource should have comment or be unexported
      Open

      type Resource interface {
      Severity: Minor
      Found in system/system.go by golint

      exported method System.Ports should have comment or be unexported
      Open

      func (s *System) Ports() map[string][]GOnetstat.Process {
      Severity: Minor
      Found in system/system.go by golint

      There are no issues that match your filters.

      Category
      Status