ory-am/hydra

View on GitHub

Showing 853 of 853 total issues

Method Handler.getOidcUserInfo has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring.
Open

func (h *Handler) getOidcUserInfo(w http.ResponseWriter, r *http.Request) {
    ctx := r.Context()
    session := NewSessionWithCustomClaims(ctx, h.c, "")
    tokenType, ar, err := h.r.OAuth2Provider().IntrospectToken(ctx, fosite.AccessTokenFromRequest(r), fosite.AccessToken, session)
    if err != nil {
Severity: Minor
Found in oauth2/handler.go - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Avoid deeply nested control flow statements.
Open

                            if dbName != dbal.DriverMySQL {
                                t.Errorf("an unexpected RFC6749 error with the name %q was returned.\n"+
                                    "Hint: has the refresh token error handling changed in fosite? If so, you need to add further "+
                                    "assertions here to cover the additional errors that are being returned by the handler.\n"+
                                    "DB version: %s\n"+
Severity: Major
Found in oauth2/oauth2_refresh_token_test.go - About 45 mins to fix

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

    func (mr *MockManagerMockRecorder) DeleteKey(ctx, set, kid interface{}) *gomock.Call {
        mr.mock.ctrl.T.Helper()
        return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteKey", reflect.TypeOf((*MockManager)(nil).DeleteKey), ctx, set, kid)
    }
    Severity: Major
    Found in jwk/manager_mock_test.go and 16 other locations - About 45 mins to fix
    hsm/crypto11_mock_test.go on lines 54..57
    hsm/crypto11_mock_test.go on lines 97..100
    hsm/hsm_mock_test.go on lines 84..87
    hsm/hsm_mock_test.go on lines 99..102
    jwk/manager_mock_test.go on lines 50..53
    jwk/manager_mock_test.go on lines 64..67
    jwk/manager_mock_test.go on lines 122..125
    jwk/manager_mock_test.go on lines 151..154
    jwk/manager_mock_test.go on lines 165..168
    oauth2/oauth2_provider_mock_test.go on lines 74..77
    oauth2/oauth2_provider_mock_test.go on lines 119..122
    oauth2/oauth2_provider_mock_test.go on lines 134..137
    oauth2/oauth2_provider_mock_test.go on lines 164..167
    oauth2/oauth2_provider_mock_test.go on lines 238..241
    oauth2/oauth2_provider_mock_test.go on lines 250..253
    oauth2/oauth2_provider_mock_test.go on lines 286..289

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 115.

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

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

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

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

    Refactorings

    Further Reading

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

    func (mr *MockManagerMockRecorder) GetKey(ctx, set, kid interface{}) *gomock.Call {
        mr.mock.ctrl.T.Helper()
        return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetKey", reflect.TypeOf((*MockManager)(nil).GetKey), ctx, set, kid)
    }
    Severity: Major
    Found in jwk/manager_mock_test.go and 16 other locations - About 45 mins to fix
    hsm/crypto11_mock_test.go on lines 54..57
    hsm/crypto11_mock_test.go on lines 97..100
    hsm/hsm_mock_test.go on lines 84..87
    hsm/hsm_mock_test.go on lines 99..102
    jwk/manager_mock_test.go on lines 50..53
    jwk/manager_mock_test.go on lines 64..67
    jwk/manager_mock_test.go on lines 78..81
    jwk/manager_mock_test.go on lines 151..154
    jwk/manager_mock_test.go on lines 165..168
    oauth2/oauth2_provider_mock_test.go on lines 74..77
    oauth2/oauth2_provider_mock_test.go on lines 119..122
    oauth2/oauth2_provider_mock_test.go on lines 134..137
    oauth2/oauth2_provider_mock_test.go on lines 164..167
    oauth2/oauth2_provider_mock_test.go on lines 238..241
    oauth2/oauth2_provider_mock_test.go on lines 250..253
    oauth2/oauth2_provider_mock_test.go on lines 286..289

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 115.

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

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

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

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

    Refactorings

    Further Reading

    Function createAccessTokenSessionPairwise has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    func createAccessTokenSessionPairwise(subject, client string, token string, expiresAt time.Time, fs x.FositeStorer, scopes fosite.Arguments, obfuscated string) {
    Severity: Minor
    Found in oauth2/revocator_test.go - About 45 mins to fix

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

      func (mr *MockManagerMockRecorder) AddKeySet(ctx, set, keys interface{}) *gomock.Call {
          mr.mock.ctrl.T.Helper()
          return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddKeySet", reflect.TypeOf((*MockManager)(nil).AddKeySet), ctx, set, keys)
      }
      Severity: Major
      Found in jwk/manager_mock_test.go and 16 other locations - About 45 mins to fix
      hsm/crypto11_mock_test.go on lines 54..57
      hsm/crypto11_mock_test.go on lines 97..100
      hsm/hsm_mock_test.go on lines 84..87
      hsm/hsm_mock_test.go on lines 99..102
      jwk/manager_mock_test.go on lines 50..53
      jwk/manager_mock_test.go on lines 78..81
      jwk/manager_mock_test.go on lines 122..125
      jwk/manager_mock_test.go on lines 151..154
      jwk/manager_mock_test.go on lines 165..168
      oauth2/oauth2_provider_mock_test.go on lines 74..77
      oauth2/oauth2_provider_mock_test.go on lines 119..122
      oauth2/oauth2_provider_mock_test.go on lines 134..137
      oauth2/oauth2_provider_mock_test.go on lines 164..167
      oauth2/oauth2_provider_mock_test.go on lines 238..241
      oauth2/oauth2_provider_mock_test.go on lines 250..253
      oauth2/oauth2_provider_mock_test.go on lines 286..289

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 115.

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

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

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

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

      Refactorings

      Further Reading

      Method Persister.flushInactiveTokens has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      func (p *Persister) flushInactiveTokens(ctx context.Context, notAfter time.Time, limit int, batchSize int, table tableName, lifespan time.Duration) (err error) {
      Severity: Minor
      Found in persistence/sql/persister_oauth2.go - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                    switch dbName {
                                    case dbal.DriverMySQL:
                                    case dbal.DriverPostgreSQL, dbal.DriverCockroachDB:
                                        var matched bool
                                        for _, errSubstr := range []string{
        Severity: Major
        Found in oauth2/oauth2_refresh_token_test.go - About 45 mins to fix

          Function BenchmarkClientCredentials has 7 return statements (exceeds 4 allowed).
          Open

          func BenchmarkClientCredentials(b *testing.B) {
              ctx := context.Background()
          
              spans := tracetest.NewSpanRecorder()
              tracer := trace.NewTracerProvider(trace.WithSpanProcessor(spans)).Tracer("")
          Severity: Major
          Found in oauth2/oauth2_client_credentials_bench_test.go - About 45 mins to fix

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

            func (mr *MockManagerMockRecorder) UpdateKey(ctx, set, key interface{}) *gomock.Call {
                mr.mock.ctrl.T.Helper()
                return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateKey", reflect.TypeOf((*MockManager)(nil).UpdateKey), ctx, set, key)
            }
            Severity: Major
            Found in jwk/manager_mock_test.go and 16 other locations - About 45 mins to fix
            hsm/crypto11_mock_test.go on lines 54..57
            hsm/crypto11_mock_test.go on lines 97..100
            hsm/hsm_mock_test.go on lines 84..87
            hsm/hsm_mock_test.go on lines 99..102
            jwk/manager_mock_test.go on lines 50..53
            jwk/manager_mock_test.go on lines 64..67
            jwk/manager_mock_test.go on lines 78..81
            jwk/manager_mock_test.go on lines 122..125
            jwk/manager_mock_test.go on lines 165..168
            oauth2/oauth2_provider_mock_test.go on lines 74..77
            oauth2/oauth2_provider_mock_test.go on lines 119..122
            oauth2/oauth2_provider_mock_test.go on lines 134..137
            oauth2/oauth2_provider_mock_test.go on lines 164..167
            oauth2/oauth2_provider_mock_test.go on lines 238..241
            oauth2/oauth2_provider_mock_test.go on lines 250..253
            oauth2/oauth2_provider_mock_test.go on lines 286..289

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 115.

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

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

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

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

            Refactorings

            Further Reading

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

            func (mr *MockSignerDecrypterMockRecorder) Sign(arg0, arg1, arg2 interface{}) *gomock.Call {
                mr.mock.ctrl.T.Helper()
                return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Sign", reflect.TypeOf((*MockSignerDecrypter)(nil).Sign), arg0, arg1, arg2)
            }
            Severity: Major
            Found in hsm/crypto11_mock_test.go and 16 other locations - About 45 mins to fix
            hsm/crypto11_mock_test.go on lines 54..57
            hsm/hsm_mock_test.go on lines 84..87
            hsm/hsm_mock_test.go on lines 99..102
            jwk/manager_mock_test.go on lines 50..53
            jwk/manager_mock_test.go on lines 64..67
            jwk/manager_mock_test.go on lines 78..81
            jwk/manager_mock_test.go on lines 122..125
            jwk/manager_mock_test.go on lines 151..154
            jwk/manager_mock_test.go on lines 165..168
            oauth2/oauth2_provider_mock_test.go on lines 74..77
            oauth2/oauth2_provider_mock_test.go on lines 119..122
            oauth2/oauth2_provider_mock_test.go on lines 134..137
            oauth2/oauth2_provider_mock_test.go on lines 164..167
            oauth2/oauth2_provider_mock_test.go on lines 238..241
            oauth2/oauth2_provider_mock_test.go on lines 250..253
            oauth2/oauth2_provider_mock_test.go on lines 286..289

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 115.

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

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

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

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

            Refactorings

            Further Reading

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

            func (mr *MockContextMockRecorder) GenerateECDSAKeyPairWithAttributes(public, private, curve interface{}) *gomock.Call {
                mr.mock.ctrl.T.Helper()
                return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenerateECDSAKeyPairWithAttributes", reflect.TypeOf((*MockContext)(nil).GenerateECDSAKeyPairWithAttributes), public, private, curve)
            }
            Severity: Major
            Found in hsm/hsm_mock_test.go and 16 other locations - About 45 mins to fix
            hsm/crypto11_mock_test.go on lines 54..57
            hsm/crypto11_mock_test.go on lines 97..100
            hsm/hsm_mock_test.go on lines 99..102
            jwk/manager_mock_test.go on lines 50..53
            jwk/manager_mock_test.go on lines 64..67
            jwk/manager_mock_test.go on lines 78..81
            jwk/manager_mock_test.go on lines 122..125
            jwk/manager_mock_test.go on lines 151..154
            jwk/manager_mock_test.go on lines 165..168
            oauth2/oauth2_provider_mock_test.go on lines 74..77
            oauth2/oauth2_provider_mock_test.go on lines 119..122
            oauth2/oauth2_provider_mock_test.go on lines 134..137
            oauth2/oauth2_provider_mock_test.go on lines 164..167
            oauth2/oauth2_provider_mock_test.go on lines 238..241
            oauth2/oauth2_provider_mock_test.go on lines 250..253
            oauth2/oauth2_provider_mock_test.go on lines 286..289

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 115.

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

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

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

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

            Refactorings

            Further Reading

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

            func (mr *MockSignerDecrypterMockRecorder) Decrypt(arg0, arg1, arg2 interface{}) *gomock.Call {
                mr.mock.ctrl.T.Helper()
                return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Decrypt", reflect.TypeOf((*MockSignerDecrypter)(nil).Decrypt), arg0, arg1, arg2)
            }
            Severity: Major
            Found in hsm/crypto11_mock_test.go and 16 other locations - About 45 mins to fix
            hsm/crypto11_mock_test.go on lines 97..100
            hsm/hsm_mock_test.go on lines 84..87
            hsm/hsm_mock_test.go on lines 99..102
            jwk/manager_mock_test.go on lines 50..53
            jwk/manager_mock_test.go on lines 64..67
            jwk/manager_mock_test.go on lines 78..81
            jwk/manager_mock_test.go on lines 122..125
            jwk/manager_mock_test.go on lines 151..154
            jwk/manager_mock_test.go on lines 165..168
            oauth2/oauth2_provider_mock_test.go on lines 74..77
            oauth2/oauth2_provider_mock_test.go on lines 119..122
            oauth2/oauth2_provider_mock_test.go on lines 134..137
            oauth2/oauth2_provider_mock_test.go on lines 164..167
            oauth2/oauth2_provider_mock_test.go on lines 238..241
            oauth2/oauth2_provider_mock_test.go on lines 250..253
            oauth2/oauth2_provider_mock_test.go on lines 286..289

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 115.

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

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

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

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

            Refactorings

            Further Reading

            Function checkTokenResponse has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring.
            Open

            func checkTokenResponse(token oauth2token) {
                if token.RefreshToken == "" {
                    log.Fatalf("Expected a refresh token but none received: %+v", token)
                }
            
            
            Severity: Minor
            Found in test/mock-client/main.go - About 45 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function TestUserinfo has 7 return statements (exceeds 4 allowed).
            Open

            func TestUserinfo(t *testing.T) {
                ctx := context.Background()
                conf := internal.NewConfigurationWithDefaults()
                conf.MustSet(ctx, config.KeyScopeStrategy, "")
                conf.MustSet(ctx, config.KeyAuthCodeLifespan, lifespan)
            Severity: Major
            Found in oauth2/handler_test.go - About 45 mins to fix

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

              func (mr *MockOAuth2ProviderMockRecorder) NewAccessRequest(arg0, arg1, arg2 interface{}) *gomock.Call {
                  mr.mock.ctrl.T.Helper()
                  return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewAccessRequest", reflect.TypeOf((*MockOAuth2Provider)(nil).NewAccessRequest), arg0, arg1, arg2)
              }
              Severity: Major
              Found in oauth2/oauth2_provider_mock_test.go and 16 other locations - About 45 mins to fix
              hsm/crypto11_mock_test.go on lines 54..57
              hsm/crypto11_mock_test.go on lines 97..100
              hsm/hsm_mock_test.go on lines 84..87
              hsm/hsm_mock_test.go on lines 99..102
              jwk/manager_mock_test.go on lines 50..53
              jwk/manager_mock_test.go on lines 64..67
              jwk/manager_mock_test.go on lines 78..81
              jwk/manager_mock_test.go on lines 122..125
              jwk/manager_mock_test.go on lines 151..154
              jwk/manager_mock_test.go on lines 165..168
              oauth2/oauth2_provider_mock_test.go on lines 119..122
              oauth2/oauth2_provider_mock_test.go on lines 134..137
              oauth2/oauth2_provider_mock_test.go on lines 164..167
              oauth2/oauth2_provider_mock_test.go on lines 238..241
              oauth2/oauth2_provider_mock_test.go on lines 250..253
              oauth2/oauth2_provider_mock_test.go on lines 286..289

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 115.

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

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

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

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

              Refactorings

              Further Reading

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

              func (mr *MockContextMockRecorder) GenerateRSAKeyPairWithAttributes(public, private, bits interface{}) *gomock.Call {
                  mr.mock.ctrl.T.Helper()
                  return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenerateRSAKeyPairWithAttributes", reflect.TypeOf((*MockContext)(nil).GenerateRSAKeyPairWithAttributes), public, private, bits)
              }
              Severity: Major
              Found in hsm/hsm_mock_test.go and 16 other locations - About 45 mins to fix
              hsm/crypto11_mock_test.go on lines 54..57
              hsm/crypto11_mock_test.go on lines 97..100
              hsm/hsm_mock_test.go on lines 84..87
              jwk/manager_mock_test.go on lines 50..53
              jwk/manager_mock_test.go on lines 64..67
              jwk/manager_mock_test.go on lines 78..81
              jwk/manager_mock_test.go on lines 122..125
              jwk/manager_mock_test.go on lines 151..154
              jwk/manager_mock_test.go on lines 165..168
              oauth2/oauth2_provider_mock_test.go on lines 74..77
              oauth2/oauth2_provider_mock_test.go on lines 119..122
              oauth2/oauth2_provider_mock_test.go on lines 134..137
              oauth2/oauth2_provider_mock_test.go on lines 164..167
              oauth2/oauth2_provider_mock_test.go on lines 238..241
              oauth2/oauth2_provider_mock_test.go on lines 250..253
              oauth2/oauth2_provider_mock_test.go on lines 286..289

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 115.

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

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

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

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

              Refactorings

              Further Reading

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

              func (mr *MockOAuth2ProviderMockRecorder) WriteIntrospectionError(arg0, arg1, arg2 interface{}) *gomock.Call {
                  mr.mock.ctrl.T.Helper()
                  return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteIntrospectionError", reflect.TypeOf((*MockOAuth2Provider)(nil).WriteIntrospectionError), arg0, arg1, arg2)
              }
              Severity: Major
              Found in oauth2/oauth2_provider_mock_test.go and 16 other locations - About 45 mins to fix
              hsm/crypto11_mock_test.go on lines 54..57
              hsm/crypto11_mock_test.go on lines 97..100
              hsm/hsm_mock_test.go on lines 84..87
              hsm/hsm_mock_test.go on lines 99..102
              jwk/manager_mock_test.go on lines 50..53
              jwk/manager_mock_test.go on lines 64..67
              jwk/manager_mock_test.go on lines 78..81
              jwk/manager_mock_test.go on lines 122..125
              jwk/manager_mock_test.go on lines 151..154
              jwk/manager_mock_test.go on lines 165..168
              oauth2/oauth2_provider_mock_test.go on lines 74..77
              oauth2/oauth2_provider_mock_test.go on lines 119..122
              oauth2/oauth2_provider_mock_test.go on lines 134..137
              oauth2/oauth2_provider_mock_test.go on lines 164..167
              oauth2/oauth2_provider_mock_test.go on lines 250..253
              oauth2/oauth2_provider_mock_test.go on lines 286..289

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 115.

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

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

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

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

              Refactorings

              Further Reading

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

              func (mr *MockOAuth2ProviderMockRecorder) NewIntrospectionRequest(arg0, arg1, arg2 interface{}) *gomock.Call {
                  mr.mock.ctrl.T.Helper()
                  return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewIntrospectionRequest", reflect.TypeOf((*MockOAuth2Provider)(nil).NewIntrospectionRequest), arg0, arg1, arg2)
              }
              Severity: Major
              Found in oauth2/oauth2_provider_mock_test.go and 16 other locations - About 45 mins to fix
              hsm/crypto11_mock_test.go on lines 54..57
              hsm/crypto11_mock_test.go on lines 97..100
              hsm/hsm_mock_test.go on lines 84..87
              hsm/hsm_mock_test.go on lines 99..102
              jwk/manager_mock_test.go on lines 50..53
              jwk/manager_mock_test.go on lines 64..67
              jwk/manager_mock_test.go on lines 78..81
              jwk/manager_mock_test.go on lines 122..125
              jwk/manager_mock_test.go on lines 151..154
              jwk/manager_mock_test.go on lines 165..168
              oauth2/oauth2_provider_mock_test.go on lines 74..77
              oauth2/oauth2_provider_mock_test.go on lines 119..122
              oauth2/oauth2_provider_mock_test.go on lines 164..167
              oauth2/oauth2_provider_mock_test.go on lines 238..241
              oauth2/oauth2_provider_mock_test.go on lines 250..253
              oauth2/oauth2_provider_mock_test.go on lines 286..289

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 115.

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

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

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

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

              Refactorings

              Further Reading

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

              func (mr *MockOAuth2ProviderMockRecorder) WriteIntrospectionResponse(arg0, arg1, arg2 interface{}) *gomock.Call {
                  mr.mock.ctrl.T.Helper()
                  return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteIntrospectionResponse", reflect.TypeOf((*MockOAuth2Provider)(nil).WriteIntrospectionResponse), arg0, arg1, arg2)
              }
              Severity: Major
              Found in oauth2/oauth2_provider_mock_test.go and 16 other locations - About 45 mins to fix
              hsm/crypto11_mock_test.go on lines 54..57
              hsm/crypto11_mock_test.go on lines 97..100
              hsm/hsm_mock_test.go on lines 84..87
              hsm/hsm_mock_test.go on lines 99..102
              jwk/manager_mock_test.go on lines 50..53
              jwk/manager_mock_test.go on lines 64..67
              jwk/manager_mock_test.go on lines 78..81
              jwk/manager_mock_test.go on lines 122..125
              jwk/manager_mock_test.go on lines 151..154
              jwk/manager_mock_test.go on lines 165..168
              oauth2/oauth2_provider_mock_test.go on lines 74..77
              oauth2/oauth2_provider_mock_test.go on lines 119..122
              oauth2/oauth2_provider_mock_test.go on lines 134..137
              oauth2/oauth2_provider_mock_test.go on lines 164..167
              oauth2/oauth2_provider_mock_test.go on lines 238..241
              oauth2/oauth2_provider_mock_test.go on lines 286..289

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 115.

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

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

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

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

              Refactorings

              Further Reading

              Severity
              Category
              Status
              Source
              Language