ory-am/hydra

View on GitHub

Showing 850 of 850 total issues

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

func (p *Persister) DeleteRefreshTokenSession(ctx context.Context, signature string) (err error) {
    ctx, span := p.r.Tracer(ctx).Tracer().Start(ctx, "persistence.sql.DeleteRefreshTokenSession")
    defer otelx.End(span, &err)
    return p.deleteSessionBySignature(ctx, signature, sqlTableRefresh)
}
Severity: Major
Found in persistence/sql/persister_oauth2.go and 4 other locations - About 35 mins to fix
persistence/sql/persister_oauth2.go on lines 455..459
persistence/sql/persister_oauth2.go on lines 474..478
persistence/sql/persister_oauth2.go on lines 480..484
persistence/sql/persister_oauth2.go on lines 492..496

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

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 (p *Persister) RevokeAccessToken(ctx context.Context, id string) (err error) {
    ctx, span := p.r.Tracer(ctx).Tracer().Start(ctx, "persistence.sql.RevokeAccessToken")
    defer otelx.End(span, &err)
    return p.deleteSessionByRequestID(ctx, id, sqlTableAccess)
}
Severity: Major
Found in persistence/sql/persister_oauth2.go and 4 other locations - About 35 mins to fix
persistence/sql/persister_oauth2.go on lines 435..439
persistence/sql/persister_oauth2.go on lines 455..459
persistence/sql/persister_oauth2.go on lines 474..478
persistence/sql/persister_oauth2.go on lines 480..484

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

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

    var getAndInspectToken = func(b *testing.B, cl *hc.Client, conf clientcredentials.Config, strategy string, expectedExp time.Time, checkExtraClaims bool) {
        token, err := getToken(b, conf)
        require.NoError(b, err)
        inspectToken(b, token, cl, conf, strategy, expectedExp, checkExtraClaims)
    }
Severity: Minor
Found in oauth2/oauth2_client_credentials_bench_test.go and 1 other location - About 35 mins to fix
oauth2/oauth2_client_credentials_test.go on lines 118..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 103.

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

    var getAndInspectToken = func(t *testing.T, cl *hc.Client, conf clientcredentials.Config, strategy string, expectedExp time.Time, checkExtraClaims bool) {
        token, err := getToken(t, conf)
        require.NoError(t, err)
        inspectToken(t, token, cl, conf, strategy, expectedExp, checkExtraClaims)
    }
Severity: Minor
Found in oauth2/oauth2_client_credentials_test.go and 1 other location - About 35 mins to fix
oauth2/oauth2_client_credentials_bench_test.go on lines 119..123

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

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

  oauth2
    .create(req.session.credentials)
    .accessToken.create(req.session.oauth2_flow.token)
    .revoke(req.query.type || "access_token")
Severity: Minor
Found in test/e2e/oauth2-client/src/index.js and 1 other location - About 35 mins to fix
test/e2e/oauth2-client/src/index.js on lines 156..159

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

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

  oauth2
    .create(req.session.credentials)
    .accessToken.create(req.session.oauth2_flow.token)
    .refresh()
Severity: Minor
Found in test/e2e/oauth2-client/src/index.js and 1 other location - About 35 mins to fix
test/e2e/oauth2-client/src/index.js on lines 170..173

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

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 *MockInternalRegistryMockRecorder) Logger() *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Logger", reflect.TypeOf((*MockInternalRegistry)(nil).Logger))
}
Severity: Major
Found in jwk/registry_mock_test.go and 12 other locations - About 30 mins to fix
hsm/crypto11_mock_test.go on lines 68..71
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 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 *MockInternalRegistryMockRecorder) Writer() *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Writer", reflect.TypeOf((*MockInternalRegistry)(nil).Writer))
}
Severity: Major
Found in jwk/registry_mock_test.go and 12 other locations - About 30 mins to fix
hsm/crypto11_mock_test.go on lines 68..71
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 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 *MockInternalRegistryMockRecorder) AuditLogger() *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AuditLogger", reflect.TypeOf((*MockInternalRegistry)(nil).AuditLogger))
}
Severity: Major
Found in jwk/registry_mock_test.go and 12 other locations - About 30 mins to fix
hsm/crypto11_mock_test.go on lines 68..71
hsm/crypto11_mock_test.go on lines 82..85
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 *MockInternalRegistryMockRecorder) Config() *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Config", reflect.TypeOf((*MockInternalRegistry)(nil).Config))
}
Severity: Major
Found in jwk/registry_mock_test.go and 12 other locations - About 30 mins to fix
hsm/crypto11_mock_test.go on lines 68..71
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 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 *MockRegistryMockRecorder) KeyManager() *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "KeyManager", reflect.TypeOf((*MockRegistry)(nil).KeyManager))
}
Severity: Major
Found in jwk/registry_mock_test.go and 12 other locations - About 30 mins to fix
hsm/crypto11_mock_test.go on lines 68..71
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 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 *MockInternalRegistryMockRecorder) KeyManager() *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "KeyManager", reflect.TypeOf((*MockInternalRegistry)(nil).KeyManager))
}
Severity: Major
Found in jwk/registry_mock_test.go and 12 other locations - About 30 mins to fix
hsm/crypto11_mock_test.go on lines 68..71
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 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 *MockInternalRegistryMockRecorder) KeyCipher() *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "KeyCipher", reflect.TypeOf((*MockInternalRegistry)(nil).KeyCipher))
}
Severity: Major
Found in jwk/registry_mock_test.go and 12 other locations - About 30 mins to fix
hsm/crypto11_mock_test.go on lines 68..71
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 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 *MockRegistryMockRecorder) SoftwareKeyManager() *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SoftwareKeyManager", reflect.TypeOf((*MockRegistry)(nil).SoftwareKeyManager))
}
Severity: Major
Found in jwk/registry_mock_test.go and 12 other locations - About 30 mins to fix
hsm/crypto11_mock_test.go on lines 68..71
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

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 *MockRegistryMockRecorder) Config() *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Config", reflect.TypeOf((*MockRegistry)(nil).Config))
}
Severity: Major
Found in jwk/registry_mock_test.go and 12 other locations - About 30 mins to fix
hsm/crypto11_mock_test.go on lines 68..71
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 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 *MockRegistryMockRecorder) KeyCipher() *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "KeyCipher", reflect.TypeOf((*MockRegistry)(nil).KeyCipher))
}
Severity: Major
Found in jwk/registry_mock_test.go and 12 other locations - About 30 mins to fix
hsm/crypto11_mock_test.go on lines 68..71
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 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

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

func (mr *MockInternalRegistryMockRecorder) SoftwareKeyManager() *gomock.Call {
    mr.mock.ctrl.T.Helper()
    return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SoftwareKeyManager", reflect.TypeOf((*MockInternalRegistry)(nil).SoftwareKeyManager))
}
Severity: Major
Found in jwk/registry_mock_test.go and 12 other locations - About 30 mins to fix
hsm/crypto11_mock_test.go on lines 68..71
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 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 2 locations. Consider refactoring.
Open

    } else {
        publicAttrSet.AddIfNotPresent([]*pkcs11.Attribute{
            pkcs11.NewAttribute(pkcs11.CKA_VERIFY, false),
            pkcs11.NewAttribute(pkcs11.CKA_ENCRYPT, true),
        })
Severity: Minor
Found in hsm/manager_hsm.go and 1 other location - About 30 mins to fix
hsm/manager_hsm.go on lines 314..323

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

Severity
Category
Status
Source
Language