ory-am/hydra

View on GitHub
oauth2/fosite_store_helpers.go

Summary

Maintainability
F
1 wk
Test Coverage

File fosite_store_helpers.go has 1020 lines of code (exceeds 500 allowed). Consider refactoring.
Open

// Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0

package oauth2

Severity: Major
Found in oauth2/fosite_store_helpers.go - About 1 day to fix

    Function testFositeJWTBearerGrantStorage has 236 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func testFositeJWTBearerGrantStorage(x InternalRegistry) func(t *testing.T) {
        return func(t *testing.T) {
            grantManager := x.GrantManager()
            keyManager := x.KeyManager()
            grantStorage := x.OAuth2Storage().(rfc7523.RFC7523KeyStorage)
    Severity: Major
    Found in oauth2/fosite_store_helpers.go - About 1 day to fix

      Function testHelperExpiryFields has 64 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func testHelperExpiryFields(reg InternalRegistry) func(t *testing.T) {
          return func(t *testing.T) {
              m := reg.OAuth2Storage()
              t.Parallel()
      
      
      Severity: Minor
      Found in oauth2/fosite_store_helpers.go - About 1 hr to fix

        Function doTestRollback has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        func doTestRollback(m InternalRegistry, t *testing.T,
            createFn func(context.Context, string, fosite.Requester) error,
            getFn func(context.Context, string, fosite.Session) (fosite.Requester, error),
            revokeFn func(context.Context, string) error,
        Severity: Minor
        Found in oauth2/fosite_store_helpers.go - About 35 mins to fix

          Function doTestCommit has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          func doTestCommit(m InternalRegistry, t *testing.T,
              createFn func(context.Context, string, fosite.Requester) error,
              getFn func(context.Context, string, fosite.Session) (fosite.Requester, error),
              revokeFn func(context.Context, string) error,
          Severity: Minor
          Found in oauth2/fosite_store_helpers.go - About 35 mins to fix

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

            func testHelperCreateGetDeleteRefreshTokenSession(x InternalRegistry) func(t *testing.T) {
                return func(t *testing.T) {
                    m := x.OAuth2Storage()
            
                    ctx := context.Background()
            Severity: Major
            Found in oauth2/fosite_store_helpers.go and 2 other locations - About 2 hrs to fix
            oauth2/fosite_store_helpers.go on lines 493..514
            oauth2/fosite_store_helpers.go on lines 556..577

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

            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 testHelperCreateGetDeleteAccessTokenSession(x InternalRegistry) func(t *testing.T) {
                return func(t *testing.T) {
                    m := x.OAuth2Storage()
            
                    ctx := context.Background()
            Severity: Major
            Found in oauth2/fosite_store_helpers.go and 2 other locations - About 2 hrs to fix
            oauth2/fosite_store_helpers.go on lines 282..303
            oauth2/fosite_store_helpers.go on lines 556..577

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

            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 testHelperCreateGetDeletePKCERequestSession(x InternalRegistry) func(t *testing.T) {
                return func(t *testing.T) {
                    m := x.OAuth2Storage()
            
                    ctx := context.Background()
            Severity: Major
            Found in oauth2/fosite_store_helpers.go and 2 other locations - About 2 hrs to fix
            oauth2/fosite_store_helpers.go on lines 282..303
            oauth2/fosite_store_helpers.go on lines 493..514

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

            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

                        require.NoError(t, grantManager.CreateGrant(context.TODO(), trust.Grant{
                            ID:              uuid.New(),
                            Issuer:          issuer,
                            Subject:         subject,
                            AllowAnySubject: false,
            Severity: Major
            Found in oauth2/fosite_store_helpers.go and 1 other location - About 2 hrs to fix
            oauth2/fosite_store_helpers.go on lines 943..952

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

            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

                        require.NoError(t, grantManager.CreateGrant(context.Background(), trust.Grant{
                            ID:              uuid.New(),
                            Issuer:          issuer,
                            Subject:         subject,
                            AllowAnySubject: false,
            Severity: Major
            Found in oauth2/fosite_store_helpers.go and 1 other location - About 2 hrs to fix
            oauth2/fosite_store_helpers.go on lines 956..965

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

            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

                    t.Run("case=CreateAuthorizeCodeSession", func(t *testing.T) {
                        id := uuid.New()
                        err := m.CreateAuthorizeCodeSession(ctx, id, &request)
                        require.NoError(t, err)
            
            
            Severity: Major
            Found in oauth2/fosite_store_helpers.go and 3 other locations - About 1 hr to fix
            oauth2/fosite_store_helpers.go on lines 431..439
            oauth2/fosite_store_helpers.go on lines 451..459
            oauth2/fosite_store_helpers.go on lines 461..469

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

            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

                    t.Run("case=CreateRefreshTokenSession", func(t *testing.T) {
                        id := uuid.New()
                        err := m.CreateRefreshTokenSession(ctx, id, &request)
                        require.NoError(t, err)
            
            
            Severity: Major
            Found in oauth2/fosite_store_helpers.go and 3 other locations - About 1 hr to fix
            oauth2/fosite_store_helpers.go on lines 441..449
            oauth2/fosite_store_helpers.go on lines 451..459
            oauth2/fosite_store_helpers.go on lines 461..469

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

            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

                    t.Run("case=CreateOpenIDConnectSession", func(t *testing.T) {
                        id := uuid.New()
                        err := m.CreateOpenIDConnectSession(ctx, id, &request)
                        require.NoError(t, err)
            
            
            Severity: Major
            Found in oauth2/fosite_store_helpers.go and 3 other locations - About 1 hr to fix
            oauth2/fosite_store_helpers.go on lines 431..439
            oauth2/fosite_store_helpers.go on lines 441..449
            oauth2/fosite_store_helpers.go on lines 451..459

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

            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

                    t.Run("case=CreatePKCERequestSession", func(t *testing.T) {
                        id := uuid.New()
                        err := m.CreatePKCERequestSession(ctx, id, &request)
                        require.NoError(t, err)
            
            
            Severity: Major
            Found in oauth2/fosite_store_helpers.go and 3 other locations - About 1 hr to fix
            oauth2/fosite_store_helpers.go on lines 431..439
            oauth2/fosite_store_helpers.go on lines 441..449
            oauth2/fosite_store_helpers.go on lines 461..469

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

            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

                {
                    ID:             "flush-2",
                    RequestedAt:    time.Now().Round(time.Second).Add(-(lifespan + time.Minute)),
                    Client:         &client.Client{ID: "foobar"},
                    RequestedScope: fosite.Arguments{"fa", "ba"},
            Severity: Major
            Found in oauth2/fosite_store_helpers.go and 1 other location - About 1 hr to fix
            oauth2/fosite_store_helpers.go on lines 138..146

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

            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

                {
                    ID:             "flush-3",
                    RequestedAt:    time.Now().Round(time.Second).Add(-(lifespan + time.Hour)),
                    Client:         &client.Client{ID: "foobar"},
                    RequestedScope: fosite.Arguments{"fa", "ba"},
            Severity: Major
            Found in oauth2/fosite_store_helpers.go and 1 other location - About 1 hr to fix
            oauth2/fosite_store_helpers.go on lines 129..137

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

            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

            Identical blocks of code found in 4 locations. Consider refactoring.
            Open

                        grant := trust.Grant{
                            ID:              uuid.New(),
                            Issuer:          issuer,
                            Subject:         subject,
                            AllowAnySubject: false,
            Severity: Major
            Found in oauth2/fosite_store_helpers.go and 3 other locations - About 1 hr to fix
            oauth2/fosite_store_helpers.go on lines 1003..1012
            oauth2/fosite_store_helpers.go on lines 1040..1049
            oauth2/fosite_store_helpers.go on lines 1077..1086

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

            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

            Identical blocks of code found in 4 locations. Consider refactoring.
            Open

                        grant := trust.Grant{
                            ID:              uuid.New(),
                            Issuer:          issuer,
                            Subject:         subject,
                            AllowAnySubject: false,
            Severity: Major
            Found in oauth2/fosite_store_helpers.go and 3 other locations - About 1 hr to fix
            oauth2/fosite_store_helpers.go on lines 894..903
            oauth2/fosite_store_helpers.go on lines 1040..1049
            oauth2/fosite_store_helpers.go on lines 1077..1086

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

            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

            Identical blocks of code found in 4 locations. Consider refactoring.
            Open

                        grant := trust.Grant{
                            ID:              uuid.New(),
                            Issuer:          issuer,
                            Subject:         subject,
                            AllowAnySubject: false,
            Severity: Major
            Found in oauth2/fosite_store_helpers.go and 3 other locations - About 1 hr to fix
            oauth2/fosite_store_helpers.go on lines 894..903
            oauth2/fosite_store_helpers.go on lines 1003..1012
            oauth2/fosite_store_helpers.go on lines 1040..1049

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

            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

            Identical blocks of code found in 4 locations. Consider refactoring.
            Open

                        grant := trust.Grant{
                            ID:              uuid.New(),
                            Issuer:          issuer,
                            Subject:         subject,
                            AllowAnySubject: false,
            Severity: Major
            Found in oauth2/fosite_store_helpers.go and 3 other locations - About 1 hr to fix
            oauth2/fosite_store_helpers.go on lines 894..903
            oauth2/fosite_store_helpers.go on lines 1003..1012
            oauth2/fosite_store_helpers.go on lines 1077..1086

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

            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 testFositeSqlStoreTransactionRollbackAccessToken(m InternalRegistry) func(t *testing.T) {
                return func(t *testing.T) {
                    {
                        doTestRollback(m, t, m.OAuth2Storage().CreateAccessTokenSession, m.OAuth2Storage().GetAccessTokenSession, m.OAuth2Storage().RevokeAccessToken)
                        doTestRollback(m, t, m.OAuth2Storage().CreateAccessTokenSession, m.OAuth2Storage().GetAccessTokenSession, m.OAuth2Storage().DeleteAccessTokenSession)
            Severity: Major
            Found in oauth2/fosite_store_helpers.go and 1 other location - About 1 hr to fix
            oauth2/fosite_store_helpers.go on lines 655..662

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

            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 testFositeSqlStoreTransactionCommitAccessToken(m InternalRegistry) func(t *testing.T) {
                return func(t *testing.T) {
                    {
                        doTestCommit(m, t, m.OAuth2Storage().CreateAccessTokenSession, m.OAuth2Storage().GetAccessTokenSession, m.OAuth2Storage().RevokeAccessToken)
                        doTestCommit(m, t, m.OAuth2Storage().CreateAccessTokenSession, m.OAuth2Storage().GetAccessTokenSession, m.OAuth2Storage().DeleteAccessTokenSession)
            Severity: Major
            Found in oauth2/fosite_store_helpers.go and 1 other location - About 1 hr to fix
            oauth2/fosite_store_helpers.go on lines 664..671

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

            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 testFositeSqlStoreTransactionCommitRefreshToken(m InternalRegistry) func(t *testing.T) {
            
                return func(t *testing.T) {
                    doTestCommit(m, t, m.OAuth2Storage().CreateRefreshTokenSession, m.OAuth2Storage().GetRefreshTokenSession, m.OAuth2Storage().RevokeRefreshToken)
                    doTestCommit(m, t, m.OAuth2Storage().CreateRefreshTokenSession, m.OAuth2Storage().GetRefreshTokenSession, m.OAuth2Storage().DeleteRefreshTokenSession)
            Severity: Major
            Found in oauth2/fosite_store_helpers.go and 1 other location - About 1 hr to fix
            oauth2/fosite_store_helpers.go on lines 681..686

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

            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 testFositeSqlStoreTransactionRollbackRefreshToken(m InternalRegistry) func(t *testing.T) {
                return func(t *testing.T) {
                    doTestRollback(m, t, m.OAuth2Storage().CreateRefreshTokenSession, m.OAuth2Storage().GetRefreshTokenSession, m.OAuth2Storage().RevokeRefreshToken)
                    doTestRollback(m, t, m.OAuth2Storage().CreateRefreshTokenSession, m.OAuth2Storage().GetRefreshTokenSession, m.OAuth2Storage().DeleteRefreshTokenSession)
                }
            Severity: Major
            Found in oauth2/fosite_store_helpers.go and 1 other location - About 1 hr to fix
            oauth2/fosite_store_helpers.go on lines 673..679

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

            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

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

            func doTestCommit(m InternalRegistry, t *testing.T,
                createFn func(context.Context, string, fosite.Requester) error,
                getFn func(context.Context, string, fosite.Session) (fosite.Requester, error),
                revokeFn func(context.Context, string) error,
            ) {
            Severity: Minor
            Found in oauth2/fosite_store_helpers.go and 1 other location - About 45 mins to fix
            oauth2/fosite_store_helpers.go on lines 1210..1249

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

            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

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

            func doTestRollback(m InternalRegistry, t *testing.T,
                createFn func(context.Context, string, fosite.Requester) error,
                getFn func(context.Context, string, fosite.Session) (fosite.Requester, error),
                revokeFn func(context.Context, string) error,
            ) {
            Severity: Minor
            Found in oauth2/fosite_store_helpers.go and 1 other location - About 45 mins to fix
            oauth2/fosite_store_helpers.go on lines 1172..1208

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

            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

            There are no issues that match your filters.

            Category
            Status