ory-am/hydra

View on GitHub
hsm/crypto11_mock_test.go

Summary

Maintainability
B
4 hrs
Test Coverage

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

func (m *MockSignerDecrypter) Sign(arg0 io.Reader, arg1 []byte, arg2 crypto.SignerOpts) ([]byte, error) {
    m.ctrl.T.Helper()
    ret := m.ctrl.Call(m, "Sign", arg0, arg1, arg2)
    ret0, _ := ret[0].([]byte)
    ret1, _ := ret[1].(error)
Severity: Major
Found in hsm/crypto11_mock_test.go and 1 other location - About 1 hr to fix
hsm/crypto11_mock_test.go on lines 45..51

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

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

func (m *MockSignerDecrypter) Decrypt(arg0 io.Reader, arg1 []byte, arg2 crypto.DecrypterOpts) ([]byte, error) {
    m.ctrl.T.Helper()
    ret := m.ctrl.Call(m, "Decrypt", arg0, arg1, arg2)
    ret0, _ := ret[0].([]byte)
    ret1, _ := ret[1].(error)
Severity: Major
Found in hsm/crypto11_mock_test.go and 1 other location - About 1 hr to fix
hsm/crypto11_mock_test.go on lines 88..94

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

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 *MockSignerDecrypterMockRecorder) Sign(arg0, arg1, arg2 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Sign", reflect.TypeOf((*MockSignerDecrypter)(nil).Sign), arg0, arg1, arg2)
}
Severity: Major
Found in hsm/crypto11_mock_test.go and 16 other locations - About 45 mins to fix
hsm/crypto11_mock_test.go on lines 54..57
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
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 *MockSignerDecrypterMockRecorder) Decrypt(arg0, arg1, arg2 interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Decrypt", reflect.TypeOf((*MockSignerDecrypter)(nil).Decrypt), arg0, arg1, arg2)
}
Severity: Major
Found in hsm/crypto11_mock_test.go and 16 other locations - About 45 mins to fix
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
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 13 locations. Consider refactoring.
Open

func (mr *MockSignerDecrypterMockRecorder) Public() *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Public", reflect.TypeOf((*MockSignerDecrypter)(nil).Public))
}
Severity: Major
Found in hsm/crypto11_mock_test.go and 12 other locations - About 30 mins to fix
hsm/crypto11_mock_test.go on lines 68..71
jwk/registry_mock_test.go on lines 54..57
jwk/registry_mock_test.go on lines 68..71
jwk/registry_mock_test.go on lines 82..85
jwk/registry_mock_test.go on lines 96..99
jwk/registry_mock_test.go on lines 110..113
jwk/registry_mock_test.go on lines 124..127
jwk/registry_mock_test.go on lines 138..141
jwk/registry_mock_test.go on lines 175..178
jwk/registry_mock_test.go on lines 189..192
jwk/registry_mock_test.go on lines 203..206
jwk/registry_mock_test.go on lines 217..220

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

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

func (mr *MockSignerDecrypterMockRecorder) Delete() *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockSignerDecrypter)(nil).Delete))
}
Severity: Major
Found in hsm/crypto11_mock_test.go and 12 other locations - About 30 mins to fix
hsm/crypto11_mock_test.go on lines 82..85
jwk/registry_mock_test.go on lines 54..57
jwk/registry_mock_test.go on lines 68..71
jwk/registry_mock_test.go on lines 82..85
jwk/registry_mock_test.go on lines 96..99
jwk/registry_mock_test.go on lines 110..113
jwk/registry_mock_test.go on lines 124..127
jwk/registry_mock_test.go on lines 138..141
jwk/registry_mock_test.go on lines 175..178
jwk/registry_mock_test.go on lines 189..192
jwk/registry_mock_test.go on lines 203..206
jwk/registry_mock_test.go on lines 217..220

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

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

There are no issues that match your filters.

Category
Status