ory-am/hydra

View on GitHub

Showing 853 of 853 total issues

Method JwkAPIService.SetJsonWebKeySetExecute has 8 return statements (exceeds 4 allowed).
Open

func (a *JwkAPIService) SetJsonWebKeySetExecute(r ApiSetJsonWebKeySetRequest) (*JsonWebKeySet, *http.Response, error) {
    var (
        localVarHTTPMethod  = http.MethodPut
        localVarPostBody    interface{}
        formFiles           []formFile
Severity: Major
Found in internal/httpclient/api_jwk.go - About 50 mins to fix

    Method MetadataAPIService.IsAliveExecute has 8 return statements (exceeds 4 allowed).
    Open

    func (a *MetadataAPIService) IsAliveExecute(r ApiIsAliveRequest) (*HealthStatus, *http.Response, error) {
        var (
            localVarHTTPMethod  = http.MethodGet
            localVarPostBody    interface{}
            formFiles           []formFile
    Severity: Major
    Found in internal/httpclient/api_metadata.go - About 50 mins to fix

      Method JwkAPIService.SetJsonWebKeyExecute has 8 return statements (exceeds 4 allowed).
      Open

      func (a *JwkAPIService) SetJsonWebKeyExecute(r ApiSetJsonWebKeyRequest) (*JsonWebKey, *http.Response, error) {
          var (
              localVarHTTPMethod  = http.MethodPut
              localVarPostBody    interface{}
              formFiles           []formFile
      Severity: Major
      Found in internal/httpclient/api_jwk.go - About 50 mins to fix

        Method WellknownAPIService.DiscoverJsonWebKeysExecute has 8 return statements (exceeds 4 allowed).
        Open

        func (a *WellknownAPIService) DiscoverJsonWebKeysExecute(r ApiDiscoverJsonWebKeysRequest) (*JsonWebKeySet, *http.Response, error) {
            var (
                localVarHTTPMethod  = http.MethodGet
                localVarPostBody    interface{}
                formFiles           []formFile
        Severity: Major
        Found in internal/httpclient/api_wellknown.go - About 50 mins to fix

          Method KeyManager.GenerateAndPersistKeySet has 8 return statements (exceeds 4 allowed).
          Open

          func (m *KeyManager) GenerateAndPersistKeySet(ctx context.Context, set, kid, alg, use string) (_ *jose.JSONWebKeySet, err error) {
              ctx, span := otel.GetTracerProvider().Tracer(tracingComponent).Start(ctx, "hsm.GenerateAndPersistKeySet",
                  trace.WithAttributes(
                      attribute.String("set", set),
                      attribute.String("kid", kid),
          Severity: Major
          Found in hsm/manager_hsm.go - About 50 mins to fix

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

                t.Run("UpdateKeySet_WithError", func(t *testing.T) {
                    softwareKeyManager.EXPECT().UpdateKeySet(gomock.Any(), gomock.Eq("set1"), gomock.Any()).Return(errors.New("test"))
                    err := keyManager.UpdateKeySet(context.TODO(), "set1", nil)
                    assert.Error(t, err, "test")
                })
            Severity: Major
            Found in jwk/manager_strategy_test.go and 3 other locations - About 50 mins to fix
            jwk/manager_strategy_test.go on lines 57..61
            jwk/manager_strategy_test.go on lines 69..73
            jwk/manager_strategy_test.go on lines 81..85

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

            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

                if e := &(fosite.RFC6749Error{}); errors.As(err, &e) {
                    x.LogAudit(r, err, h.r.AuditLogger())
                    h.writeAuthorizeError(w, r, authorizeRequest, err)
                    return
                } else if err != nil {
            Severity: Minor
            Found in oauth2/handler.go and 1 other location - About 50 mins to fix
            oauth2/handler.go on lines 1066..1074

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

            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

                } else if e := &(fosite.RFC6749Error{}); errors.As(err, &e) {
                    x.LogAudit(r, err, h.r.AuditLogger())
                    h.writeAuthorizeError(w, r, authorizeRequest, err)
                    return
                } else if err != nil {
            Severity: Minor
            Found in oauth2/handler.go and 1 other location - About 50 mins to fix
            oauth2/handler.go on lines 1102..1110

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

            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("AddKeySet_WithError", func(t *testing.T) {
                    softwareKeyManager.EXPECT().AddKeySet(gomock.Any(), gomock.Eq("set1"), gomock.Any()).Return(errors.New("test"))
                    err := keyManager.AddKeySet(context.TODO(), "set1", nil)
                    assert.Error(t, err, "test")
                })
            Severity: Major
            Found in jwk/manager_strategy_test.go and 3 other locations - About 50 mins to fix
            jwk/manager_strategy_test.go on lines 57..61
            jwk/manager_strategy_test.go on lines 81..85
            jwk/manager_strategy_test.go on lines 93..97

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

            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("UpdateKey_WithError", func(t *testing.T) {
                    softwareKeyManager.EXPECT().UpdateKey(gomock.Any(), gomock.Eq("set1"), gomock.Any()).Return(errors.New("test"))
                    err := keyManager.UpdateKey(context.TODO(), "set1", nil)
                    assert.Error(t, err, "test")
                })
            Severity: Major
            Found in jwk/manager_strategy_test.go and 3 other locations - About 50 mins to fix
            jwk/manager_strategy_test.go on lines 57..61
            jwk/manager_strategy_test.go on lines 69..73
            jwk/manager_strategy_test.go on lines 93..97

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

            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("AddKey_WithError", func(t *testing.T) {
                    softwareKeyManager.EXPECT().AddKey(gomock.Any(), gomock.Eq("set1"), gomock.Any()).Return(errors.New("test"))
                    err := keyManager.AddKey(context.TODO(), "set1", nil)
                    assert.Error(t, err, "test")
                })
            Severity: Major
            Found in jwk/manager_strategy_test.go and 3 other locations - About 50 mins to fix
            jwk/manager_strategy_test.go on lines 69..73
            jwk/manager_strategy_test.go on lines 81..85
            jwk/manager_strategy_test.go on lines 93..97

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

            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

                                if len(tc.challenges) == 0 {
                                    assert.EqualError(t, err, consent.ErrNoPreviousConsentFound.Error())
                                } else {
                                    require.NoError(t, err)
                                    for _, consent := range consents {
            Severity: Minor
            Found in consent/test/manager_test_helpers.go and 1 other location - About 50 mins to fix
            consent/test/manager_test_helpers.go on lines 848..856

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

            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

                                if len(tc.challenges) == 0 {
                                    assert.EqualError(t, err, consent.ErrNoPreviousConsentFound.Error())
                                } else {
                                    require.NoError(t, err)
                                    for _, consent := range consents {
            Severity: Minor
            Found in consent/test/manager_test_helpers.go and 1 other location - About 50 mins to fix
            consent/test/manager_test_helpers.go on lines 806..814

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

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

                      cy.visit(
                        `${Cypress.env("client_url")}/oauth2/code?client_id=${
                          c.client_id
                        }&client_secret=${c.client_secret}&scope=bar`,
                        { failOnStatusCode: false },
            Severity: Major
            Found in cypress/integration/oauth2/authorize_error.js and 4 other locations - About 50 mins to fix
            cypress/integration/oauth2/authorize_error.js on lines 124..129
            cypress/integration/oauth2/authorize_error.js on lines 141..146
            cypress/integration/oauth2/authorize_error.js on lines 164..169
            cypress/integration/openid/prompt.js on lines 22..27

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

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

                      cy.visit(
                        `${Cypress.env("client_url")}/oauth2/code?client_id=${
                          c.client_id
                        }&client_secret=${c.client_secret}&scope=`,
                        { failOnStatusCode: false },
            Severity: Major
            Found in cypress/integration/oauth2/authorize_error.js and 4 other locations - About 50 mins to fix
            cypress/integration/oauth2/authorize_error.js on lines 101..106
            cypress/integration/oauth2/authorize_error.js on lines 124..129
            cypress/integration/oauth2/authorize_error.js on lines 164..169
            cypress/integration/openid/prompt.js on lines 22..27

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

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

                      cy.visit(
                        `${Cypress.env("client_url")}/oauth2/code?client_id=${
                          c.client_id
                        }&client_secret=${c.client_secret}&scope=`,
                        { failOnStatusCode: false },
            Severity: Major
            Found in cypress/integration/oauth2/authorize_error.js and 4 other locations - About 50 mins to fix
            cypress/integration/oauth2/authorize_error.js on lines 101..106
            cypress/integration/oauth2/authorize_error.js on lines 124..129
            cypress/integration/oauth2/authorize_error.js on lines 141..146
            cypress/integration/openid/prompt.js on lines 22..27

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

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

                      cy.visit(
                        `${Cypress.env("client_url")}/openid/code?client_id=${
                          client.client_id
                        }&client_secret=${client.client_secret}&prompt=none`,
                        { failOnStatusCode: false },
            Severity: Major
            Found in cypress/integration/openid/prompt.js and 4 other locations - About 50 mins to fix
            cypress/integration/oauth2/authorize_error.js on lines 101..106
            cypress/integration/oauth2/authorize_error.js on lines 124..129
            cypress/integration/oauth2/authorize_error.js on lines 141..146
            cypress/integration/oauth2/authorize_error.js on lines 164..169

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

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

                      cy.visit(
                        `${Cypress.env("client_url")}/oauth2/code?client_id=${
                          c.client_id
                        }&client_secret=${c.client_secret}`,
                        { failOnStatusCode: false },
            Severity: Major
            Found in cypress/integration/oauth2/authorize_error.js and 4 other locations - About 50 mins to fix
            cypress/integration/oauth2/authorize_error.js on lines 101..106
            cypress/integration/oauth2/authorize_error.js on lines 141..146
            cypress/integration/oauth2/authorize_error.js on lines 164..169
            cypress/integration/openid/prompt.js on lines 22..27

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

            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

              client
                .authorizationCallback(`${redirect_uri}/openid/callback`, req.query, {
                  state: req.session.state,
                  nonce: req.session.nonce,
                  response_type: "code",
            Severity: Minor
            Found in test/e2e/oauth2-client/src/index.js and 1 other location - About 50 mins to fix
            test/e2e/oauth2-client/src/index.js on lines 211..221

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

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

            func (mr *MockOAuth2ProviderMockRecorder) WriteAuthorizeResponse(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
                mr.mock.ctrl.T.Helper()
                return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteAuthorizeResponse", reflect.TypeOf((*MockOAuth2Provider)(nil).WriteAuthorizeResponse), arg0, arg1, arg2, arg3)
            }
            Severity: Major
            Found in oauth2/oauth2_provider_mock_test.go and 5 other locations - About 45 mins to fix
            oauth2/oauth2_provider_mock_test.go on lines 190..193
            oauth2/oauth2_provider_mock_test.go on lines 202..205
            oauth2/oauth2_provider_mock_test.go on lines 214..217
            oauth2/oauth2_provider_mock_test.go on lines 262..265
            oauth2/oauth2_provider_mock_test.go on lines 274..277

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

            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