ory-am/hydra

View on GitHub

Showing 853 of 853 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    {
        ID:             "flush-3",
        RequestedAt:    time.Now().Round(time.Second).Add(-(lifespan + time.Hour)),
        Client:         &client.Client{ID: "foobar"},
        RequestedScope: fosite.Arguments{"fa", "ba"},
Severity: Major
Found in oauth2/fosite_store_helpers.go and 1 other location - About 1 hr to fix
oauth2/fosite_store_helpers.go on lines 129..137

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 150.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method DefaultStrategy.forwardConsentRequest has 58 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (s *DefaultStrategy) forwardConsentRequest(
    ctx context.Context,
    w http.ResponseWriter,
    r *http.Request,
    ar fosite.AuthorizeRequester,
Severity: Minor
Found in consent/strategy_default.go - About 1 hr to fix

    Function run has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        const run = (client) => {
          cy.visit(
            `${Cypress.env("client_url")}/${path}/code?client_id=${
              client_id || client.client_id
            }&client_secret=${client_secret || client.client_secret}&scope=${(
    Severity: Minor
    Found in cypress/support/commands.js - About 1 hr to fix

      Function main has 58 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func main() {
          flag.Parse()
          conf := oauth2.Config{
              ClientID:     os.Getenv("OAUTH2_CLIENT_ID"),
              ClientSecret: os.Getenv("OAUTH2_CLIENT_SECRET"),
      Severity: Minor
      Found in test/mock-client/main.go - About 1 hr to fix

        Similar blocks of code found in 7 locations. Consider refactoring.
        Open

              const nc = () => ({
                client_secret: prng(),
                scope: "offline_access",
                redirect_uris: [`${Cypress.env("client_url")}/oauth2/callback`],
                grant_types: ["authorization_code", "refresh_token"],
        Severity: Major
        Found in cypress/integration/oauth2/consent.js and 6 other locations - About 1 hr to fix
        cypress/integration/oauth2/introspect.js on lines 11..17
        cypress/integration/oauth2/jwt.js on lines 22..28
        cypress/integration/oauth2/refresh_token.js on lines 11..17
        cypress/integration/openid/prompt.js on lines 12..18
        cypress/integration/openid/revoke.js on lines 11..17
        cypress/integration/openid/userinfo.js on lines 11..17

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 61.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 7 locations. Consider refactoring.
        Open

              const nc = () => ({
                client_secret: prng(),
                scope: "offline_access",
                redirect_uris: [`${Cypress.env("client_url")}/oauth2/callback`],
                grant_types: ["authorization_code", "refresh_token"],
        Severity: Major
        Found in cypress/integration/oauth2/jwt.js and 6 other locations - About 1 hr to fix
        cypress/integration/oauth2/consent.js on lines 11..17
        cypress/integration/oauth2/introspect.js on lines 11..17
        cypress/integration/oauth2/refresh_token.js on lines 11..17
        cypress/integration/openid/prompt.js on lines 12..18
        cypress/integration/openid/revoke.js on lines 11..17
        cypress/integration/openid/userinfo.js on lines 11..17

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 61.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 7 locations. Consider refactoring.
        Open

              const nc = () => ({
                client_secret: prng(),
                scope: "openid",
                redirect_uris: [`${Cypress.env("client_url")}/openid/callback`],
                grant_types: ["authorization_code", "refresh_token"],
        Severity: Major
        Found in cypress/integration/openid/prompt.js and 6 other locations - About 1 hr to fix
        cypress/integration/oauth2/consent.js on lines 11..17
        cypress/integration/oauth2/introspect.js on lines 11..17
        cypress/integration/oauth2/jwt.js on lines 22..28
        cypress/integration/oauth2/refresh_token.js on lines 11..17
        cypress/integration/openid/revoke.js on lines 11..17
        cypress/integration/openid/userinfo.js on lines 11..17

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 61.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 7 locations. Consider refactoring.
        Open

              const nc = () => ({
                client_secret: prng(),
                scope: "openid",
                redirect_uris: [`${Cypress.env("client_url")}/openid/callback`],
                grant_types: ["authorization_code", "refresh_token"],
        Severity: Major
        Found in cypress/integration/openid/userinfo.js and 6 other locations - About 1 hr to fix
        cypress/integration/oauth2/consent.js on lines 11..17
        cypress/integration/oauth2/introspect.js on lines 11..17
        cypress/integration/oauth2/jwt.js on lines 22..28
        cypress/integration/oauth2/refresh_token.js on lines 11..17
        cypress/integration/openid/prompt.js on lines 12..18
        cypress/integration/openid/revoke.js on lines 11..17

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 61.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 7 locations. Consider refactoring.
        Open

              const nc = () => ({
                client_secret: prng(),
                scope: "offline_access",
                redirect_uris: [`${Cypress.env("client_url")}/oauth2/callback`],
                grant_types: ["authorization_code", "refresh_token"],
        Severity: Major
        Found in cypress/integration/oauth2/introspect.js and 6 other locations - About 1 hr to fix
        cypress/integration/oauth2/consent.js on lines 11..17
        cypress/integration/oauth2/jwt.js on lines 22..28
        cypress/integration/oauth2/refresh_token.js on lines 11..17
        cypress/integration/openid/prompt.js on lines 12..18
        cypress/integration/openid/revoke.js on lines 11..17
        cypress/integration/openid/userinfo.js on lines 11..17

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 61.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 7 locations. Consider refactoring.
        Open

              const nc = () => ({
                client_secret: prng(),
                scope: "openid offline_access",
                redirect_uris: [`${Cypress.env("client_url")}/openid/callback`],
                grant_types: ["authorization_code", "refresh_token"],
        Severity: Major
        Found in cypress/integration/openid/revoke.js and 6 other locations - About 1 hr to fix
        cypress/integration/oauth2/consent.js on lines 11..17
        cypress/integration/oauth2/introspect.js on lines 11..17
        cypress/integration/oauth2/jwt.js on lines 22..28
        cypress/integration/oauth2/refresh_token.js on lines 11..17
        cypress/integration/openid/prompt.js on lines 12..18
        cypress/integration/openid/userinfo.js on lines 11..17

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 61.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 7 locations. Consider refactoring.
        Open

              const nc = () => ({
                client_secret: prng(),
                scope: "offline_access openid",
                redirect_uris: [`${Cypress.env("client_url")}/oauth2/callback`],
                grant_types: ["authorization_code", "refresh_token"],
        Severity: Major
        Found in cypress/integration/oauth2/refresh_token.js and 6 other locations - About 1 hr to fix
        cypress/integration/oauth2/consent.js on lines 11..17
        cypress/integration/oauth2/introspect.js on lines 11..17
        cypress/integration/oauth2/jwt.js on lines 22..28
        cypress/integration/openid/prompt.js on lines 12..18
        cypress/integration/openid/revoke.js on lines 11..17
        cypress/integration/openid/userinfo.js on lines 11..17

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 61.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

                body, res := makeLogoutRequest(t, browser, "GET", url.Values{
                    "post_logout_redirect_uri": {customPostLogoutURL},
                    "id_token_hint": {testhelpers.NewIDTokenWithClaims(t, reg, jwtgo.MapClaims{
                        "iss": reg.Config().IssuerURL(ctx).String(),
                        "aud": c.GetID(),
        Severity: Major
        Found in consent/strategy_logout_test.go and 1 other location - About 1 hr to fix
        consent/strategy_logout_test.go on lines 546..556

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 147.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

                logoutAndExpectPostLogoutPage(t, otherBrowser, "GET", url.Values{
                    "post_logout_redirect_uri": {customPostLogoutURL},
                    "id_token_hint": {testhelpers.NewIDTokenWithClaims(t, reg, jwtgo.MapClaims{
                        "iss": reg.Config().IssuerURL(ctx).String(),
                        "aud": c.GetID(),
        Severity: Major
        Found in consent/strategy_logout_test.go and 1 other location - About 1 hr to fix
        consent/strategy_logout_test.go on lines 516..526

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 147.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 3 locations. Consider refactoring.
        Open

                            cb: func(t *testing.T) httprouter.Handle {
                                return func(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
                                    code = r.URL.Query().Get("code")
                                    require.NotEmpty(t, code)
                                    _, _ = w.Write([]byte(r.URL.Query().Get("code")))
        Severity: Major
        Found in oauth2/oauth2_auth_code_test.go and 2 other locations - About 1 hr to fix
        oauth2/oauth2_auth_code_test.go on lines 1370..1376
        oauth2/oauth2_auth_code_test.go on lines 1421..1427

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 147.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 3 locations. Consider refactoring.
        Open

                            cb: func(t *testing.T) httprouter.Handle {
                                return func(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
                                    code = r.URL.Query().Get("code")
                                    require.NotEmpty(t, code)
                                    _, _ = w.Write([]byte(r.URL.Query().Get("code")))
        Severity: Major
        Found in oauth2/oauth2_auth_code_test.go and 2 other locations - About 1 hr to fix
        oauth2/oauth2_auth_code_test.go on lines 1421..1427
        oauth2/oauth2_auth_code_test.go on lines 1463..1469

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 147.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 3 locations. Consider refactoring.
        Open

                            cb: func(t *testing.T) httprouter.Handle {
                                return func(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
                                    code = r.URL.Query().Get("code")
                                    require.NotEmpty(t, code)
                                    _, _ = w.Write([]byte(r.URL.Query().Get("code")))
        Severity: Major
        Found in oauth2/oauth2_auth_code_test.go and 2 other locations - About 1 hr to fix
        oauth2/oauth2_auth_code_test.go on lines 1370..1376
        oauth2/oauth2_auth_code_test.go on lines 1463..1469

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 147.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            t.Run("Test_Helper/Run_FindPublicKey_With_ECDSA", func(t *testing.T) {
                t.Parallel()
                ECDSAIDKS, err := jwk.GenerateJWK(context.Background(), jose.ES256, "test-id-2", "sig")
                require.NoError(t, err)
                keys, err := jwk.FindPublicKey(ECDSAIDKS)
        Severity: Major
        Found in jwk/helper_test.go and 1 other location - About 1 hr to fix
        jwk/helper_test.go on lines 51..59

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 147.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            t.Run("Test_Helper/Run_FindPublicKey_With_RSA", func(t *testing.T) {
                t.Parallel()
                RSIDKS, err := jwk.GenerateJWK(context.Background(), jose.RS256, "test-id-1", "sig")
                require.NoError(t, err)
                keys, err := jwk.FindPublicKey(RSIDKS)
        Severity: Major
        Found in jwk/helper_test.go and 1 other location - About 1 hr to fix
        jwk/helper_test.go on lines 88..96

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 147.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Method OAuth2APIService.DeleteOAuth2TokenExecute has 57 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func (a *OAuth2APIService) DeleteOAuth2TokenExecute(r ApiDeleteOAuth2TokenRequest) (*http.Response, error) {
            var (
                localVarHTTPMethod = http.MethodDelete
                localVarPostBody   interface{}
                formFiles          []formFile
        Severity: Minor
        Found in internal/httpclient/api_o_auth2.go - About 1 hr to fix

          Method OAuth2APIService.RejectOAuth2LogoutRequestExecute has 57 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func (a *OAuth2APIService) RejectOAuth2LogoutRequestExecute(r ApiRejectOAuth2LogoutRequestRequest) (*http.Response, error) {
              var (
                  localVarHTTPMethod = http.MethodPut
                  localVarPostBody   interface{}
                  formFiles          []formFile
          Severity: Minor
          Found in internal/httpclient/api_o_auth2.go - About 1 hr to fix
            Severity
            Category
            Status
            Source
            Language