ory-am/hydra

View on GitHub
oauth2/fosite_store_helpers.go

Summary

Maintainability
F
6 days
Test Coverage

File fosite_store_helpers.go has 1000 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 217 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 7 hrs 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 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

          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

            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 281..302
            oauth2/fosite_store_helpers.go on lines 555..576

            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 281..302
            oauth2/fosite_store_helpers.go on lines 492..513

            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 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 492..513
            oauth2/fosite_store_helpers.go on lines 555..576

            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 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 430..438
            oauth2/fosite_store_helpers.go on lines 440..448
            oauth2/fosite_store_helpers.go on lines 460..468

            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=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 430..438
            oauth2/fosite_store_helpers.go on lines 450..458
            oauth2/fosite_store_helpers.go on lines 460..468

            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 430..438
            oauth2/fosite_store_helpers.go on lines 440..448
            oauth2/fosite_store_helpers.go on lines 450..458

            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 440..448
            oauth2/fosite_store_helpers.go on lines 450..458
            oauth2/fosite_store_helpers.go on lines 460..468

            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 137..145

            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 128..136

            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 893..902
            oauth2/fosite_store_helpers.go on lines 981..990
            oauth2/fosite_store_helpers.go on lines 1018..1027

            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 893..902
            oauth2/fosite_store_helpers.go on lines 981..990
            oauth2/fosite_store_helpers.go on lines 1055..1064

            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 981..990
            oauth2/fosite_store_helpers.go on lines 1018..1027
            oauth2/fosite_store_helpers.go on lines 1055..1064

            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 893..902
            oauth2/fosite_store_helpers.go on lines 1018..1027
            oauth2/fosite_store_helpers.go on lines 1055..1064

            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 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 663..670

            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 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 654..661

            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 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 672..678

            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 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 680..685

            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 1188..1227

            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 1150..1186

            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