Showing 402 of 849 total issues
Function run
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const run = (client) => {
const codeChallenge = "QeNVR-BHuB6I2d0HycQzp2qUNNKi_-5QoR4fQSifLH0"
const codeVerifier =
"ZmRrenFxZ3pid3A0T0xqY29falJNUS5lWlY4SDBxS182U21uQkhjZ3UuOXpnd3NOak56d2lLMTVYemNNdHdNdlE5TW03WC1RZUlaM0N5R2FhdGRpNW1oVGhjbzVuRFBD"
const state = prng()
Method RegistrySQL.Init
has a Cognitive Complexity of 32 (exceeds 20 allowed). Consider refactoring. Open
Open
func (m *RegistrySQL) Init(
ctx context.Context,
skipNetworkInit bool,
migrate bool,
ctxer contextx.Contextualizer,
- 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 OAuth2ApiService.ListOAuth2ConsentSessionsExecute
has 81 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *OAuth2ApiService) ListOAuth2ConsentSessionsExecute(r ApiListOAuth2ConsentSessionsRequest) ([]OAuth2ConsentSession, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
Method Handler.introspectOAuth2Token
has 81 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (h *Handler) introspectOAuth2Token(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
ctx := r.Context()
session := NewSessionWithCustomClaims(ctx, h.c, "")
if r.Method != "POST" {
Method OAuth2ApiService.ListOAuth2ClientsExecute
has 80 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *OAuth2ApiService) ListOAuth2ClientsExecute(r ApiListOAuth2ClientsRequest) ([]OAuth2Client, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
Client
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
Open
type Client struct {
NID uuid.UUID `db:"nid" faker:"-" json:"-"`
// OAuth 2.0 Client ID
//
Method Handler.performOidcFrontOrBackChannelLogout
has 79 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (h *Handler) performOidcFrontOrBackChannelLogout(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
ctx := r.Context()
handled, err := h.r.ConsentStrategy().HandleOpenIDConnectLogout(ctx, w, r)
if errors.Is(err, consent.ErrAbortOAuth2Request) {
Method OidcApiService.SetOidcDynamicClientExecute
has 78 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *OidcApiService) SetOidcDynamicClientExecute(r ApiSetOidcDynamicClientRequest) (*OAuth2Client, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPut
localVarPostBody interface{}
formFiles []formFile
Method OAuth2ApiService.Oauth2TokenExchangeExecute
has 78 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *OAuth2ApiService) Oauth2TokenExchangeExecute(r ApiOauth2TokenExchangeRequest) (*OAuth2TokenExchange, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
Method OAuth2ApiService.PatchOAuth2ClientExecute
has 78 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *OAuth2ApiService) PatchOAuth2ClientExecute(r ApiPatchOAuth2ClientRequest) (*OAuth2Client, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPatch
localVarPostBody interface{}
formFiles []formFile
Method OAuth2ApiService.GetOAuth2ConsentRequestExecute
has 77 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *OAuth2ApiService) GetOAuth2ConsentRequestExecute(r ApiGetOAuth2ConsentRequestRequest) (*OAuth2ConsentRequest, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
Method OAuth2ApiService.CreateOAuth2ClientExecute
has 77 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *OAuth2ApiService) CreateOAuth2ClientExecute(r ApiCreateOAuth2ClientRequest) (*OAuth2Client, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
Method OAuth2ApiService.GetOAuth2LoginRequestExecute
has 77 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *OAuth2ApiService) GetOAuth2LoginRequestExecute(r ApiGetOAuth2LoginRequestRequest) (*OAuth2LoginRequest, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
Method DefaultStrategy.forwardAuthenticationRequest
has 77 lines of code (exceeds 50 allowed). Consider refactoring. Open
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."))
}
Method OidcApiService.CreateOidcDynamicClientExecute
has 77 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *OidcApiService) CreateOidcDynamicClientExecute(r ApiCreateOidcDynamicClientRequest) (*OAuth2Client, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
Method OAuth2ApiService.GetOAuth2LogoutRequestExecute
has 77 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *OAuth2ApiService) GetOAuth2LogoutRequestExecute(r ApiGetOAuth2LogoutRequestRequest) (*OAuth2LogoutRequest, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
Method OidcConfiguration.ToMap
has 77 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (o OidcConfiguration) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["authorization_endpoint"] = o.AuthorizationEndpoint
if !IsNil(o.BackchannelLogoutSessionSupported) {
toSerialize["backchannel_logout_session_supported"] = o.BackchannelLogoutSessionSupported
Function parameterAddToHeaderOrQuery
has 77 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) {
var v = reflect.ValueOf(obj)
var value = ""
if v == reflect.ValueOf(nil) {
value = "null"
Function TestKeyManager_DeleteKey
has 77 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func TestKeyManager_DeleteKey(t *testing.T) {
ctrl := gomock.NewController(t)
hsmContext := NewMockContext(ctrl)
defer ctrl.Finish()
l := logrusx.New("", "")
Function TestKeyManager_HsmKeySetPrefix
has 77 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func TestKeyManager_HsmKeySetPrefix(t *testing.T) {
ctrl := gomock.NewController(t)
hsmContext := NewMockContext(ctrl)
defer ctrl.Finish()
l := logrusx.New("", "")