thestrukture/IDE

View on GitHub
api/templates/templates.go

Summary

Maintainability
A
2 hrs
Test Coverage
F
4%

Function LoadPage has 55 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func LoadPage(title string) (*gosweb.Page, error) {

    if lPage, ok := WebCache.Get(title); ok {
        return &lPage, nil
    }
Severity: Minor
Found in api/templates/templates.go - About 1 hr to fix

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

    func LoadPage(title string) (*gosweb.Page, error) {
    
        if lPage, ok := WebCache.Get(title); ok {
            return &lPage, nil
        }
    Severity: Major
    Found in api/templates/templates.go - About 55 mins to fix

      exported var WebCache should have comment or be unexported
      Open

      var WebCache = gosweb.NewCache()
      Severity: Minor
      Found in api/templates/templates.go by golint

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

      // load a page from your web root by passing the
      Severity: Minor
      Found in api/templates/templates.go by golint

      exported function StoreNetfn should have comment or be unexported
      Open

      func StoreNetfn() int {
      Severity: Minor
      Found in api/templates/templates.go by golint

      exported var FuncStored should have comment or be unexported
      Open

      var FuncStored = StoreNetfn()
      Severity: Minor
      Found in api/templates/templates.go by golint

      if block ends with a return statement, so drop this else and outdent its block
      Open

                  } else {
      Severity: Minor
      Found in api/templates/templates.go by golint

      package comment should be of the form "Package templates ..."
      Open

      // File generated by Gopher Sauce
      Severity: Minor
      Found in api/templates/templates.go by golint

      exported var TemplateFuncStore should have comment or be unexported
      Open

      var TemplateFuncStore template.FuncMap
      Severity: Minor
      Found in api/templates/templates.go by golint

      There are no issues that match your filters.

      Category
      Status