ory-am/hydra

View on GitHub

Showing 402 of 849 total issues

Method OAuth2ApiService.DeleteOAuth2ClientExecute has 54 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (a *OAuth2ApiService) DeleteOAuth2ClientExecute(r ApiDeleteOAuth2ClientRequest) (*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 NewCreateClientsCommand has 54 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func NewCreateClientsCommand() *cobra.Command {
        cmd := &cobra.Command{
            Use:     "oauth2-client",
            Short:   "Create an OAuth 2.0 Client",
            Aliases: []string{"client"},
    Severity: Minor
    Found in cmd/cmd_create_client.go - About 1 hr to fix

      Method MetadataApiService.GetVersionExecute has 54 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func (a *MetadataApiService) GetVersionExecute(r ApiGetVersionRequest) (*GetVersion200Response, *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 JwkApiService.DeleteJsonWebKeySetExecute has 54 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

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

          Function NewOidcConfiguration has 9 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          func NewOidcConfiguration(authorizationEndpoint string, idTokenSignedResponseAlg []string, idTokenSigningAlgValuesSupported []string, issuer string, jwksUri string, responseTypesSupported []string, subjectTypesSupported []string, tokenEndpoint string, userinfoSignedResponseAlg []string) *OidcConfiguration {
          Severity: Major
          Found in internal/httpclient/model_oidc_configuration.go - About 1 hr to fix

            Function initTestKeyPairs has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const initTestKeyPairs = async () => {
              const algorithm = {
                name: "RSASSA-PKCS1-v1_5",
                modulusLength: 2048,
                publicExponent: new Uint8Array([1, 0, 1]),
            Severity: Minor
            Found in cypress/integration/oauth2/grant_jwtbearer.js - About 1 hr to fix

              Method DefaultStrategy.verifyConsent has 11 return statements (exceeds 4 allowed).
              Open

              func (s *DefaultStrategy) verifyConsent(ctx context.Context, _ http.ResponseWriter, r *http.Request, verifier string) (_ *flow.AcceptOAuth2ConsentRequest, _ *flow.Flow, err error) {
                  ctx, span := trace.SpanFromContext(ctx).TracerProvider().Tracer("").Start(ctx, "DefaultStrategy.verifyConsent")
                  defer otelx.End(span, &err)
              
                  // We decode the flow here once again because VerifyAndInvalidateConsentRequest does not return the flow
              Severity: Major
              Found in consent/strategy_default.go - About 1 hr to fix

                Method OAuth2ApiService.CreateOAuth2ClientExecute has 11 return statements (exceeds 4 allowed).
                Open

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

                  Method OidcApiService.SetOidcDynamicClientExecute has 11 return statements (exceeds 4 allowed).
                  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 - About 1 hr to fix

                    Method OAuth2ApiService.GetOAuth2ConsentRequestExecute has 11 return statements (exceeds 4 allowed).
                    Open

                    func (a *OAuth2ApiService) GetOAuth2ConsentRequestExecute(r ApiGetOAuth2ConsentRequestRequest) (*OAuth2ConsentRequest, *http.Response, error) {
                        var (
                            localVarHTTPMethod  = http.MethodGet
                            localVarPostBody    interface{}
                            formFiles           []formFile
                    Severity: Major
                    Found in internal/httpclient/api_o_auth2.go - About 1 hr to fix

                      Method OAuth2ApiService.GetOAuth2LogoutRequestExecute has 11 return statements (exceeds 4 allowed).
                      Open

                      func (a *OAuth2ApiService) GetOAuth2LogoutRequestExecute(r ApiGetOAuth2LogoutRequestRequest) (*OAuth2LogoutRequest, *http.Response, error) {
                          var (
                              localVarHTTPMethod  = http.MethodGet
                              localVarPostBody    interface{}
                              formFiles           []formFile
                      Severity: Major
                      Found in internal/httpclient/api_o_auth2.go - About 1 hr to fix

                        Method OAuth2ApiService.GetOAuth2LoginRequestExecute has 11 return statements (exceeds 4 allowed).
                        Open

                        func (a *OAuth2ApiService) GetOAuth2LoginRequestExecute(r ApiGetOAuth2LoginRequestRequest) (*OAuth2LoginRequest, *http.Response, error) {
                            var (
                                localVarHTTPMethod  = http.MethodGet
                                localVarPostBody    interface{}
                                formFiles           []formFile
                        Severity: Major
                        Found in internal/httpclient/api_o_auth2.go - About 1 hr to fix

                          Method OidcApiService.CreateOidcDynamicClientExecute has 11 return statements (exceeds 4 allowed).
                          Open

                          func (a *OidcApiService) CreateOidcDynamicClientExecute(r ApiCreateOidcDynamicClientRequest) (*OAuth2Client, *http.Response, error) {
                              var (
                                  localVarHTTPMethod  = http.MethodPost
                                  localVarPostBody    interface{}
                                  formFiles           []formFile
                          Severity: Major
                          Found in internal/httpclient/api_oidc.go - About 1 hr to fix

                            Method OAuth2ApiService.PatchOAuth2ClientExecute has 11 return statements (exceeds 4 allowed).
                            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 - About 1 hr to fix

                              Function readMigrations has 11 return statements (exceeds 4 allowed).
                              Open

                              func readMigrations(migrationSourceFS fs.FS, expectedDialects []string) (map[string]*migrationGroup, error) {
                                  mgs := make(map[string]*migrationGroup)
                                  err := fs.WalkDir(migrationSourceFS, ".", func(p string, d fs.DirEntry, err2 error) error {
                                      if err2 != nil {
                                          fmt.Println("Warning: unexpected error " + err2.Error())
                              Severity: Major
                              Found in cmd/cli/handler_migrate.go - About 1 hr to fix

                                Method APIClient.prepareRequest has 11 return statements (exceeds 4 allowed).
                                Open

                                func (c *APIClient) prepareRequest(
                                    ctx context.Context,
                                    path string, method string,
                                    postBody interface{},
                                    headerParams map[string]string,
                                Severity: Major
                                Found in internal/httpclient/client.go - About 1 hr to fix

                                  Function NewPerformAuthorizationCodeCmd has 11 return statements (exceeds 4 allowed).
                                  Open

                                  func NewPerformAuthorizationCodeCmd() *cobra.Command {
                                      cmd := &cobra.Command{
                                          Use:     "authorization-code",
                                          Example: "{{ .CommandPath }} --client-id ... --client-secret ...",
                                          Short:   "An exemplary OAuth 2.0 Client performing the OAuth 2.0 Authorize Code Flow",
                                  Severity: Major
                                  Found in cmd/cmd_perform_authorization_code.go - About 1 hr to fix

                                    Method Handler.rejectOAuth2ConsentRequest has 52 lines of code (exceeds 50 allowed). Consider refactoring.
                                    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: Minor
                                    Found in consent/handler.go - About 1 hr to fix

                                      Function TestHelperNID has 52 lines of code (exceeds 50 allowed). Consider refactoring.
                                      Open

                                      func TestHelperNID(r interface {
                                          client.ManagerProvider
                                          FlowCipher() *aead.XChaCha20Poly1305
                                      }, t1ValidNID consent.Manager, t2InvalidNID consent.Manager) func(t *testing.T) {
                                          testClient := client.Client{ID: "2022-03-11-client-nid-test-1"}
                                      Severity: Minor
                                      Found in consent/test/manager_test_helpers.go - About 1 hr to fix

                                        Function TestGetLoginRequestWithDuplicateAccept has 52 lines of code (exceeds 50 allowed). Consider refactoring.
                                        Open

                                        func TestGetLoginRequestWithDuplicateAccept(t *testing.T) {
                                            t.Run("Test get login request with duplicate accept", func(t *testing.T) {
                                                ctx := context.Background()
                                                challenge := "challenge"
                                                requestURL := "http://192.0.2.1"
                                        Severity: Minor
                                        Found in consent/handler_test.go - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language