Showing 412 of 865 total issues
Function TestHelperCreateGetUpdateDeleteClientNext
has 83 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func TestHelperCreateGetUpdateDeleteClientNext(t *testing.T, m Storage, networks []uuid.UUID) {
ctx := context.Background()
resources := map[uuid.UUID][]Client{}
for k := range networks {
Function createPlan
has 82 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func createPlan(t *testing.T, extra url.Values, isParallel bool) {
planName := extra.Get("planName")
if stringslice.Has(skipWhenShort, planName) && testing.Short() {
t.Skipf("Skipping test plan '%s' because short tests", planName)
return
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
DefaultStrategy
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
Open
type DefaultStrategy struct {
c *config.DefaultProvider
r InternalRegistry
}
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 DefaultStrategy.verifyAuthentication
has 23 return statements (exceeds 4 allowed). Open
Open
func (s *DefaultStrategy) verifyAuthentication(
ctx context.Context,
w http.ResponseWriter,
r *http.Request,
req fosite.AuthorizeRequester,
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 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 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 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 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