ory-am/hydra

View on GitHub

Showing 402 of 849 total issues

Method OAuth2ApiService.DeleteOAuth2ClientExecute has 7 return statements (exceeds 4 allowed).
Open

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

    Method Handler.rejectOAuth2ConsentRequest has 7 return statements (exceeds 4 allowed).
    Open

    func (h *Handler) rejectOAuth2ConsentRequest(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
        ctx := r.Context()
    
        challenge := stringsx.Coalesce(
            r.URL.Query().Get("consent_challenge"),
    Severity: Major
    Found in consent/handler.go - About 45 mins to fix

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

      func ManagerTests(deps Deps, m consent.Manager, clientManager client.Manager, fositeManager x.FositeStorer, network string, parallel bool) func(t *testing.T) {
      Severity: Minor
      Found in consent/test/manager_test_helpers.go - About 45 mins to fix

        Method OAuth2ApiService.DeleteTrustedOAuth2JwtGrantIssuerExecute has 7 return statements (exceeds 4 allowed).
        Open

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

          Method OAuth2ApiService.RevokeOAuth2LoginSessionsExecute has 7 return statements (exceeds 4 allowed).
          Open

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

            Method DefaultStrategy.forwardConsentRequest has 7 return statements (exceeds 4 allowed).
            Open

            func (s *DefaultStrategy) forwardConsentRequest(
                ctx context.Context,
                w http.ResponseWriter,
                r *http.Request,
                ar fosite.AuthorizeRequester,
            Severity: Major
            Found in consent/strategy_default.go - About 45 mins to fix

              Method OidcApiService.DeleteOidcDynamicClientExecute has 7 return statements (exceeds 4 allowed).
              Open

              func (a *OidcApiService) DeleteOidcDynamicClientExecute(r ApiDeleteOidcDynamicClientRequest) (*http.Response, error) {
                  var (
                      localVarHTTPMethod = http.MethodDelete
                      localVarPostBody   interface{}
                      formFiles          []formFile
              Severity: Major
              Found in internal/httpclient/api_oidc.go - About 45 mins to fix

                Method Handler.rejectOAuth2LoginRequest has 7 return statements (exceeds 4 allowed).
                Open

                func (h *Handler) rejectOAuth2LoginRequest(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
                    ctx := r.Context()
                
                    challenge := stringsx.Coalesce(
                        r.URL.Query().Get("login_challenge"),
                Severity: Major
                Found in consent/handler.go - About 45 mins to fix

                  Method Handler.acceptOAuth2ConsentRequest has 7 return statements (exceeds 4 allowed).
                  Open

                  func (h *Handler) acceptOAuth2ConsentRequest(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
                      ctx := r.Context()
                  
                      challenge := stringsx.Coalesce(
                          r.URL.Query().Get("consent_challenge"),
                  Severity: Major
                  Found in consent/handler.go - About 45 mins to fix

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

                    func TestHandler(t *testing.T) {
                        ctx := context.Background()
                        reg := internal.NewMockedRegistry(t, &contextx.Default{})
                        h := client.NewHandler(reg)
                        reg.WithContextualizer(&contextx.TestContextualizer{})
                    Severity: Major
                    Found in client/handler_test.go - About 45 mins to fix

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

                      func NewRegistryFromDSN(ctx context.Context, c *config.DefaultProvider, l *logrusx.Logger, skipNetworkInit bool, migrate bool, ctxer contextx.Contextualizer) (Registry, error) {
                      Severity: Minor
                      Found in driver/registry.go - About 45 mins to fix

                        Method Handler.CreateClient has 7 return statements (exceeds 4 allowed).
                        Open

                        func (h *Handler) CreateClient(r *http.Request, validator func(context.Context, *Client) error, isDynamic bool) (*Client, error) {
                            var c Client
                            if err := json.NewDecoder(r.Body).Decode(&c); err != nil {
                                return nil, errorsx.WithStack(herodot.ErrBadRequest.WithReasonf("Unable to decode the request body: %s", err))
                            }
                        Severity: Major
                        Found in client/handler.go - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                              } else if gt == fosite.GrantTypePassword {
                                  if tt == fosite.AccessToken && c.PasswordGrantAccessTokenLifespan.Valid {
                                      cl = &c.PasswordGrantAccessTokenLifespan.Duration
                                  } else if tt == fosite.RefreshToken && c.PasswordGrantRefreshTokenLifespan.Valid {
                                      cl = &c.PasswordGrantRefreshTokenLifespan.Duration
                          Severity: Major
                          Found in client/client.go - About 45 mins to fix

                            Method RegistrySQL.Init has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                ctx context.Context,
                                skipNetworkInit bool,
                                migrate bool,
                                ctxer contextx.Contextualizer,
                                extraMigrations []fs.FS,
                            Severity: Minor
                            Found in driver/registry_sql.go - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                      } else if tt == fosite.IDToken && c.ImplicitGrantIDTokenLifespan.Valid {
                                          cl = &c.ImplicitGrantIDTokenLifespan.Duration
                                      }
                              Severity: Major
                              Found in client/client.go - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                        if tt == fosite.AccessToken && c.JwtBearerGrantAccessTokenLifespan.Valid {
                                            cl = &c.JwtBearerGrantAccessTokenLifespan.Duration
                                        }
                                Severity: Major
                                Found in client/client.go - About 45 mins to fix

                                  Method Persister.migrateOldMigrationTables has 7 return statements (exceeds 4 allowed).
                                  Open

                                  func (p *Persister) migrateOldMigrationTables() error {
                                      if err := p.conn.RawQuery(fmt.Sprintf("SELECT * FROM %s", clientMigrationTableName)).Exec(); err != nil {
                                          // assume there are no old migration tables => done
                                          return nil
                                      }
                                  Severity: Major
                                  Found in persistence/sql/persister_migration.go - About 45 mins to fix

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

                                    func NewPersister(ctx context.Context, c *pop.Connection, r Dependencies, config *config.DefaultProvider, extraMigrations []fs.FS, goMigrations []popx.Migration) (*Persister, error) {
                                    Severity: Minor
                                    Found in persistence/sql/persister.go - About 45 mins to fix

                                      Method Persister.ConfirmLoginSession has 7 return statements (exceeds 4 allowed).
                                      Open

                                      func (p *Persister) ConfirmLoginSession(ctx context.Context, loginSession *flow.LoginSession) error {
                                          ctx, span := p.r.Tracer(ctx).Tracer().Start(ctx, "persistence.sql.ConfirmLoginSession")
                                          defer span.End()
                                      
                                          loginSession.NID = p.NetworkID(ctx)
                                      Severity: Major
                                      Found in persistence/sql/persister_consent.go - About 45 mins to fix

                                        Method JwkApiService.DeleteJsonWebKeyExecute has 7 return statements (exceeds 4 allowed).
                                        Open

                                        func (a *JwkApiService) DeleteJsonWebKeyExecute(r ApiDeleteJsonWebKeyRequest) (*http.Response, error) {
                                            var (
                                                localVarHTTPMethod = http.MethodDelete
                                                localVarPostBody   interface{}
                                                formFiles          []formFile
                                        Severity: Major
                                        Found in internal/httpclient/api_jwk.go - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language