yieldr/go-auth0

View on GitHub

Showing 20 of 45 total issues

File management.gen.go has 4498 lines of code (exceeds 500 allowed). Consider refactoring.
Open

// Code generated by gen-accessors; DO NOT EDIT.

package management

import (
Severity: Major
Found in management/management.gen.go - About 1 wk to fix

    ConnectionOptionsFacebook has 47 methods (exceeds 20 allowed). Consider refactoring.
    Open

    func (c *ConnectionOptionsFacebook) GetAdsManagement() bool {
        if c == nil || c.AdsManagement == nil {
            return false
        }
        return *c.AdsManagement
    Severity: Minor
    Found in management/management.gen.go - About 6 hrs to fix

      File connection.go has 621 lines of code (exceeds 500 allowed). Consider refactoring.
      Open

      package management
      
      import (
          "encoding/json"
          "sort"
      Severity: Minor
      Found in management/connection.go - About 4 hrs to fix

        ConnectionOptionsGoogleOAuth2 has 35 methods (exceeds 20 allowed). Consider refactoring.
        Open

        func (c *ConnectionOptionsGoogleOAuth2) GetAdsenseManagement() bool {
            if c == nil || c.AdsenseManagement == nil {
                return false
            }
            return *c.AdsenseManagement
        Severity: Minor
        Found in management/management.gen.go - About 4 hrs to fix

          Method templateData.process has a Cognitive Complexity of 42 (exceeds 20 allowed). Consider refactoring.
          Open

          func (t *templateData) process(f *ast.File) error {
              for _, decl := range f.Decls {
                  gd, ok := decl.(*ast.GenDecl)
                  if !ok {
                      continue
          Severity: Minor
          Found in management/gen-methods.go - About 3 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          ConnectionOptionsWindowsLive has 28 methods (exceeds 20 allowed). Consider refactoring.
          Open

          func (c *ConnectionOptionsWindowsLive) GetCalendars() bool {
              if c == nil || c.Calendars == nil {
                  return false
              }
              return *c.Calendars
          Severity: Minor
          Found in management/management.gen.go - About 3 hrs to fix

            Client has 25 methods (exceeds 20 allowed). Consider refactoring.
            Open

            func (c *Client) GetAppType() string {
                if c == nil || c.AppType == nil {
                    return ""
                }
                return *c.AppType
            Severity: Minor
            Found in management/management.gen.go - About 2 hrs to fix

              ConnectionOptionsGitHub has 25 methods (exceeds 20 allowed). Consider refactoring.
              Open

              func (c *ConnectionOptionsGitHub) GetAdminOrg() bool {
                  if c == nil || c.AdminOrg == nil {
                      return false
                  }
                  return *c.AdminOrg
              Severity: Minor
              Found in management/management.gen.go - About 2 hrs to fix

                ConnectionOptionsAzureAD has 25 methods (exceeds 20 allowed). Consider refactoring.
                Open

                func (c *ConnectionOptionsAzureAD) GetAdmin() bool {
                    if c == nil || c.Admin == nil {
                        return false
                    }
                    return *c.Admin
                Severity: Minor
                Found in management/management.gen.go - About 2 hrs to fix

                  User has 25 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  func (u *User) GetBlocked() bool {
                      if u == nil || u.Blocked == nil {
                          return false
                      }
                      return *u.Blocked
                  Severity: Minor
                  Found in management/management.gen.go - About 2 hrs to fix

                    ConnectionOptionsSAML has 22 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    func (c *ConnectionOptionsSAML) GetCert() string {
                        if c == nil || c.Cert == nil {
                            return ""
                        }
                        return *c.Cert
                    Severity: Minor
                    Found in management/management.gen.go - About 2 hrs to fix

                      UserManager has 22 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      type UserManager struct {
                          *Management
                      }
                      Severity: Minor
                      Found in management/user.go - About 2 hrs to fix

                        OrganizationManager has 21 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                        type OrganizationManager struct {
                            *Management
                        }
                        Severity: Minor
                        Found in management/organization.go - About 2 hrs to fix

                          Method Connection.UnmarshalJSON has 59 lines of code (exceeds 50 allowed). Consider refactoring.
                          Open

                          func (c *Connection) UnmarshalJSON(b []byte) error {
                          
                              type connection Connection
                              type connectionWrapper struct {
                                  *connection
                          Severity: Minor
                          Found in management/connection.go - About 1 hr to fix

                            Method templateData.process has 56 lines of code (exceeds 50 allowed). Consider refactoring.
                            Open

                            func (t *templateData) process(f *ast.File) error {
                                for _, decl := range f.Decls {
                                    gd, ok := decl.(*ast.GenDecl)
                                    if !ok {
                                        continue
                            Severity: Minor
                            Found in management/gen-methods.go - About 1 hr to fix

                              Function New has 51 lines of code (exceeds 50 allowed). Consider refactoring.
                              Open

                              func New(domain string, options ...ManagementOption) (*Management, error) {
                              
                                  // Ignore the scheme if it was defined in the domain variable. Then prefix
                                  // with https as its the only scheme supported by the Auth0 API.
                                  if i := strings.Index(domain, "//"); i != -1 {
                              Severity: Minor
                              Found in management/management.go - About 1 hr to fix

                                Method JobManager.ImportUsers has 7 return statements (exceeds 4 allowed).
                                Open

                                func (m *JobManager) ImportUsers(j *Job, opts ...RequestOption) error {
                                
                                    var payload bytes.Buffer
                                    mp := multipart.NewWriter(&payload)
                                
                                
                                Severity: Major
                                Found in management/job.go - About 45 mins to fix

                                  Method UserManager.Link has 6 return statements (exceeds 4 allowed).
                                  Open

                                  func (m *UserManager) Link(id string, il *UserIdentityLink, opts ...RequestOption) (uIDs []UserIdentity, err error) {
                                      req, err := m.NewRequest("POST", m.URI("users", id, "identities"), il, opts...)
                                      if err != nil {
                                          return uIDs, err
                                      }
                                  Severity: Major
                                  Found in management/user.go - About 40 mins to fix

                                    Method Management.Request has 6 return statements (exceeds 4 allowed).
                                    Open

                                    func (m *Management) Request(method, uri string, v interface{}, options ...RequestOption) error {
                                    
                                        req, err := m.NewRequest(method, uri, v, options...)
                                        if err != nil {
                                            return err
                                    Severity: Major
                                    Found in management/management.go - About 40 mins to fix

                                      Method AnomalyManager.CheckIP has 5 return statements (exceeds 4 allowed).
                                      Open

                                      func (m *AnomalyManager) CheckIP(ip string, opts ...RequestOption) (isBlocked bool, err error) {
                                          req, err := m.NewRequest("GET", m.URI("anomaly", "blocks", "ips", ip), nil, opts...)
                                          if err != nil {
                                              return false, err
                                          }
                                      Severity: Major
                                      Found in management/anomaly.go - About 35 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language