ory-am/hydra

View on GitHub

Showing 412 of 865 total issues

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

      Function TestLogoutFlows has a Cognitive Complexity of 24 (exceeds 20 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: Minor
      Found in consent/strategy_logout_test.go - About 55 mins 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

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

      func (a *OAuth2APIService) Oauth2TokenExchangeExecute(r ApiOauth2TokenExchangeRequest) (*OAuth2TokenExchange, *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.RejectOAuth2LoginRequestExecute has 9 return statements (exceeds 4 allowed).
        Open

        func (a *OAuth2APIService) RejectOAuth2LoginRequestExecute(r ApiRejectOAuth2LoginRequestRequest) (*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.ListOAuth2ConsentSessionsExecute has 9 return statements (exceeds 4 allowed).
            Open

            func (a *OAuth2APIService) ListOAuth2ConsentSessionsExecute(r ApiListOAuth2ConsentSessionsRequest) ([]OAuth2ConsentSession, *http.Response, error) {
                var (
                    localVarHTTPMethod  = http.MethodGet
                    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.AcceptOAuth2LoginRequestExecute has 9 return statements (exceeds 4 allowed).
                Open

                func (a *OAuth2APIService) AcceptOAuth2LoginRequestExecute(r ApiAcceptOAuth2LoginRequestRequest) (*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

                    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

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

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

                          func (a *OAuth2APIService) GetOAuth2ClientExecute(r ApiGetOAuth2ClientRequest) (*OAuth2Client, *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.OAuth2AuthorizeExecute has 8 return statements (exceeds 4 allowed).
                            Open

                            func (a *OAuth2APIService) OAuth2AuthorizeExecute(r ApiOAuth2AuthorizeRequest) (*ErrorOAuth2, *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.RejectOAuth2LogoutRequestExecute has 8 return statements (exceeds 4 allowed).
                              Open

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

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

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

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

                                    func (a *OidcAPIService) GetOidcDynamicClientExecute(r ApiGetOidcDynamicClientRequest) (*OAuth2Client, *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

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

                                      func (a *OAuth2APIService) ListOAuth2ClientsExecute(r ApiListOAuth2ClientsRequest) ([]OAuth2Client, *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
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language