ory-am/hydra

View on GitHub

Showing 853 of 853 total issues

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

func (mr *MockOAuth2ProviderMockRecorder) NewPushedAuthorizeResponse(arg0, arg1, arg2 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewPushedAuthorizeResponse", reflect.TypeOf((*MockOAuth2Provider)(nil).NewPushedAuthorizeResponse), arg0, arg1, arg2)
}
Severity: Major
Found in oauth2/oauth2_provider_mock_test.go and 16 other locations - About 45 mins to fix
hsm/crypto11_mock_test.go on lines 54..57
hsm/crypto11_mock_test.go on lines 97..100
hsm/hsm_mock_test.go on lines 84..87
hsm/hsm_mock_test.go on lines 99..102
jwk/manager_mock_test.go on lines 50..53
jwk/manager_mock_test.go on lines 64..67
jwk/manager_mock_test.go on lines 78..81
jwk/manager_mock_test.go on lines 122..125
jwk/manager_mock_test.go on lines 151..154
jwk/manager_mock_test.go on lines 165..168
oauth2/oauth2_provider_mock_test.go on lines 74..77
oauth2/oauth2_provider_mock_test.go on lines 119..122
oauth2/oauth2_provider_mock_test.go on lines 134..137
oauth2/oauth2_provider_mock_test.go on lines 238..241
oauth2/oauth2_provider_mock_test.go on lines 250..253
oauth2/oauth2_provider_mock_test.go on lines 286..289

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 115.

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 17 locations. Consider refactoring.
Open

func (mr *MockOAuth2ProviderMockRecorder) WriteRevocationResponse(arg0, arg1, arg2 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteRevocationResponse", reflect.TypeOf((*MockOAuth2Provider)(nil).WriteRevocationResponse), arg0, arg1, arg2)
}
Severity: Major
Found in oauth2/oauth2_provider_mock_test.go and 16 other locations - About 45 mins to fix
hsm/crypto11_mock_test.go on lines 54..57
hsm/crypto11_mock_test.go on lines 97..100
hsm/hsm_mock_test.go on lines 84..87
hsm/hsm_mock_test.go on lines 99..102
jwk/manager_mock_test.go on lines 50..53
jwk/manager_mock_test.go on lines 64..67
jwk/manager_mock_test.go on lines 78..81
jwk/manager_mock_test.go on lines 122..125
jwk/manager_mock_test.go on lines 151..154
jwk/manager_mock_test.go on lines 165..168
oauth2/oauth2_provider_mock_test.go on lines 74..77
oauth2/oauth2_provider_mock_test.go on lines 119..122
oauth2/oauth2_provider_mock_test.go on lines 134..137
oauth2/oauth2_provider_mock_test.go on lines 164..167
oauth2/oauth2_provider_mock_test.go on lines 238..241
oauth2/oauth2_provider_mock_test.go on lines 250..253

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 115.

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 17 locations. Consider refactoring.
Open

