ory-am/hydra

View on GitHub
oauth2/token_hook.go

Summary

Maintainability
A
2 hrs
Test Coverage

Function executeHookAndUpdateSession has 57 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func executeHookAndUpdateSession(ctx context.Context, reg x.HTTPClientProvider, hookConfig *config.HookConfig, reqBodyBytes []byte, session *Session) error {
    req, err := retryablehttp.NewRequestWithContext(ctx, http.MethodPost, hookConfig.URL, bytes.NewReader(reqBodyBytes))
    if err != nil {
        return errorsx.WithStack(
            fosite.ErrServerError.
Severity: Minor
Found in oauth2/token_hook.go - About 1 hr to fix

    Function executeHookAndUpdateSession has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    func executeHookAndUpdateSession(ctx context.Context, reg x.HTTPClientProvider, hookConfig *config.HookConfig, reqBodyBytes []byte, session *Session) error {
    Severity: Minor
    Found in oauth2/token_hook.go - About 35 mins to fix

      Function executeHookAndUpdateSession has 5 return statements (exceeds 4 allowed).
      Open

      func executeHookAndUpdateSession(ctx context.Context, reg x.HTTPClientProvider, hookConfig *config.HookConfig, reqBodyBytes []byte, session *Session) error {
          req, err := retryablehttp.NewRequestWithContext(ctx, http.MethodPost, hookConfig.URL, bytes.NewReader(reqBodyBytes))
          if err != nil {
              return errorsx.WithStack(
                  fosite.ErrServerError.
      Severity: Major
      Found in oauth2/token_hook.go - About 35 mins to fix

        There are no issues that match your filters.

        Category
        Status