ory-am/hydra

View on GitHub

Showing 853 of 853 total issues

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

func (mr *MockContextMockRecorder) GetAttribute(key, attribute interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAttribute", reflect.TypeOf((*MockContext)(nil).GetAttribute), key, attribute)
}
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 69..72
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) NewPushedAuthorizeRequest(arg0, arg1 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewPushedAuthorizeRequest", reflect.TypeOf((*MockOAuth2Provider)(nil).NewPushedAuthorizeRequest), 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 104..107
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) NewRevocationRequest(arg0, arg1 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewRevocationRequest", reflect.TypeOf((*MockOAuth2Provider)(nil).NewRevocationRequest), 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 104..107
oauth2/oauth2_provider_mock_test.go on lines 149..152

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

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

            v, _, err := adminClient.OAuth2API.AcceptOAuth2ConsentRequest(ctx).
                ConsentChallenge(r.URL.Query().Get("consent_challenge")).
                AcceptOAuth2ConsentRequest(hydra.AcceptOAuth2ConsentRequest{
                    GrantScope: []string{"hydra", "offline", "openid"}, Remember: pointerx.Ptr(true), RememberFor: pointerx.Ptr[int64](0),
                    GrantAccessTokenAudience: rr.RequestedAccessTokenAudience,
Severity: Minor
Found in oauth2/oauth2_auth_code_bench_test.go and 1 other location - About 45 mins to fix
oauth2/oauth2_auth_code_test.go on lines 161..170

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

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

            v, _, err := adminClient.OAuth2API.AcceptOAuth2ConsentRequest(context.Background()).
                ConsentChallenge(r.URL.Query().Get("consent_challenge")).
                AcceptOAuth2ConsentRequest(hydra.AcceptOAuth2ConsentRequest{
                    GrantScope: []string{"hydra", "offline", "openid"}, Remember: pointerx.Ptr(true), RememberFor: pointerx.Ptr[int64](0),
                    GrantAccessTokenAudience: rr.RequestedAccessTokenAudience,
Severity: Minor
Found in oauth2/oauth2_auth_code_test.go and 1 other location - About 45 mins to fix
oauth2/oauth2_auth_code_bench_test.go on lines 204..213

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

func (mr *MockCookieConfigProviderMockRecorder) CookieSecure(arg0 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CookieSecure", reflect.TypeOf((*MockCookieConfigProvider)(nil).CookieSecure), arg0)
}
Severity: Major
Found in internal/mock/config_cookie.go and 4 other locations - About 40 mins to fix
internal/mock/config_cookie.go on lines 50..53
internal/mock/config_cookie.go on lines 64..67
internal/mock/config_cookie.go on lines 78..81
internal/mock/config_cookie.go on lines 106..109

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

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

func (mr *MockCookieConfigProviderMockRecorder) IsDevelopmentMode(arg0 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsDevelopmentMode", reflect.TypeOf((*MockCookieConfigProvider)(nil).IsDevelopmentMode), arg0)
}
Severity: Major
Found in internal/mock/config_cookie.go and 4 other locations - About 40 mins to fix
internal/mock/config_cookie.go on lines 50..53
internal/mock/config_cookie.go on lines 64..67
internal/mock/config_cookie.go on lines 78..81
internal/mock/config_cookie.go on lines 92..95

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

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

    t.Run("AddKeySet", func(t *testing.T) {
        softwareKeyManager.EXPECT().AddKeySet(gomock.Any(), gomock.Eq("set1"), gomock.Any()).Return(nil)
        err := keyManager.AddKeySet(context.TODO(), "set1", nil)
        assert.NoError(t, err)
    })
Severity: Major
Found in jwk/manager_strategy_test.go and 3 other locations - About 40 mins to fix
jwk/manager_strategy_test.go on lines 51..55
jwk/manager_strategy_test.go on lines 75..79
jwk/manager_strategy_test.go on lines 87..91

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

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

func (m *MockManager) AddKey(ctx context.Context, set string, key *jose.JSONWebKey) error {
    m.ctrl.T.Helper()
    ret := m.ctrl.Call(m, "AddKey", ctx, set, key)
    ret0, _ := ret[0].(error)
    return ret0
Severity: Major
Found in jwk/manager_mock_test.go and 3 other locations - About 40 mins to fix
jwk/manager_mock_test.go on lines 56..61
jwk/manager_mock_test.go on lines 143..148
jwk/manager_mock_test.go on lines 157..162

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

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

func (m *MockManager) UpdateKey(ctx context.Context, set string, key *jose.JSONWebKey) error {
    m.ctrl.T.Helper()
    ret := m.ctrl.Call(m, "UpdateKey", ctx, set, key)
    ret0, _ := ret[0].(error)
    return ret0
Severity: Major
Found in jwk/manager_mock_test.go and 3 other locations - About 40 mins to fix
jwk/manager_mock_test.go on lines 42..47
jwk/manager_mock_test.go on lines 56..61
jwk/manager_mock_test.go on lines 157..162

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

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

func (mr *MockCookieConfigProviderMockRecorder) CookieDomain(arg0 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CookieDomain", reflect.TypeOf((*MockCookieConfigProvider)(nil).CookieDomain), arg0)
}
Severity: Major
Found in internal/mock/config_cookie.go and 4 other locations - About 40 mins to fix
internal/mock/config_cookie.go on lines 64..67
internal/mock/config_cookie.go on lines 78..81
internal/mock/config_cookie.go on lines 92..95
internal/mock/config_cookie.go on lines 106..109

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

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

func (mr *MockCookieConfigProviderMockRecorder) CookieSameSiteLegacyWorkaround(arg0 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CookieSameSiteLegacyWorkaround", reflect.TypeOf((*MockCookieConfigProvider)(nil).CookieSameSiteLegacyWorkaround), arg0)
}
Severity: Major
Found in internal/mock/config_cookie.go and 4 other locations - About 40 mins to fix
internal/mock/config_cookie.go on lines 50..53
internal/mock/config_cookie.go on lines 78..81
internal/mock/config_cookie.go on lines 92..95
internal/mock/config_cookie.go on lines 106..109

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

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

func (mr *MockCookieConfigProviderMockRecorder) CookieSameSiteMode(arg0 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CookieSameSiteMode", reflect.TypeOf((*MockCookieConfigProvider)(nil).CookieSameSiteMode), arg0)
}
Severity: Major
Found in internal/mock/config_cookie.go and 4 other locations - About 40 mins to fix
internal/mock/config_cookie.go on lines 50..53
internal/mock/config_cookie.go on lines 64..67
internal/mock/config_cookie.go on lines 92..95
internal/mock/config_cookie.go on lines 106..109

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

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

func (m *MockManager) AddKeySet(ctx context.Context, set string, keys *jose.JSONWebKeySet) error {
    m.ctrl.T.Helper()
    ret := m.ctrl.Call(m, "AddKeySet", ctx, set, keys)
    ret0, _ := ret[0].(error)
    return ret0
Severity: Major
Found in jwk/manager_mock_test.go and 3 other locations - About 40 mins to fix
jwk/manager_mock_test.go on lines 42..47
jwk/manager_mock_test.go on lines 143..148
jwk/manager_mock_test.go on lines 157..162

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

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

    t.Run("AddKey", func(t *testing.T) {
        softwareKeyManager.EXPECT().AddKey(gomock.Any(), gomock.Eq("set1"), gomock.Any()).Return(nil)
        err := keyManager.AddKey(context.TODO(), "set1", nil)
        assert.NoError(t, err)
    })
Severity: Major
Found in jwk/manager_strategy_test.go and 3 other locations - About 40 mins to fix
jwk/manager_strategy_test.go on lines 63..67
jwk/manager_strategy_test.go on lines 75..79
jwk/manager_strategy_test.go on lines 87..91

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

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

func (m *MockManager) UpdateKeySet(ctx context.Context, set string, keys *jose.JSONWebKeySet) error {
    m.ctrl.T.Helper()
    ret := m.ctrl.Call(m, "UpdateKeySet", ctx, set, keys)
    ret0, _ := ret[0].(error)
    return ret0
Severity: Major
Found in jwk/manager_mock_test.go and 3 other locations - About 40 mins to fix
jwk/manager_mock_test.go on lines 42..47
jwk/manager_mock_test.go on lines 56..61
jwk/manager_mock_test.go on lines 143..148

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

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

    t.Run("UpdateKey", func(t *testing.T) {
        softwareKeyManager.EXPECT().UpdateKey(gomock.Any(), gomock.Eq("set1"), gomock.Any()).Return(nil)
        err := keyManager.UpdateKey(context.TODO(), "set1", nil)
        assert.NoError(t, err)
    })
Severity: Major
Found in jwk/manager_strategy_test.go and 3 other locations - About 40 mins to fix
jwk/manager_strategy_test.go on lines 51..55
jwk/manager_strategy_test.go on lines 63..67
jwk/manager_strategy_test.go on lines 87..91

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

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

    t.Run("UpdateKeySet", func(t *testing.T) {
        softwareKeyManager.EXPECT().UpdateKeySet(gomock.Any(), gomock.Eq("set1"), gomock.Any()).Return(nil)
        err := keyManager.UpdateKeySet(context.TODO(), "set1", nil)
        assert.NoError(t, err)
    })
Severity: Major
Found in jwk/manager_strategy_test.go and 3 other locations - About 40 mins to fix
jwk/manager_strategy_test.go on lines 51..55
jwk/manager_strategy_test.go on lines 63..67
jwk/manager_strategy_test.go on lines 75..79

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

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.requestConsent has 6 return statements (exceeds 4 allowed).
Open

func (s *DefaultStrategy) requestConsent(
    ctx context.Context,
    w http.ResponseWriter,
    r *http.Request,
    ar fosite.AuthorizeRequester,
Severity: Major
Found in consent/strategy_default.go - About 40 mins to fix

    Method OidcAPIService.RevokeOidcSessionExecute has 6 return statements (exceeds 4 allowed).
    Open

    func (a *OidcAPIService) RevokeOidcSessionExecute(r ApiRevokeOidcSessionRequest) (*http.Response, error) {
        var (
            localVarHTTPMethod = http.MethodGet
            localVarPostBody   interface{}
            formFiles          []formFile
    Severity: Major
    Found in internal/httpclient/api_oidc.go - About 40 mins to fix
      Severity
      Category
      Status
      Source
      Language