func (mr *MockOAuth2ProviderMockRecorder) NewAuthorizeResponse(arg0, arg1, arg2 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewAuthorizeResponse", reflect.TypeOf((*MockOAuth2Provider)(nil).NewAuthorizeResponse), arg0, arg1, arg2)
}
Severity: Major
Found in oauth2/oauth2_provider_mock_test.go and 16 other locations - About 45 mins to fix
hsm/crypto11_mock_test.go on lines 54..57
hsm/crypto11_mock_test.go on lines 97..100
hsm/hsm_mock_test.go on lines 84..87
hsm/hsm_mock_test.go on lines 99..102
jwk/manager_mock_test.go on lines 50..53
jwk/manager_mock_test.go on lines 64..67
jwk/manager_mock_test.go on lines 78..81
jwk/manager_mock_test.go on lines 122..125
jwk/manager_mock_test.go on lines 151..154
jwk/manager_mock_test.go on lines 165..168
oauth2/oauth2_provider_mock_test.go on lines 74..77
oauth2/oauth2_provider_mock_test.go on lines 134..137
oauth2/oauth2_provider_mock_test.go on lines 164..167
oauth2/oauth2_provider_mock_test.go on lines 238..241
oauth2/oauth2_provider_mock_test.go on lines 250..253
oauth2/oauth2_provider_mock_test.go on lines 286..289

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 115.

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

    cy.request({
      method: "POST",
      url: Cypress.env("public_url") + "/oauth2/register",
      body: {
        grant_types: ["client_credentials"],
Severity: Major
Found in cypress/integration/openid/dynamic_client_registration.js and 2 other locations - About 45 mins to fix
cypress/integration/openid/dynamic_client_registration.js on lines 44..61
cypress/integration/openid/dynamic_client_registration.js on lines 65..92

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 50.

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

    cy.request({
      method: "POST",
      url: Cypress.env("public_url") + "/oauth2/register",
      body: {
        grant_types: ["client_credentials"],
Severity: Major
Found in cypress/integration/openid/dynamic_client_registration.js and 2 other locations - About 45 mins to fix
cypress/integration/openid/dynamic_client_registration.js on lines 65..92
cypress/integration/openid/dynamic_client_registration.js on lines 95..122

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 50.

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

    cy.request({
      method: "POST",
      url: Cypress.env("public_url") + "/oauth2/register",
      body: {
        grant_types: ["client_credentials"],
Severity: Major
Found in cypress/integration/openid/dynamic_client_registration.js and 2 other locations - About 45 mins to fix
cypress/integration/openid/dynamic_client_registration.js on lines 44..61
cypress/integration/openid/dynamic_client_registration.js on lines 95..122

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 50.

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

        {
            name: "Key set not found",
            args: args{
                ctx: context.TODO(),
                set: x.OpenIDConnectKeyName,
Severity: Minor
Found in hsm/manager_hsm_test.go and 1 other location - About 45 mins to fix
hsm/manager_hsm_test.go on lines 797..807

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 115.

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

        {
            name: "Key not found",
            args: args{
                ctx: context.TODO(),
                set: x.OpenIDConnectKeyName,
Severity: Minor
Found in hsm/manager_hsm_test.go and 1 other location - About 45 mins to fix
hsm/manager_hsm_test.go on lines 612..622

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 115.

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

func doTestRollback(m InternalRegistry, t *testing.T,
    createFn func(context.Context, string, fosite.Requester) error,
    getFn func(context.Context, string, fosite.Session) (fosite.Requester, error),
    revokeFn func(context.Context, string) error,
) {
Severity: Minor
Found in oauth2/fosite_store_helpers.go and 1 other location - About 45 mins to fix
oauth2/fosite_store_helpers.go on lines 1172..1208

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 114.

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

func doTestCommit(m InternalRegistry, t *testing.T,
    createFn func(context.Context, string, fosite.Requester) error,
    getFn func(context.Context, string, fosite.Session) (fosite.Requester, error),
    revokeFn func(context.Context, string) error,
) {
Severity: Minor
Found in oauth2/fosite_store_helpers.go and 1 other location - About 45 mins to fix
oauth2/fosite_store_helpers.go on lines 1210..1249

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 114.

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("case=should fail because a non-existing consent verifier was given", func(t *testing.T) {
        // Covers:
        // - This should fail because consent verifier was set but does not exist
        // - This should fail because a consent verifier was given but no login verifier
        testhelpers.NewLoginConsentUI(t, reg.Config(), testhelpers.HTTPServerNoExpectedCallHandler(t), testhelpers.HTTPServerNoExpectedCallHandler(t))
Severity: Minor
Found in consent/strategy_oauth_test.go and 1 other location - About 45 mins to fix
consent/strategy_oauth_test.go on lines 112..121

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 114.

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("case=should fail because a login verifier was given that doesn't exist in the store", func(t *testing.T) {
        testhelpers.NewLoginConsentUI(t, reg.Config(), testhelpers.HTTPServerNoExpectedCallHandler(t), testhelpers.HTTPServerNoExpectedCallHandler(t))
        c := createDefaultClient(t)
        hc := testhelpers.NewEmptyJarClient(t)

Severity: Minor
Found in consent/strategy_oauth_test.go and 1 other location - About 45 mins to fix
consent/strategy_oauth_test.go on lines 123..135

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 114.

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

    if strings.Contains(*o.RequestUrl, "mockConsent=accept") {
        remember := false
        if strings.Contains(*o.RequestUrl, "rememberConsent=yes") {
            remember = true
        }
Severity: Minor
Found in test/mock-lcp/main.go and 1 other location - About 45 mins to fix
test/mock-lcp/main.go on lines 34..62

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 114.

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

    if strings.Contains(lr.RequestUrl, "mockLogin=accept") {
        remember := false
        if strings.Contains(lr.RequestUrl, "rememberLogin=yes") {
            remember = true
        }
Severity: Minor
Found in test/mock-lcp/main.go and 1 other location - About 45 mins to fix
test/mock-lcp/main.go on lines 79..113

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 114.

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 9 locations. Consider refactoring.
Open

func (mr *MockContextMockRecorder) FindKeyPairs(id, label interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindKeyPairs", reflect.TypeOf((*MockContext)(nil).FindKeyPairs), id, label)
}
Severity: Major
Found in hsm/hsm_mock_test.go and 8 other locations - About 45 mins to fix
hsm/hsm_mock_test.go on lines 54..57
hsm/hsm_mock_test.go on lines 114..117
jwk/manager_mock_test.go on lines 92..95
jwk/manager_mock_test.go on lines 137..140
oauth2/oauth2_provider_mock_test.go on lines 89..92
oauth2/oauth2_provider_mock_test.go on lines 104..107
oauth2/oauth2_provider_mock_test.go on lines 149..152
oauth2/oauth2_provider_mock_test.go on lines 178..181

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 113.

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 9 locations. Consider refactoring.
Open

func (mr *MockContextMockRecorder) FindKeyPair(id, label interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindKeyPair", reflect.TypeOf((*MockContext)(nil).FindKeyPair), id, label)
}
Severity: Major
Found in hsm/hsm_mock_test.go and 8 other locations - About 45 mins to fix
hsm/hsm_mock_test.go on lines 69..72
hsm/hsm_mock_test.go on lines 114..117
jwk/manager_mock_test.go on lines 92..95
jwk/manager_mock_test.go on lines 137..140
oauth2/oauth2_provider_mock_test.go on lines 89..92
oauth2/oauth2_provider_mock_test.go on lines 104..107
oauth2/oauth2_provider_mock_test.go on lines 149..152
oauth2/oauth2_provider_mock_test.go on lines 178..181

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 113.

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 9 locations. Consider refactoring.
Open

func (mr *MockOAuth2ProviderMockRecorder) NewAccessResponse(arg0, arg1 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewAccessResponse", reflect.TypeOf((*MockOAuth2Provider)(nil).NewAccessResponse), arg0, arg1)
}
Severity: Major
Found in oauth2/oauth2_provider_mock_test.go and 8 other locations - About 45 mins to fix
hsm/hsm_mock_test.go on lines 54..57
hsm/hsm_mock_test.go on lines 69..72
hsm/hsm_mock_test.go on lines 114..117
jwk/manager_mock_test.go on lines 92..95
jwk/manager_mock_test.go on lines 137..140
oauth2/oauth2_provider_mock_test.go on lines 104..107
oauth2/oauth2_provider_mock_test.go on lines 149..152
oauth2/oauth2_provider_mock_test.go on lines 178..181

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 113.

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 9 locations. Consider refactoring.
Open

func (mr *MockOAuth2ProviderMockRecorder) NewAuthorizeRequest(arg0, arg1 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewAuthorizeRequest", reflect.TypeOf((*MockOAuth2Provider)(nil).NewAuthorizeRequest), arg0, arg1)
}
Severity: Major
Found in oauth2/oauth2_provider_mock_test.go and 8 other locations - About 45 mins to fix
hsm/hsm_mock_test.go on lines 54..57
hsm/hsm_mock_test.go on lines 69..72
hsm/hsm_mock_test.go on lines 114..117
jwk/manager_mock_test.go on lines 92..95
jwk/manager_mock_test.go on lines 137..140
oauth2/oauth2_provider_mock_test.go on lines 89..92
oauth2/oauth2_provider_mock_test.go on lines 149..152
oauth2/oauth2_provider_mock_test.go on lines 178..181

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 113.

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 9 locations. Consider refactoring.
Open

func (mr *MockManagerMockRecorder) DeleteKeySet(ctx, set interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteKeySet", reflect.TypeOf((*MockManager)(nil).DeleteKeySet), ctx, set)
}
Severity: Major
Found in jwk/manager_mock_test.go and 8 other locations - About 45 mins to fix
hsm/hsm_mock_test.go on lines 54..57
hsm/hsm_mock_test.go on lines 69..72
hsm/hsm_mock_test.go on lines 114..117
jwk/manager_mock_test.go on lines 137..140
oauth2/oauth2_provider_mock_test.go on lines 89..92
oauth2/oauth2_provider_mock_test.go on lines 104..107
oauth2/oauth2_provider_mock_test.go on lines 149..152
oauth2/oauth2_provider_mock_test.go on lines 178..181

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 113.

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 9 locations. Consider refactoring.
Open

func (mr *MockManagerMockRecorder) GetKeySet(ctx, set interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetKeySet", reflect.TypeOf((*MockManager)(nil).GetKeySet), ctx, set)
}
Severity: Major
Found in jwk/manager_mock_test.go and 8 other locations - About 45 mins to fix
hsm/hsm_mock_test.go on lines 54..57
hsm/hsm_mock_test.go on lines 69..72
hsm/hsm_mock_test.go on lines 114..117
jwk/manager_mock_test.go on lines 92..95
oauth2/oauth2_provider_mock_test.go on lines 89..92
oauth2/oauth2_provider_mock_test.go on lines 104..107
oauth2/oauth2_provider_mock_test.go on lines 149..152
oauth2/oauth2_provider_mock_test.go on lines 178..181

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 113.

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

Severity
Category
Status
Source
Language