Showing 25 of 69 total issues
Function IsURLWithNoFragment
has 5 return statements (exceeds 4 allowed). Open
Open
func IsURLWithNoFragment(i interface{}, k string) (warnings []string, errors []error) {
v, ok := i.(string)
if !ok {
errors = append(errors, fmt.Errorf("expected type of %q to be string", k))
Function readBranding
has 5 return statements (exceeds 4 allowed). Open
Open
func readBranding(d *schema.ResourceData, m interface{}) error {
api := m.(*management.Management)
branding, err := api.Branding.Read()
if err != nil {
if mErr, ok := err.(management.Error); ok {
Function readOrganization
has 5 return statements (exceeds 4 allowed). Open
Open
func readOrganization(d *schema.ResourceData, m interface{}) error {
api := m.(*management.Management)
o, err := api.Organization.Read(d.Id())
if err != nil {
if mErr, ok := err.(management.Error); ok {
Function readDataClient
has 5 return statements (exceeds 4 allowed). Open
Open
func readDataClient(d *schema.ResourceData, m interface{}) error {
clientId := auth0.StringValue(String(d, "client_id"))
if clientId != "" {
d.SetId(clientId)
return readClient(d, m)
Function readGuardian
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
Open
func readGuardian(d *schema.ResourceData, m interface{}) error {
api := m.(*management.Management)
mt, err := api.Guardian.MultiFactor.Phone.MessageTypes()
if err != nil {
return err
- 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"