Showing 412 of 865 total issues
Function NewImportClientCmd
has 8 return statements (exceeds 4 allowed). Open
Open
func NewImportClientCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "oauth2-client <file-1.json> [<file-2.json> ...]",
Aliases: []string{"client", "clients", "oauth2-clients"},
Short: "Import one or more OAuth 2.0 Clients from files or STDIN",
Function NewPerformAuthorizationCodeCmd
has 8 return statements (exceeds 4 allowed). Open
Open
func NewPerformAuthorizationCodeCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "authorization-code",
Example: "{{ .CommandPath }} --client-id ... --client-secret ...",
Short: "Example OAuth 2.0 Client performing the OAuth 2.0 Authorize Code Flow",
Method KeyManager.GenerateAndPersistKeySet
has 8 return statements (exceeds 4 allowed). Open
Open
func (m *KeyManager) GenerateAndPersistKeySet(ctx context.Context, set, kid, alg, use string) (_ *jose.JSONWebKeySet, err error) {
ctx, span := otel.GetTracerProvider().Tracer(tracingComponent).Start(ctx, "hsm.GenerateAndPersistKeySet",
trace.WithAttributes(
attribute.String("set", set),
attribute.String("kid", kid),
Function ManagerTests
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func ManagerTests(deps Deps, m consent.Manager, clientManager client.Manager, fositeManager x.FositeStorer, network string, parallel bool) func(t *testing.T) {
Method Handler.acceptOAuth2ConsentRequest
has 7 return statements (exceeds 4 allowed). Open
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"),
Method DefaultStrategy.executeBackChannelLogout
has 7 return statements (exceeds 4 allowed). Open
Open
func (s *DefaultStrategy) executeBackChannelLogout(r *http.Request, subject, sid string) error {
ctx := r.Context()
clients, err := s.r.ConsentManager().ListUserAuthenticatedClientsWithBackChannelLogout(ctx, subject, sid)
if err != nil {
return err
Method OidcAPIService.DeleteOidcDynamicClientExecute
has 7 return statements (exceeds 4 allowed). Open
Open
func (a *OidcAPIService) DeleteOidcDynamicClientExecute(r ApiDeleteOidcDynamicClientRequest) (*http.Response, error) {
var (
localVarHTTPMethod = http.MethodDelete
localVarPostBody interface{}
formFiles []formFile
Method OAuth2APIService.DeleteOAuth2ClientExecute
has 7 return statements (exceeds 4 allowed). Open
Open
func (a *OAuth2APIService) DeleteOAuth2ClientExecute(r ApiDeleteOAuth2ClientRequest) (*http.Response, error) {
var (
localVarHTTPMethod = http.MethodDelete
localVarPostBody interface{}
formFiles []formFile
Method DefaultStrategy.forwardConsentRequest
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
ctx context.Context,
w http.ResponseWriter,
r *http.Request,
ar fosite.AuthorizeRequester,
f *flow.Flow,
Method DefaultStrategy.forwardConsentRequest
has 7 return statements (exceeds 4 allowed). Open
Open
func (s *DefaultStrategy) forwardConsentRequest(
ctx context.Context,
w http.ResponseWriter,
r *http.Request,
ar fosite.AuthorizeRequester,
Method Handler.rejectOAuth2LoginRequest
has 7 return statements (exceeds 4 allowed). Open
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"),
Method Handler.rejectOAuth2ConsentRequest
has 7 return statements (exceeds 4 allowed). Open
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"),
Method OAuth2APIService.RevokeOAuth2LoginSessionsExecute
has 7 return statements (exceeds 4 allowed). Open
Open
func (a *OAuth2APIService) RevokeOAuth2LoginSessionsExecute(r ApiRevokeOAuth2LoginSessionsRequest) (*http.Response, error) {
var (
localVarHTTPMethod = http.MethodDelete
localVarPostBody interface{}
formFiles []formFile
Method OAuth2APIService.DeleteTrustedOAuth2JwtGrantIssuerExecute
has 7 return statements (exceeds 4 allowed). Open
Open
func (a *OAuth2APIService) DeleteTrustedOAuth2JwtGrantIssuerExecute(r ApiDeleteTrustedOAuth2JwtGrantIssuerRequest) (*http.Response, error) {
var (
localVarHTTPMethod = http.MethodDelete
localVarPostBody interface{}
formFiles []formFile
Function New
has 7 return statements (exceeds 4 allowed). Open
Open
func New(ctx context.Context, sl *servicelocatorx.Options, opts []OptionsModifier) (Registry, error) {
o := NewOptions(opts)
l := sl.Logger()
if l == nil {
Method Persister.migrateOldMigrationTables
has 7 return statements (exceeds 4 allowed). Open
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
}
Avoid deeply nested control flow statements. Open
Open
} else if s, ok := body.(*string); ok {
_, err = bodyBuf.WriteString(*s)
} else if JsonCheck.MatchString(contentType) {
err = json.NewEncoder(bodyBuf).Encode(body)
} else if XmlCheck.MatchString(contentType) {
Function NewRegistryFromDSN
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func NewRegistryFromDSN(ctx context.Context, c *config.DefaultProvider, l *logrusx.Logger, skipNetworkInit bool, migrate bool, ctxer contextx.Contextualizer) (Registry, error) {
Method JwkAPIService.DeleteJsonWebKeySetExecute
has 7 return statements (exceeds 4 allowed). Open
Open
func (a *JwkAPIService) DeleteJsonWebKeySetExecute(r ApiDeleteJsonWebKeySetRequest) (*http.Response, error) {
var (
localVarHTTPMethod = http.MethodDelete
localVarPostBody interface{}
formFiles []formFile
Avoid deeply nested control flow statements. Open
Open
} else if tt == fosite.IDToken && c.ImplicitGrantIDTokenLifespan.Valid {
cl = &c.ImplicitGrantIDTokenLifespan.Duration
}