internal/httpclient/model_o_auth2_client.go
OAuth2Client
has 194 methods (exceeds 20 allowed). Consider refactoring. Open
Open
type OAuth2Client struct {
// OAuth 2.0 Access Token Strategy AccessTokenStrategy is the strategy used to generate access tokens. Valid options are `jwt` and `opaque`. `jwt` is a bad idea, see https://www.ory.sh/docs/hydra/advanced#json-web-tokens Setting the stragegy here overrides the global setting in `strategies.access_token`.
AccessTokenStrategy *string `json:"access_token_strategy,omitempty"`
AllowedCorsOrigins []string `json:"allowed_cors_origins,omitempty"`
Audience []string `json:"audience,omitempty"`
File model_o_auth2_client.go
has 1307 lines of code (exceeds 500 allowed). Consider refactoring. Open
Open
/*
Ory Hydra API
Documentation for all of Ory Hydra's APIs.
Method OAuth2Client.ToMap
has a Cognitive Complexity of 48 (exceeds 20 allowed). Consider refactoring. Open
Open
func (o OAuth2Client) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.AccessTokenStrategy) {
toSerialize["access_token_strategy"] = o.AccessTokenStrategy
}
- 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 OAuth2Client.ToMap
has 146 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (o OAuth2Client) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.AccessTokenStrategy) {
toSerialize["access_token_strategy"] = o.AccessTokenStrategy
}