piotrkowalczuk/charon

View on GitHub
internal/model/modelmock/refresh_token_provider.go

Summary

Maintainability
D
1 day
Test Coverage

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

func (_m *RefreshTokenProvider) UpdateOneByToken(_a0 context.Context, _a1 string, _a2 *model.RefreshTokenPatch) (*model.RefreshTokenEntity, error) {
    ret := _m.Called(_a0, _a1, _a2)

    var r0 *model.RefreshTokenEntity
    if rf, ok := ret.Get(0).(func(context.Context, string, *model.RefreshTokenPatch) *model.RefreshTokenEntity); ok {
Severity: Major
Found in internal/model/modelmock/refresh_token_provider.go and 2 other locations - About 3 hrs to fix
internal/model/modelmock/group_provider.go on lines 209..229
internal/model/modelmock/user_provider.go on lines 329..349

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

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 (_m *RefreshTokenProvider) Find(_a0 context.Context, _a1 *model.RefreshTokenFindExpr) ([]*model.RefreshTokenEntity, error) {
    ret := _m.Called(_a0, _a1)

    var r0 []*model.RefreshTokenEntity
    if rf, ok := ret.Get(0).(func(context.Context, *model.RefreshTokenFindExpr) []*model.RefreshTokenEntity); ok {
Severity: Major
Found in internal/model/modelmock/refresh_token_provider.go and 4 other locations - About 3 hrs to fix
internal/model/modelmock/group_provider.go on lines 61..81
internal/model/modelmock/permission_provider.go on lines 16..36
internal/model/modelmock/user_groups_provider.go on lines 57..77
internal/model/modelmock/user_provider.go on lines 139..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 296.

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

func (_m *RefreshTokenProvider) Create(_a0 context.Context, _a1 *model.RefreshTokenEntity) (*model.RefreshTokenEntity, error) {
    ret := _m.Called(_a0, _a1)

    var r0 *model.RefreshTokenEntity
    if rf, ok := ret.Get(0).(func(context.Context, *model.RefreshTokenEntity) *model.RefreshTokenEntity); ok {
Severity: Major
Found in internal/model/modelmock/refresh_token_provider.go and 7 other locations - About 3 hrs to fix
internal/model/modelmock/group_permissions_provider.go on lines 15..35
internal/model/modelmock/group_provider.go on lines 130..150
internal/model/modelmock/permission_provider.go on lines 108..128
internal/model/modelmock/user_groups_provider.go on lines 80..100
internal/model/modelmock/user_permissions_provider.go on lines 36..56
internal/model/modelmock/user_provider.go on lines 51..71
internal/model/modelmock/user_provider.go on lines 208..228

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

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 (_m *RefreshTokenProvider) FindOneByToken(_a0 context.Context, _a1 string) (*model.RefreshTokenEntity, error) {
    ret := _m.Called(_a0, _a1)

    var r0 *model.RefreshTokenEntity
    if rf, ok := ret.Get(0).(func(context.Context, string) *model.RefreshTokenEntity); ok {
Severity: Major
Found in internal/model/modelmock/refresh_token_provider.go and 4 other locations - About 3 hrs to fix
internal/model/modelmock/group_provider.go on lines 107..127
internal/model/modelmock/permission_provider.go on lines 85..105
internal/model/modelmock/user_provider.go on lines 162..182
internal/model/modelmock/user_provider.go on lines 185..205

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

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