go-auth0/auth0

View on GitHub
management/organization.go

Summary

Maintainability
B
4 hrs
Test Coverage
A
100%

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

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    func (m *OrganizationManager) AssignMemberRoles(id string, memberID string, roles []string, opts ...RequestOption) (err error) {
        body := struct {
            Roles []string `json:"roles"`
        }{
            Roles: roles,
    Severity: Minor
    Found in management/organization.go and 1 other location - About 45 mins to fix
    management/organization.go on lines 343..351

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 115.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    func (m *OrganizationManager) DeleteMemberRoles(id string, memberID string, roles []string, opts ...RequestOption) (err error) {
        body := struct {
            Roles []string `json:"roles"`
        }{
            Roles: roles,
    Severity: Minor
    Found in management/organization.go and 1 other location - About 45 mins to fix
    management/organization.go on lines 330..338

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 115.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    func (m *OrganizationManager) AddMembers(id string, memberIDs []string, opts ...RequestOption) (err error) {
        body := struct {
            Members []string `json:"members"`
        }{
            Members: memberIDs,
    Severity: Minor
    Found in management/organization.go and 1 other location - About 40 mins to fix
    management/organization.go on lines 309..317

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 108.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    func (m *OrganizationManager) DeleteMember(id string, memberIDs []string, opts ...RequestOption) (err error) {
        body := struct {
            Members []string `json:"members"`
        }{
            Members: memberIDs,
    Severity: Minor
    Found in management/organization.go and 1 other location - About 40 mins to fix
    management/organization.go on lines 296..304

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 108.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    exported type OrganizationList should have comment or be unexported
    Open

    type OrganizationList struct {
    Severity: Minor
    Found in management/organization.go by golint

    exported type OrganizationConnectionDetails should have comment or be unexported
    Open

    type OrganizationConnectionDetails struct {
    Severity: Minor
    Found in management/organization.go by golint

    comment on exported method OrganizationManager.AddMembers should be of the form "AddMembers ..."
    Open

    // Add members to an organization
    Severity: Minor
    Found in management/organization.go by golint

    comment on exported method OrganizationManager.UpdateConnection should be of the form "UpdateConnection ..."
    Open

    // Modify an enabled_connection belonging to an Organization
    Severity: Minor
    Found in management/organization.go by golint

    exported type OrganizationMember should have comment or be unexported
    Open

    type OrganizationMember struct {
    Severity: Minor
    Found in management/organization.go by golint

    comment on exported method OrganizationManager.CreateInvitation should be of the form "CreateInvitation ..."
    Open

    // Create invitations to organization
    Severity: Minor
    Found in management/organization.go by golint

    comment on exported method OrganizationManager.Members should be of the form "Members ..."
    Open

    // List organization members
    Severity: Minor
    Found in management/organization.go by golint

    comment on exported method OrganizationManager.AssignMemberRoles should be of the form "AssignMemberRoles ..."
    Open

    // Assign one or more roles to a given user that will be applied in the context of the provided organization
    Severity: Minor
    Found in management/organization.go by golint

    exported type OrganizationMemberList should have comment or be unexported
    Open

    type OrganizationMemberList struct {
    Severity: Minor
    Found in management/organization.go by golint

    comment on exported method OrganizationManager.ReadByName should be of the form "ReadByName ..."
    Open

    // Get a specific organization by name
    Severity: Minor
    Found in management/organization.go by golint

    comment on exported method OrganizationManager.MemberRoles should be of the form "MemberRoles ..."
    Open

    // Get the roles assigned to an organization member
    Severity: Minor
    Found in management/organization.go by golint

    exported type OrganizationInvitationInviter should have comment or be unexported
    Open

    type OrganizationInvitationInviter struct {
    Severity: Minor
    Found in management/organization.go by golint

    exported type OrganizationInvitationInvitee should have comment or be unexported
    Open

    type OrganizationInvitationInvitee struct {
    Severity: Minor
    Found in management/organization.go by golint

    comment on exported method OrganizationManager.Invitation should be of the form "Invitation ..."
    Open

    // Get an invitation to organization
    Severity: Minor
    Found in management/organization.go by golint

    exported type Organization should have comment or be unexported
    Open

    type Organization struct {
    Severity: Minor
    Found in management/organization.go by golint

    exported type OrganizationConnection should have comment or be unexported
    Open

    type OrganizationConnection struct {
    Severity: Minor
    Found in management/organization.go by golint

    exported type OrganizationConnectionList should have comment or be unexported
    Open

    type OrganizationConnectionList struct {
    Severity: Minor
    Found in management/organization.go by golint

    comment on exported method OrganizationManager.DeleteInvitation should be of the form "DeleteInvitation ..."
    Open

    // Delete an invitation to organization
    Severity: Minor
    Found in management/organization.go by golint

    comment on exported method OrganizationManager.AddConnection should be of the form "AddConnection ..."
    Open

    // Add connections to an organization
    Severity: Minor
    Found in management/organization.go by golint

    exported type OrganizationMemberRole should have comment or be unexported
    Open

    type OrganizationMemberRole struct {
    Severity: Minor
    Found in management/organization.go by golint

    comment on exported method OrganizationManager.Connections should be of the form "Connections ..."
    Open

    // Get connections enabled for an organization
    Severity: Minor
    Found in management/organization.go by golint

    comment on exported method OrganizationManager.Connection should be of the form "Connection ..."
    Open

    // Get an enabled connection for an organization
    Severity: Minor
    Found in management/organization.go by golint

    comment on exported method OrganizationManager.Invitations should be of the form "Invitations ..."
    Open

    // Get invitations to organization
    Severity: Minor
    Found in management/organization.go by golint

    comment on exported method OrganizationManager.DeleteMember should be of the form "DeleteMember ..."
    Open

    // Delete members from an organization
    Severity: Minor
    Found in management/organization.go by golint

    exported type OrganizationBranding should have comment or be unexported
    Open

    type OrganizationBranding struct {
    Severity: Minor
    Found in management/organization.go by golint

    exported type OrganizationInvitation should have comment or be unexported
    Open

    type OrganizationInvitation struct {
    Severity: Minor
    Found in management/organization.go by golint

    exported type OrganizationInvitationList should have comment or be unexported
    Open

    type OrganizationInvitationList struct {
    Severity: Minor
    Found in management/organization.go by golint

    exported type OrganizationManager should have comment or be unexported
    Open

    type OrganizationManager struct {
    Severity: Minor
    Found in management/organization.go by golint

    comment on exported method OrganizationManager.DeleteConnection should be of the form "DeleteConnection ..."
    Open

    // Delete connections from an organization
    Severity: Minor
    Found in management/organization.go by golint

    comment on exported method OrganizationManager.DeleteMemberRoles should be of the form "DeleteMemberRoles ..."
    Open

    // Remove one or more roles from a given user in the context of the provided organization
    Severity: Minor
    Found in management/organization.go by golint

    exported type OrganizationMemberRoleList should have comment or be unexported
    Open

    type OrganizationMemberRoleList struct {
    Severity: Minor
    Found in management/organization.go by golint

    comment on exported method OrganizationManager.Update should be of the form "Update ..."
    Open

    // Modify an organization
    Severity: Minor
    Found in management/organization.go by golint

    There are no issues that match your filters.

    Category
    Status