Showing 402 of 849 total issues
Method OAuth2ApiService.GetTrustedOAuth2JwtGrantIssuerExecute
has 63 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *OAuth2ApiService) GetTrustedOAuth2JwtGrantIssuerExecute(r ApiGetTrustedOAuth2JwtGrantIssuerRequest) (*TrustedOAuth2JwtGrantIssuer, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
Method OidcApiService.GetOidcDynamicClientExecute
has 63 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *OidcApiService) GetOidcDynamicClientExecute(r ApiGetOidcDynamicClientRequest) (*OAuth2Client, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
Method OAuth2ApiService.RevokeOAuth2ConsentSessionsExecute
has 63 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *OAuth2ApiService) RevokeOAuth2ConsentSessionsExecute(r ApiRevokeOAuth2ConsentSessionsRequest) (*http.Response, error) {
var (
localVarHTTPMethod = http.MethodDelete
localVarPostBody interface{}
formFiles []formFile
Function TestJanitorHandler_PurgeLoginConsent
has 63 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func TestJanitorHandler_PurgeLoginConsent(t *testing.T) {
/*
Login and Consent also needs to be purged on two conditions besides the KeyConsentRequestMaxAge and notAfter time
- when a login/consent request was never completed (timed out)
- when a login/consent request was rejected
Function TestJanitorHandler_Arguments
has 63 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func TestJanitorHandler_Arguments(t *testing.T) {
cmdx.ExecNoErr(t, cmd.NewRootCmd(nil, nil, nil),
"janitor",
fmt.Sprintf("--%s", cli.OnlyRequests),
"memory",
Method JwkApiService.GetJsonWebKeySetExecute
has 63 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *JwkApiService) GetJsonWebKeySetExecute(r ApiGetJsonWebKeySetRequest) (*JsonWebKeySet, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
Function TestHandlerWellKnown
has 63 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func TestHandlerWellKnown(t *testing.T) {
t.Parallel()
conf := internal.NewConfigurationWithDefaults()
reg := internal.NewRegistryMemory(t, conf, &contextx.Default{})
Function TestClientCredentials
has 16 return statements (exceeds 4 allowed). Open
Open
func TestClientCredentials(t *testing.T) {
ctx := context.Background()
reg := internal.NewMockedRegistry(t, &contextx.Default{})
reg.Config().MustSet(ctx, config.KeyAccessTokenStrategy, "opaque")
public, admin := testhelpers.NewOAuth2Server(ctx, t, reg)
Method DefaultStrategy.executeBackChannelLogout
has 62 lines of code (exceeds 50 allowed). Consider refactoring. 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.DiscoverOidcConfigurationExecute
has 62 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *OidcApiService) DiscoverOidcConfigurationExecute(r ApiDiscoverOidcConfigurationRequest) (*OidcConfiguration, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
Method OAuth2ApiService.OAuth2AuthorizeExecute
has 62 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *OAuth2ApiService) OAuth2AuthorizeExecute(r ApiOAuth2AuthorizeRequest) (*ErrorOAuth2, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
Method OidcApiService.GetOidcUserInfoExecute
has 62 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *OidcApiService) GetOidcUserInfoExecute(r ApiGetOidcUserInfoRequest) (*OidcUserInfo, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
Method WellknownApiService.DiscoverJsonWebKeysExecute
has 62 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *WellknownApiService) DiscoverJsonWebKeysExecute(r ApiDiscoverJsonWebKeysRequest) (*JsonWebKeySet, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
Function readMigrations
has 61 lines of code (exceeds 50 allowed). Consider refactoring. Open
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())
Function TestHandlerFindPublicKey
has 61 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func TestHandlerFindPublicKey(t *testing.T) {
t.Parallel()
t.Run("Test_Helper/Run_FindPublicKey_With_RSA", func(t *testing.T) {
t.Parallel()
Method APIClient.decode
has 15 return statements (exceeds 4 allowed). Open
Open
func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) {
if len(b) == 0 {
return nil
}
if s, ok := v.(*string); ok {
Method APIClient.decode
has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring. Open
Open
func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) {
if len(b) == 0 {
return nil
}
if s, ok := v.(*string); ok {
- Read upRead up
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 OidcUserInfo.ToMap
has 59 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (o OidcUserInfo) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Birthdate) {
toSerialize["birthdate"] = o.Birthdate
}
Method OAuth2ApiService.RevokeOAuth2LoginSessionsExecute
has 59 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *OAuth2ApiService) RevokeOAuth2LoginSessionsExecute(r ApiRevokeOAuth2LoginSessionsRequest) (*http.Response, error) {
var (
localVarHTTPMethod = http.MethodDelete
localVarPostBody interface{}
formFiles []formFile
Method DefaultStrategy.forwardConsentRequest
has 58 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (s *DefaultStrategy) forwardConsentRequest(
ctx context.Context,
w http.ResponseWriter,
r *http.Request,
ar fosite.AuthorizeRequester,