ory-am/hydra

View on GitHub

Showing 853 of 853 total issues

Method OAuth2APIService.SetOAuth2ClientLifespansExecute has 64 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (a *OAuth2APIService) SetOAuth2ClientLifespansExecute(r ApiSetOAuth2ClientLifespansRequest) (*OAuth2Client, *http.Response, error) {
    var (
        localVarHTTPMethod  = http.MethodPut
        localVarPostBody    interface{}
        formFiles           []formFile
Severity: Minor
Found in internal/httpclient/api_o_auth2.go - About 1 hr to fix

    Method JwkAPIService.GetJsonWebKeyExecute has 64 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func (a *JwkAPIService) GetJsonWebKeyExecute(r ApiGetJsonWebKeyRequest) (*JsonWebKeySet, *http.Response, error) {
        var (
            localVarHTTPMethod  = http.MethodGet
            localVarPostBody    interface{}
            formFiles           []formFile
    Severity: Minor
    Found in internal/httpclient/api_jwk.go - About 1 hr to fix

      Method JwkAPIService.SetJsonWebKeySetExecute has 64 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

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

        Method MetadataAPIService.IsAliveExecute has 64 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

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

          Method MetadataAPIService.IsReadyExecute has 64 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func (a *MetadataAPIService) IsReadyExecute(r ApiIsReadyRequest) (*IsReady200Response, *http.Response, error) {
              var (
                  localVarHTTPMethod  = http.MethodGet
                  localVarPostBody    interface{}
                  formFiles           []formFile
          Severity: Minor
          Found in internal/httpclient/api_metadata.go - About 1 hr to fix

            Function checkTokenResponse has 64 lines of code (exceeds 50 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 1 hr to fix

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

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

                Method OAuth2APIService.GetOAuth2ClientExecute has 63 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                func (a *OAuth2APIService) GetOAuth2ClientExecute(r ApiGetOAuth2ClientRequest) (*OAuth2Client, *http.Response, error) {
                    var (
                        localVarHTTPMethod  = http.MethodGet
                        localVarPostBody    interface{}
                        formFiles           []formFile
                Severity: Minor
                Found in internal/httpclient/api_o_auth2.go - About 1 hr to fix

                  Method OAuth2APIService.GetTrustedOAuth2JwtGrantIssuerExecute has 63 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

                  func (a *OAuth2APIService) GetTrustedOAuth2JwtGrantIssuerExecute(r ApiGetTrustedOAuth2JwtGrantIssuerRequest) (*TrustedOAuth2JwtGrantIssuer, *http.Response, error) {
                      var (
                          localVarHTTPMethod  = http.MethodGet
                          localVarPostBody    interface{}
                          formFiles           []formFile
                  Severity: Minor
                  Found in internal/httpclient/api_o_auth2.go - About 1 hr to fix

                    Method OAuth2APIService.RevokeOAuth2TokenExecute has 63 lines of code (exceeds 50 allowed). Consider refactoring.
                    Open

                    func (a *OAuth2APIService) RevokeOAuth2TokenExecute(r ApiRevokeOAuth2TokenRequest) (*http.Response, error) {
                        var (
                            localVarHTTPMethod = http.MethodPost
                            localVarPostBody   interface{}
                            formFiles          []formFile
                    Severity: Minor
                    Found in internal/httpclient/api_o_auth2.go - About 1 hr to fix

                      Method OidcAPIService.GetOidcDynamicClientExecute has 63 lines of code (exceeds 50 allowed). Consider refactoring.
                      Open

                      func (a *OidcAPIService) GetOidcDynamicClientExecute(r ApiGetOidcDynamicClientRequest) (*OAuth2Client, *http.Response, error) {
                          var (
                              localVarHTTPMethod  = http.MethodGet
                              localVarPostBody    interface{}
                              formFiles           []formFile
                      Severity: Minor
                      Found in internal/httpclient/api_oidc.go - About 1 hr to fix

                        Method OAuth2APIService.TrustOAuth2JwtGrantIssuerExecute has 63 lines of code (exceeds 50 allowed). Consider refactoring.
                        Open

                        func (a *OAuth2APIService) TrustOAuth2JwtGrantIssuerExecute(r ApiTrustOAuth2JwtGrantIssuerRequest) (*TrustedOAuth2JwtGrantIssuer, *http.Response, error) {
                            var (
                                localVarHTTPMethod  = http.MethodPost
                                localVarPostBody    interface{}
                                formFiles           []formFile
                        Severity: Minor
                        Found in internal/httpclient/api_o_auth2.go - About 1 hr to fix

                          Method OAuth2APIService.RevokeOAuth2ConsentSessionsExecute has 63 lines of code (exceeds 50 allowed). Consider refactoring.
                          Open

                          func (a *OAuth2APIService) RevokeOAuth2ConsentSessionsExecute(r ApiRevokeOAuth2ConsentSessionsRequest) (*http.Response, error) {
                              var (
                                  localVarHTTPMethod = http.MethodDelete
                                  localVarPostBody   interface{}
                                  formFiles          []formFile
                          Severity: Minor
                          Found in internal/httpclient/api_o_auth2.go - About 1 hr to fix

                            Function TestJanitorHandler_PurgeLoginConsent has 63 lines of code (exceeds 50 allowed). Consider refactoring.
                            Open

                            func TestJanitorHandler_PurgeLoginConsent(t *testing.T) {
                                /*
                                    Login and Consent also needs to be purged on two conditions besides the KeyConsentRequestMaxAge and notAfter time
                                    - when a login/consent request was never completed (timed out)
                                    - when a login/consent request was rejected
                            Severity: Minor
                            Found in cmd/cli/handler_janitor_test.go - About 1 hr to fix

                              Method JwkAPIService.GetJsonWebKeySetExecute has 63 lines of code (exceeds 50 allowed). Consider refactoring.
                              Open

                              func (a *JwkAPIService) GetJsonWebKeySetExecute(r ApiGetJsonWebKeySetRequest) (*JsonWebKeySet, *http.Response, error) {
                                  var (
                                      localVarHTTPMethod  = http.MethodGet
                                      localVarPostBody    interface{}
                                      formFiles           []formFile
                              Severity: Minor
                              Found in internal/httpclient/api_jwk.go - About 1 hr to fix

                                Function TestJanitorHandler_Arguments has 63 lines of code (exceeds 50 allowed). Consider refactoring.
                                Open

                                func TestJanitorHandler_Arguments(t *testing.T) {
                                    cmdx.ExecNoErr(t, cmd.NewRootCmd(nil, nil, nil),
                                        "janitor",
                                        fmt.Sprintf("--%s", cli.OnlyRequests),
                                        "memory",
                                Severity: Minor
                                Found in cmd/cli/handler_janitor_test.go - About 1 hr to fix

                                  Function TestHandlerWellKnown has 63 lines of code (exceeds 50 allowed). Consider refactoring.
                                  Open

                                  func TestHandlerWellKnown(t *testing.T) {
                                      t.Parallel()
                                  
                                      conf := internal.NewConfigurationWithDefaults()
                                      reg := internal.NewRegistryMemory(t, conf, &contextx.Default{})
                                  Severity: Minor
                                  Found in jwk/handler_test.go - About 1 hr to fix

                                    Function TestClientCredentials has 16 return statements (exceeds 4 allowed).
                                    Open

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

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

                                      func (p *Persister) CreateOpenIDConnectSession(ctx context.Context, signature string, requester fosite.Requester) (err error) {
                                          ctx, span := p.r.Tracer(ctx).Tracer().Start(ctx, "persistence.sql.CreateOpenIDConnectSession")
                                          defer otelx.End(span, &err)
                                          events.Trace(ctx, events.IdentityTokenIssued, toEventOptions(requester)...)
                                          // The expiry of an OIDC session is equal to the expiry of the authorization code. If the code is invalid, so is this OIDC request.
                                      Severity: Major
                                      Found in persistence/sql/persister_oauth2.go and 1 other location - About 1 hr to fix
                                      persistence/sql/persister_oauth2.go on lines 422..427

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

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                              {
                                                  ID:                   fmt.Sprintf("%s_flush-consent-2", uniqueName),
                                                  RequestedScope:       []string{"foo", "bar"},
                                                  Subject:              fmt.Sprintf("%s_flush-consent-2", uniqueName),
                                                  OpenIDConnectContext: nil,
                                      Severity: Major
                                      Found in internal/testhelpers/janitor_test_helper.go and 1 other location - About 1 hr to fix
                                      internal/testhelpers/janitor_test_helper.go on lines 836..847

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

                                      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