inklabs/goauth2

View on GitHub

Showing 21 of 21 total issues

Function initDB has 105 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func initDB(goauth2App *goauth2.App, store rangedb.Store, goAuth2Host string) error {
    const (
        userID       = "589a2ce8a34442c9a36f8b0659832165"
        email        = "john@example.com"
        password     = "Pass123"
Severity: Major
Found in cmd/goauth2/main.go - About 3 hrs to fix

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

    func main() {
        fmt.Println("OAuth2 Server")
        flag.CommandLine = flag.NewFlagSet(os.Args[0], flag.ExitOnError)
    
        requestedOauth2Port := flag.Uint("port", 0, "port")
    Severity: Major
    Found in cmd/goauth2/main.go - About 2 hrs to fix

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

      func (a *clientApplicationCommandAuthorization) RequestAuthorizationCodeViaAuthorizationCodeGrant(c RequestAuthorizationCodeViaAuthorizationCodeGrant) bool {
          clientApplication := a.loadClientApplicationAggregate(c.ClientID)
      
          if !clientApplication.IsOnBoarded {
              a.raise(RequestAuthorizationCodeViaAuthorizationCodeGrantWasRejectedDueToInvalidClientApplicationID{
      Severity: Major
      Found in client_application_command_authorization.go and 1 other location - About 1 hr to fix
      client_application_command_authorization.go on lines 63..84

      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 161.

      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 (a *clientApplicationCommandAuthorization) RequestAccessTokenViaImplicitGrant(c RequestAccessTokenViaImplicitGrant) bool {
          clientApplication := a.loadClientApplicationAggregate(c.ClientID)
      
          if !clientApplication.IsOnBoarded {
              a.raise(RequestAccessTokenViaImplicitGrantWasRejectedDueToInvalidClientApplicationID{
      Severity: Major
      Found in client_application_command_authorization.go and 1 other location - About 1 hr to fix
      client_application_command_authorization.go on lines 130..151

      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 161.

      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 (a *clientApplicationCommandAuthorization) RequestAccessTokenViaRefreshTokenGrant(c RequestAccessTokenViaRefreshTokenGrant) bool {
          clientApplication := a.loadClientApplicationAggregate(c.ClientID)
      
          if !clientApplication.IsOnBoarded {
              a.raise(RequestAccessTokenViaRefreshTokenGrantWasRejectedDueToInvalidClientApplicationCredentials{
      Severity: Major
      Found in client_application_command_authorization.go and 1 other location - About 1 hr to fix
      client_application_command_authorization.go on lines 86..106

      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 152.

      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 (a *clientApplicationCommandAuthorization) RequestAccessTokenViaROPCGrant(c RequestAccessTokenViaROPCGrant) bool {
          clientApplication := a.loadClientApplicationAggregate(c.ClientID)
      
          if !clientApplication.IsOnBoarded {
              a.raise(RequestAccessTokenViaROPCGrantWasRejectedDueToInvalidClientApplicationCredentials{
      Severity: Major
      Found in client_application_command_authorization.go and 1 other location - About 1 hr to fix
      client_application_command_authorization.go on lines 108..128

      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 152.

      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 4 locations. Consider refactoring.
      Open

      func (a *resourceOwnerCommandAuthorization) OnBoardClientApplication(c OnBoardClientApplication) bool {
          resourceOwner := a.loadResourceOwnerAggregate(c.UserID)
      
          if !resourceOwner.IsOnBoarded {
              a.raise(OnBoardClientApplicationWasRejectedDueToUnAuthorizeUser{
      Severity: Major
      Found in resource_owner_command_authorization.go and 3 other locations - About 1 hr to fix
      resource_owner_command_authorization.go on lines 62..82
      resource_owner_command_authorization.go on lines 84..104
      resource_owner_command_authorization.go on lines 128..148

      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 146.

      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 4 locations. Consider refactoring.
      Open

      func (a *resourceOwnerCommandAuthorization) AuthorizeUserToOnBoardClientApplications(c AuthorizeUserToOnBoardClientApplications) bool {
          authorizingUser := a.loadResourceOwnerAggregate(c.AuthorizingUserID)
      
          if !authorizingUser.IsOnBoarded {
              a.raise(AuthorizeUserToOnBoardClientApplicationsWasRejectedDueToMissingAuthorizingUser{
      Severity: Major
      Found in resource_owner_command_authorization.go and 3 other locations - About 1 hr to fix
      resource_owner_command_authorization.go on lines 62..82
      resource_owner_command_authorization.go on lines 106..126
      resource_owner_command_authorization.go on lines 128..148

      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 146.

      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 4 locations. Consider refactoring.
      Open

      func (a *resourceOwnerCommandAuthorization) GrantUserAdministratorRole(c GrantUserAdministratorRole) bool {
          grantingUser := a.loadResourceOwnerAggregate(c.GrantingUserID)
      
          if !grantingUser.IsOnBoarded {
              a.raise(GrantUserAdministratorRoleWasRejectedDueToMissingGrantingUser{
      Severity: Major
      Found in resource_owner_command_authorization.go and 3 other locations - About 1 hr to fix
      resource_owner_command_authorization.go on lines 84..104
      resource_owner_command_authorization.go on lines 106..126
      resource_owner_command_authorization.go on lines 128..148

      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 146.

      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 4 locations. Consider refactoring.
      Open

      func (a *resourceOwnerCommandAuthorization) OnBoardUser(c OnBoardUser) bool {
          resourceOwner := a.loadResourceOwnerAggregate(c.GrantingUserID)
      
          if !resourceOwner.IsOnBoarded {
              a.raise(OnBoardUserWasRejectedDueToNonAdministrator{
      Severity: Major
      Found in resource_owner_command_authorization.go and 3 other locations - About 1 hr to fix
      resource_owner_command_authorization.go on lines 62..82
      resource_owner_command_authorization.go on lines 84..104
      resource_owner_command_authorization.go on lines 106..126

      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 146.

      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 3 locations. Consider refactoring.
      Open

      func newRefreshToken(iter rangedb.RecordIterator, generator TokenGenerator, clock clock.Clock) *refreshToken {
          aggregate := &refreshToken{
              tokenGenerator: generator,
              clock:          clock,
          }
      Severity: Major
      Found in refresh_token.go and 2 other locations - About 50 mins to fix
      authorization_code.go on lines 28..41
      resource_owner.go on lines 41..54

      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 119.

      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 3 locations. Consider refactoring.
      Open

      func newAuthorizationCode(iter rangedb.RecordIterator, generator TokenGenerator, clock clock.Clock) *authorizationCode {
          aggregate := &authorizationCode{
              tokenGenerator: generator,
              clock:          clock,
          }
      Severity: Major
      Found in authorization_code.go and 2 other locations - About 50 mins to fix
      refresh_token.go on lines 35..48
      resource_owner.go on lines 41..54

      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 119.

      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 3 locations. Consider refactoring.
      Open

      func newResourceOwner(iter rangedb.RecordIterator, tokenGenerator TokenGenerator, clock clock.Clock) *resourceOwner {
          aggregate := &resourceOwner{
              tokenGenerator: tokenGenerator,
              clock:          clock,
          }
      Severity: Major
      Found in resource_owner.go and 2 other locations - About 50 mins to fix
      authorization_code.go on lines 28..41
      refresh_token.go on lines 35..48

      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 119.

      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 (a *refreshToken) apply(event rangedb.Event) {
          switch e := event.(type) {
      
          case *RefreshTokenWasIssuedToUser:
              a.IsLoaded = true
      Severity: Minor
      Found in refresh_token.go and 1 other location - About 45 mins to fix
      resource_owner.go on lines 56..71

      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 113.

      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 (a *resourceOwner) apply(event rangedb.Event) {
          switch e := event.(type) {
      
          case *UserWasOnBoarded:
              a.IsOnBoarded = true
      Severity: Minor
      Found in resource_owner.go and 1 other location - About 45 mins to fix
      refresh_token.go on lines 50..65

      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 113.

      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

      Method webApp.submitAdminLogin has 6 return statements (exceeds 4 allowed).
      Open

      func (a *webApp) submitAdminLogin(w http.ResponseWriter, r *http.Request) {
          err := r.ParseForm()
          if err != nil {
              writeInvalidRequestResponse(w)
              return
      Severity: Major
      Found in web/admin_web_app.go - About 40 mins to fix

        Function New has 5 return statements (exceeds 4 allowed).
        Open

        func New(options ...Option) (*webApp, error) {
            goAuth2App, err := goauth2.New()
            if err != nil {
                return nil, err
            }
        Severity: Major
        Found in web/web_app.go - About 35 mins to fix

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

          func (a *resourceOwner) AuthorizeUserToOnBoardClientApplications(c AuthorizeUserToOnBoardClientApplications) {
              if !a.IsOnBoarded {
                  a.raise(AuthorizeUserToOnBoardClientApplicationsWasRejectedDueToMissingTargetUser{
                      UserID:            c.UserID,
                      AuthorizingUserID: c.AuthorizingUserID,
          Severity: Minor
          Found in resource_owner.go and 1 other location - About 35 mins to fix
          resource_owner.go on lines 126..139

          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 103.

          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 (a *resourceOwner) GrantUserAdministratorRole(c GrantUserAdministratorRole) {
              if !a.IsOnBoarded {
                  a.raise(GrantUserAdministratorRoleWasRejectedDueToMissingTargetUser{
                      UserID:         c.UserID,
                      GrantingUserID: c.GrantingUserID,
          Severity: Minor
          Found in resource_owner.go and 1 other location - About 35 mins to fix
          resource_owner.go on lines 141..154

          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 103.

          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

              a.raise(
                  AccessTokenWasIssuedToUserViaRefreshTokenGrant{
                      RefreshToken: c.RefreshToken,
                      UserID:       a.UserID,
                      ClientID:     c.ClientID,
          Severity: Minor
          Found in refresh_token.go and 1 other location - About 30 mins to fix
          authorization_code.go on lines 112..127

          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 100.

          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

          Severity
          Category
          Status
          Source
          Language