Showing 20 of 45 total issues
File management.gen.go
has 4498 lines of code (exceeds 500 allowed). Consider refactoring. Open
Open
// Code generated by gen-accessors; DO NOT EDIT.
package management
import (
ConnectionOptionsFacebook
has 47 methods (exceeds 20 allowed). Consider refactoring. Open
Open
func (c *ConnectionOptionsFacebook) GetAdsManagement() bool {
if c == nil || c.AdsManagement == nil {
return false
}
return *c.AdsManagement
File connection.go
has 621 lines of code (exceeds 500 allowed). Consider refactoring. Open
Open
package management
import (
"encoding/json"
"sort"
ConnectionOptionsGoogleOAuth2
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
Open
func (c *ConnectionOptionsGoogleOAuth2) GetAdsenseManagement() bool {
if c == nil || c.AdsenseManagement == nil {
return false
}
return *c.AdsenseManagement
Method templateData.process
has a Cognitive Complexity of 42 (exceeds 20 allowed). Consider refactoring. Open
Open
func (t *templateData) process(f *ast.File) error {
for _, decl := range f.Decls {
gd, ok := decl.(*ast.GenDecl)
if !ok {
continue
- Read upRead up
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
Open
func (c *ConnectionOptionsWindowsLive) GetCalendars() bool {
if c == nil || c.Calendars == nil {
return false
}
return *c.Calendars
Client
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
Open
func (c *Client) GetAppType() string {
if c == nil || c.AppType == nil {
return ""
}
return *c.AppType
ConnectionOptionsGitHub
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
Open
func (c *ConnectionOptionsGitHub) GetAdminOrg() bool {
if c == nil || c.AdminOrg == nil {
return false
}
return *c.AdminOrg
ConnectionOptionsAzureAD
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
Open
func (c *ConnectionOptionsAzureAD) GetAdmin() bool {
if c == nil || c.Admin == nil {
return false
}
return *c.Admin
User
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
Open
func (u *User) GetBlocked() bool {
if u == nil || u.Blocked == nil {
return false
}
return *u.Blocked
ConnectionOptionsSAML
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
func (c *ConnectionOptionsSAML) GetCert() string {
if c == nil || c.Cert == nil {
return ""
}
return *c.Cert
UserManager
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
type UserManager struct {
*Management
}
OrganizationManager
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
Open
type OrganizationManager struct {
*Management
}
Method Connection.UnmarshalJSON
has 59 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (c *Connection) UnmarshalJSON(b []byte) error {
type connection Connection
type connectionWrapper struct {
*connection
Method templateData.process
has 56 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (t *templateData) process(f *ast.File) error {
for _, decl := range f.Decls {
gd, ok := decl.(*ast.GenDecl)
if !ok {
continue
Function New
has 51 lines of code (exceeds 50 allowed). Consider refactoring. Open
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 {
Method JobManager.ImportUsers
has 7 return statements (exceeds 4 allowed). Open
Open
func (m *JobManager) ImportUsers(j *Job, opts ...RequestOption) error {
var payload bytes.Buffer
mp := multipart.NewWriter(&payload)
Method UserManager.Link
has 6 return statements (exceeds 4 allowed). Open
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
}
Method Management.Request
has 6 return statements (exceeds 4 allowed). Open
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
Method AnomalyManager.CheckIP
has 5 return statements (exceeds 4 allowed). Open
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
}