ory-am/hydra

View on GitHub
hsm/hsm_mock_test.go

Summary

Maintainability
A
3 hrs
Test Coverage

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

func (mr *MockContextMockRecorder) GenerateRSAKeyPairWithAttributes(public, private, bits interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenerateRSAKeyPairWithAttributes", reflect.TypeOf((*MockContext)(nil).GenerateRSAKeyPairWithAttributes), public, private, bits)
}
Severity: Major
Found in hsm/hsm_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
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 *MockContextMockRecorder) GenerateECDSAKeyPairWithAttributes(public, private, curve interface{}) *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenerateECDSAKeyPairWithAttributes", reflect.TypeOf((*MockContext)(nil).GenerateECDSAKeyPairWithAttributes), public, private, curve)
}
Severity: Major
Found in hsm/hsm_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 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 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 *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 *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

There are no issues that match your filters.

Category
Status