caidooss/grafana-auth-proxy

View on GitHub
main.go

Summary

Maintainability
B
4 hrs
Test Coverage

Function main has 94 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func main() {
    var err error

    // Load .env file
    err = godotenv.Load(".env")
Severity: Major
Found in main.go - About 2 hrs to fix

    Function createRequestsHandler has 54 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func createRequestsHandler(c *cli.Context) (*RequestsHandler, error) {
        // Prepare token extractor
        extractors := make([]extraction.Extractor, 0, 2)
    
        cookieName := c.String("cookie")
    Severity: Minor
    Found in main.go - About 1 hr to fix

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

      func createRequestsHandler(c *cli.Context) (*RequestsHandler, error) {
          // Prepare token extractor
          extractors := make([]extraction.Extractor, 0, 2)
      
          cookieName := c.String("cookie")
      Severity: Major
      Found in main.go - About 55 mins to fix

        There are no issues that match your filters.

        Category
        Status