ory-am/hydra

View on GitHub

Showing 850 of 850 total issues

OidcConfiguration has 118 methods (exceeds 20 allowed). Consider refactoring.
Open

type OidcConfiguration struct {
    // OAuth 2.0 Authorization Endpoint URL
    AuthorizationEndpoint string `json:"authorization_endpoint"`
    // OpenID Connect Back-Channel Logout Session Required  Boolean value specifying whether the OP can pass a sid (session ID) Claim in the Logout Token to identify the RP session with the OP. If supported, the sid Claim is also included in ID Tokens issued by the OP
    BackchannelLogoutSessionSupported *bool `json:"backchannel_logout_session_supported,omitempty"`
Severity: Major
Found in internal/httpclient/model_oidc_configuration.go - About 2 days to fix

    Function TestLogoutFlows has 473 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func TestLogoutFlows(t *testing.T) {
        ctx := context.Background()
        fakeKratos := kratos.NewFake()
        reg := internal.NewMockedRegistry(t, &contextx.Default{})
        reg.Config().MustSet(ctx, config.KeyAccessTokenStrategy, "opaque")
    Severity: Major
    Found in consent/strategy_logout_test.go - About 2 days to fix

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

      /*
      Ory Hydra API
      
      Documentation for all of Ory Hydra's APIs.
      
      
      internal/httpclient/model_pagination_headers.go on lines 1..163
      internal/httpclient/model_token_pagination_headers.go on lines 1..163
      internal/httpclient/model_token_pagination_response_headers.go on lines 1..163

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

      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

      /*
      Ory Hydra API
      
      Documentation for all of Ory Hydra's APIs.
      
      
      internal/httpclient/model_pagination_headers.go on lines 1..163
      internal/httpclient/model_token_pagination_headers.go on lines 1..163
      internal/httpclient/model_trusted_o_auth2_jwt_grant_json_web_key.go on lines 1..163

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

      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

      /*
      Ory Hydra API
      
      Documentation for all of Ory Hydra's APIs.
      
      
      Severity: Major
      Found in internal/httpclient/model_pagination_headers.go and 3 other locations - About 2 days to fix
      internal/httpclient/model_token_pagination_headers.go on lines 1..163
      internal/httpclient/model_token_pagination_response_headers.go on lines 1..163
      internal/httpclient/model_trusted_o_auth2_jwt_grant_json_web_key.go on lines 1..163

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

      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

      /*
      Ory Hydra API
      
      Documentation for all of Ory Hydra's APIs.
      
      
      Severity: Major
      Found in internal/httpclient/model_token_pagination_headers.go and 3 other locations - About 2 days to fix
      internal/httpclient/model_pagination_headers.go on lines 1..163
      internal/httpclient/model_token_pagination_response_headers.go on lines 1..163
      internal/httpclient/model_trusted_o_auth2_jwt_grant_json_web_key.go on lines 1..163

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

      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

      /*
      Ory Hydra API
      
      Documentation for all of Ory Hydra's APIs.
      
      
      Severity: Major
      Found in internal/httpclient/model_verifiable_credential_proof.go and 1 other location - About 2 days to fix
      internal/httpclient/model_verifiable_credential_response.go on lines 1..161

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

      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

      /*
      Ory Hydra API
      
      Documentation for all of Ory Hydra's APIs.
      
      
      Severity: Major
      Found in internal/httpclient/model_verifiable_credential_response.go and 1 other location - About 2 days to fix
      internal/httpclient/model_verifiable_credential_proof.go on lines 1..161

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

      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 TestJWTBearer has 432 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func TestJWTBearer(t *testing.T) {
          ctx := context.Background()
          reg := internal.NewMockedRegistry(t, &contextx.Default{})
          reg.Config().MustSet(ctx, config.KeyAccessTokenStrategy, "opaque")
          _, admin := testhelpers.NewOAuth2Server(ctx, t, reg)
      Severity: Major
      Found in oauth2/oauth2_jwt_bearer_test.go - About 2 days to fix

        Function TestAuthCodeWithMockStrategy has a Cognitive Complexity of 106 (exceeds 20 allowed). Consider refactoring.
        Open

        func TestAuthCodeWithMockStrategy(t *testing.T) {
            ctx := context.Background()
            for _, strat := range []struct{ d string }{{d: "opaque"}, {d: "jwt"}} {
                t.Run("strategy="+strat.d, func(t *testing.T) {
                    conf := internal.NewConfigurationWithDefaults()
        Severity: Minor
        Found in oauth2/oauth2_auth_code_test.go - About 1 day 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

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

              it("should introspect refresh token", function () {
                const client = nc()
                cy.authCodeFlow(client, {
                  consent: {
                    scope: ["offline_access"],
        Severity: Major
        Found in cypress/integration/oauth2/introspect.js and 1 other location - About 1 day to fix
        cypress/integration/oauth2/introspect.js on lines 19..44

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

        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

              it("should introspect access token", function () {
                const client = nc()
                cy.authCodeFlow(client, {
                  consent: {
                    scope: ["offline_access"],
        Severity: Major
        Found in cypress/integration/oauth2/introspect.js and 1 other location - About 1 day to fix
        cypress/integration/oauth2/introspect.js on lines 46..71

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 320.

        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

        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

          File manager_test_helpers.go has 998 lines of code (exceeds 500 allowed). Consider refactoring.
          Open

          // Copyright © 2022 Ory Corp
          // SPDX-License-Identifier: Apache-2.0
          
          package test
          
          
          Severity: Major
          Found in consent/test/manager_test_helpers.go - About 1 day to fix

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

            /*
            Ory Hydra API
            
            Documentation for all of Ory Hydra's APIs.
            
            
            Severity: Major
            Found in internal/httpclient/model_is_ready_503_response.go and 1 other location - About 1 day to fix
            internal/httpclient/model_health_not_ready_status.go on lines 1..126

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 850.

            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

            /*
            Ory Hydra API
            
            Documentation for all of Ory Hydra's APIs.
            
            
            Severity: Major
            Found in internal/httpclient/model_health_not_ready_status.go and 1 other location - About 1 day to fix
            internal/httpclient/model_is_ready_503_response.go on lines 1..126

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 850.

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

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

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

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

            Refactorings

            Further Reading

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

            func (a *OidcApiService) SetOidcDynamicClientExecute(r ApiSetOidcDynamicClientRequest) (*OAuth2Client, *http.Response, error) {
                var (
                    localVarHTTPMethod  = http.MethodPut
                    localVarPostBody    interface{}
                    formFiles           []formFile
            Severity: Major
            Found in internal/httpclient/api_oidc.go and 1 other location - About 1 day to fix
            internal/httpclient/api_o_auth2.go on lines 2397..2493

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

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

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

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

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

            Refactorings

            Further Reading

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

            func (a *OAuth2ApiService) PatchOAuth2ClientExecute(r ApiPatchOAuth2ClientRequest) (*OAuth2Client, *http.Response, error) {
                var (
                    localVarHTTPMethod  = http.MethodPatch
                    localVarPostBody    interface{}
                    formFiles           []formFile
            Severity: Major
            Found in internal/httpclient/api_o_auth2.go and 1 other location - About 1 day to fix
            internal/httpclient/api_oidc.go on lines 895..991

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

            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

            PersisterTestSuite has 84 methods (exceeds 20 allowed). Consider refactoring.
            Open

            type PersisterTestSuite struct {
                suite.Suite
                registries map[string]driver.Registry
                t1         context.Context
                t2         context.Context
            Severity: Major
            Found in persistence/sql/persister_nid_test.go - About 1 day to fix

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

              /*
              Ory Hydra API
              
              Documentation for all of Ory Hydra's APIs.
              
              
              Severity: Major
              Found in internal/httpclient/model_get_version_200_response.go and 3 other locations - About 1 day to fix
              internal/httpclient/model_health_status.go on lines 1..126
              internal/httpclient/model_is_ready_200_response.go on lines 1..126
              internal/httpclient/model_version.go on lines 1..126

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 830.

              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