ory-am/hydra

View on GitHub

Showing 853 of 853 total issues

Method OAuth2APIService.AcceptOAuth2LogoutRequestExecute has 9 return statements (exceeds 4 allowed).
Open

func (a *OAuth2APIService) AcceptOAuth2LogoutRequestExecute(r ApiAcceptOAuth2LogoutRequestRequest) (*OAuth2RedirectTo, *http.Response, error) {
    var (
        localVarHTTPMethod  = http.MethodPut
        localVarPostBody    interface{}
        formFiles           []formFile
Severity: Major
Found in internal/httpclient/api_o_auth2.go - About 55 mins to fix

    Method OAuth2APIService.IntrospectOAuth2TokenExecute has 9 return statements (exceeds 4 allowed).
    Open

    func (a *OAuth2APIService) IntrospectOAuth2TokenExecute(r ApiIntrospectOAuth2TokenRequest) (*IntrospectedOAuth2Token, *http.Response, error) {
        var (
            localVarHTTPMethod  = http.MethodPost
            localVarPostBody    interface{}
            formFiles           []formFile
    Severity: Major
    Found in internal/httpclient/api_o_auth2.go - About 55 mins to fix

      Method OAuth2APIService.RejectOAuth2ConsentRequestExecute has 9 return statements (exceeds 4 allowed).
      Open

      func (a *OAuth2APIService) RejectOAuth2ConsentRequestExecute(r ApiRejectOAuth2ConsentRequestRequest) (*OAuth2RedirectTo, *http.Response, error) {
          var (
              localVarHTTPMethod  = http.MethodPut
              localVarPostBody    interface{}
              formFiles           []formFile
      Severity: Major
      Found in internal/httpclient/api_o_auth2.go - About 55 mins to fix

        Method OAuth2APIService.AcceptOAuth2ConsentRequestExecute has 9 return statements (exceeds 4 allowed).
        Open

        func (a *OAuth2APIService) AcceptOAuth2ConsentRequestExecute(r ApiAcceptOAuth2ConsentRequestRequest) (*OAuth2RedirectTo, *http.Response, error) {
            var (
                localVarHTTPMethod  = http.MethodPut
                localVarPostBody    interface{}
                formFiles           []formFile
        Severity: Major
        Found in internal/httpclient/api_o_auth2.go - About 55 mins to fix

          Method JwkAPIService.CreateJsonWebKeySetExecute has 9 return statements (exceeds 4 allowed).
          Open

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

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

            // Copyright © 2022 Ory Corp
            // SPDX-License-Identifier: Apache-2.0
            
            package cmd
            
            
            Severity: Major
            Found in cmd/serve_all.go and 2 other locations - About 55 mins to fix
            cmd/serve_admin.go on lines 1..35
            cmd/serve_public.go on lines 1..36

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

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

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

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

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

            Refactorings

            Further Reading

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

            // Copyright © 2022 Ory Corp
            // SPDX-License-Identifier: Apache-2.0
            
            package cmd
            
            
            Severity: Major
            Found in cmd/serve_admin.go and 2 other locations - About 55 mins to fix
            cmd/serve_all.go on lines 1..36
            cmd/serve_public.go on lines 1..36

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

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

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

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

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

            Refactorings

            Further Reading

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

            // Copyright © 2022 Ory Corp
            // SPDX-License-Identifier: Apache-2.0
            
            package cmd
            
            
            Severity: Major
            Found in cmd/serve_public.go and 2 other locations - About 55 mins to fix
            cmd/serve_admin.go on lines 1..35
            cmd/serve_all.go on lines 1..36

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

            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

                    {
                        name: "FindKeyPairs Error",
                        args: args{
                            ctx: context.TODO(),
                            set: x.OpenIDConnectKeyName,
            Severity: Minor
            Found in hsm/manager_hsm_test.go and 1 other location - About 55 mins to fix
            hsm/manager_hsm_test.go on lines 808..818

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

            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

                    {
                        name: "FindKeyPairs Error",
                        args: args{
                            ctx: context.TODO(),
                            set: x.OpenIDConnectKeyName,
            Severity: Minor
            Found in hsm/manager_hsm_test.go and 1 other location - About 55 mins to fix
            hsm/manager_hsm_test.go on lines 623..633

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

            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 DefaultStrategy.forwardAuthenticationRequest has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            func (s *DefaultStrategy) forwardAuthenticationRequest(ctx context.Context, w http.ResponseWriter, r *http.Request, ar fosite.AuthorizeRequester, subject string, authenticatedAt time.Time, session *flow.LoginSession) error {
            Severity: Major
            Found in consent/strategy_default.go - About 50 mins to fix

              Function createCsrfSession has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              func createCsrfSession(w http.ResponseWriter, r *http.Request, conf x.CookieConfigProvider, store sessions.Store, name string, csrfValue string, maxAge time.Duration) error {
              Severity: Major
              Found in consent/csrf.go - About 50 mins to fix

                Function EnhanceMiddleware has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                func EnhanceMiddleware(ctx context.Context, sl *servicelocatorx.Options, d driver.Registry, n *negroni.Negroni, address string, router *httprouter.Router, iface config.ServeInterface) http.Handler {
                Severity: Major
                Found in cmd/server/handler.go - About 50 mins to fix

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

                  func (p *Persister) GetRefreshTokenSession(ctx context.Context, signature string, session fosite.Session) (request fosite.Requester, err error) {
                      ctx, span := p.r.Tracer(ctx).Tracer().Start(ctx, "persistence.sql.GetRefreshTokenSession")
                      defer otelx.End(span, &err)
                      return p.findSessionBySignature(ctx, signature, session, sqlTableRefresh)
                  }
                  Severity: Major
                  Found in persistence/sql/persister_oauth2.go and 2 other locations - About 50 mins to fix
                  persistence/sql/persister_oauth2.go on lines 319..324
                  persistence/sql/persister_oauth2.go on lines 461..465

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                  func (p *Persister) GetAuthorizeCodeSession(ctx context.Context, signature string, session fosite.Session) (request fosite.Requester, err error) {
                      ctx, span := p.r.Tracer(ctx).Tracer().Start(ctx, "persistence.sql.GetAuthorizeCodeSession")
                      defer otelx.End(span, &err)
                  
                      return p.findSessionBySignature(ctx, signature, session, sqlTableCode)
                  Severity: Major
                  Found in persistence/sql/persister_oauth2.go and 2 other locations - About 50 mins to fix
                  persistence/sql/persister_oauth2.go on lines 429..433
                  persistence/sql/persister_oauth2.go on lines 461..465

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                  func (p *Persister) GetPKCERequestSession(ctx context.Context, signature string, session fosite.Session) (_ fosite.Requester, err error) {
                      ctx, span := p.r.Tracer(ctx).Tracer().Start(ctx, "persistence.sql.GetPKCERequestSession")
                      defer otelx.End(span, &err)
                      return p.findSessionBySignature(ctx, signature, session, sqlTablePKCE)
                  }
                  Severity: Major
                  Found in persistence/sql/persister_oauth2.go and 2 other locations - About 50 mins to fix
                  persistence/sql/persister_oauth2.go on lines 319..324
                  persistence/sql/persister_oauth2.go on lines 429..433

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

                  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 DefaultStrategy.forwardAuthenticationRequest has 8 return statements (exceeds 4 allowed).
                  Open

                  func (s *DefaultStrategy) forwardAuthenticationRequest(ctx context.Context, w http.ResponseWriter, r *http.Request, ar fosite.AuthorizeRequester, subject string, authenticatedAt time.Time, session *flow.LoginSession) error {
                      if (subject != "" && authenticatedAt.IsZero()) || (subject == "" && !authenticatedAt.IsZero()) {
                          return errorsx.WithStack(fosite.ErrServerError.WithHint("Consent strategy returned a non-empty subject with an empty auth date, or an empty subject with a non-empty auth date."))
                      }
                  
                  
                  Severity: Major
                  Found in consent/strategy_default.go - About 50 mins to fix

                    Method OAuth2APIService.ListTrustedOAuth2JwtGrantIssuersExecute has 8 return statements (exceeds 4 allowed).
                    Open

                    func (a *OAuth2APIService) ListTrustedOAuth2JwtGrantIssuersExecute(r ApiListTrustedOAuth2JwtGrantIssuersRequest) ([]TrustedOAuth2JwtGrantIssuer, *http.Response, error) {
                        var (
                            localVarHTTPMethod  = http.MethodGet
                            localVarPostBody    interface{}
                            formFiles           []formFile
                    Severity: Major
                    Found in internal/httpclient/api_o_auth2.go - About 50 mins to fix

                      Method OAuth2APIService.RevokeOAuth2ConsentSessionsExecute has 8 return statements (exceeds 4 allowed).
                      Open

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

                        Method OidcAPIService.GetOidcUserInfoExecute has 8 return statements (exceeds 4 allowed).
                        Open

                        func (a *OidcAPIService) GetOidcUserInfoExecute(r ApiGetOidcUserInfoRequest) (*OidcUserInfo, *http.Response, error) {
                            var (
                                localVarHTTPMethod  = http.MethodGet
                                localVarPostBody    interface{}
                                formFiles           []formFile
                        Severity: Major
                        Found in internal/httpclient/api_oidc.go - About 50 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language