Hunterlong/SimpleMailer

View on GitHub
emailer.go

Summary

Maintainability
A
2 hrs
Test Coverage

Function SendEmail has 64 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func SendEmail(outgoingEmail Outgoing) bool {
        email_html, err := ioutil.ReadFile(configs.EmailsDir + outgoingEmail.Template)
        from := mail.Address{configs.SMTPname, configs.SMTPfrom}
        to := mail.Address{"", outgoingEmail.Email}
        subj := outgoingEmail.Subject
Severity: Minor
Found in emailer.go - About 1 hr to fix

    Function SendEmail has 9 return statements (exceeds 4 allowed).
    Open

    func SendEmail(outgoingEmail Outgoing) bool {
            email_html, err := ioutil.ReadFile(configs.EmailsDir + outgoingEmail.Template)
            from := mail.Address{configs.SMTPname, configs.SMTPfrom}
            to := mail.Address{"", outgoingEmail.Email}
            subj := outgoingEmail.Subject
    Severity: Major
    Found in emailer.go - About 55 mins to fix

      Your code does not pass gofmt in 2 places. Go fmt your code!
      Open

      package SimpleMailer
      Severity: Minor
      Found in emailer.go by gofmt

      comment on exported function ReplaceContentText should be of the form "ReplaceContentText ..."
      Open

      // function to replace variables as: {{USERNAME}} to USERNAME
      Severity: Minor
      Found in emailer.go by golint

      don't use MixedCaps in package name; SimpleMailer should be simplemailer
      Open

      package SimpleMailer
      Severity: Minor
      Found in emailer.go by golint

      don't use underscores in Go names; var email_html should be emailHTML
      Open

              email_html, err := ioutil.ReadFile(configs.EmailsDir + outgoingEmail.Template)
      Severity: Minor
      Found in emailer.go by golint

      comment on exported function SendEmail should be of the form "SendEmail ..."
      Open

      // function to send an email with TLS and PlainAuth
      Severity: Minor
      Found in emailer.go by golint

      There are no issues that match your filters.

      Category
      Status