piotrkowalczuk/charon

View on GitHub

Showing 70 of 141 total issues

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

func (_m *GroupProvider) Insert(_a0 context.Context, _a1 *model.GroupEntity) (*model.GroupEntity, error) {
    ret := _m.Called(_a0, _a1)

    var r0 *model.GroupEntity
    if rf, ok := ret.Get(0).(func(context.Context, *model.GroupEntity) *model.GroupEntity); ok {
Severity: Major
Found in internal/model/modelmock/group_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/permission_provider.go on lines 108..128
internal/model/modelmock/refresh_token_provider.go on lines 15..35
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 8 locations. Consider refactoring.
Open

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

    var r0 *model.UserEntity
    if rf, ok := ret.Get(0).(func(context.Context, *model.UserEntity) *model.UserEntity); ok {
Severity: Major
Found in internal/model/modelmock/user_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/refresh_token_provider.go on lines 15..35
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 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 3 locations. Consider refactoring.
Open

func (_m *PermissionProvider) FindByUserID(ctx context.Context, userID int64) ([]*model.PermissionEntity, error) {
    ret := _m.Called(ctx, userID)

    var r0 []*model.PermissionEntity
    if rf, ok := ret.Get(0).(func(context.Context, int64) []*model.PermissionEntity); ok {
Severity: Major
Found in internal/model/modelmock/permission_provider.go and 2 other locations - About 3 hrs to fix
internal/model/modelmock/group_provider.go on lines 84..104
internal/model/modelmock/permission_provider.go on lines 39..59

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

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

// Code generated by mockery v1.0.0. DO NOT EDIT.

package sessionmock

import context "context"
Severity: Major
Found in internal/session/sessionmock/actor_provider.go and 1 other location - About 3 hrs to fix
internal/service/servicemock/user_finder.go on lines 1..35

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

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

// Code generated by mockery v1.0.0. DO NOT EDIT.

package servicemock

import context "context"
Severity: Major
Found in internal/service/servicemock/user_finder.go and 1 other location - About 3 hrs to fix
internal/session/sessionmock/actor_provider.go on lines 1..35

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

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

func (_m *PermissionProvider) FindByGroupID(ctx context.Context, groupID int64) ([]*model.PermissionEntity, error) {
    ret := _m.Called(ctx, groupID)

    var r0 []*model.PermissionEntity
    if rf, ok := ret.Get(0).(func(context.Context, int64) []*model.PermissionEntity); ok {
Severity: Major
Found in internal/model/modelmock/permission_provider.go and 2 other locations - About 3 hrs to fix
internal/model/modelmock/group_provider.go on lines 84..104
internal/model/modelmock/permission_provider.go on lines 62..82

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

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

func (_m *GroupProvider) FindByUserID(_a0 context.Context, _a1 int64) ([]*model.GroupEntity, error) {
    ret := _m.Called(_a0, _a1)

    var r0 []*model.GroupEntity
    if rf, ok := ret.Get(0).(func(context.Context, int64) []*model.GroupEntity); ok {
Severity: Major
Found in internal/model/modelmock/group_provider.go and 2 other locations - About 3 hrs to fix
internal/model/modelmock/permission_provider.go on lines 39..59
internal/model/modelmock/permission_provider.go on lines 62..82

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

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

    var r0 *model.UserEntity
    if rf, ok := ret.Get(0).(func(context.Context, string) *model.UserEntity); ok {
Severity: Major
Found in internal/model/modelmock/user_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/refresh_token_provider.go on lines 61..81
internal/model/modelmock/user_provider.go on lines 162..182

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

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

func (_m *UserProvider) FindOneByID(_a0 context.Context, _a1 int64) (*model.UserEntity, error) {
    ret := _m.Called(_a0, _a1)

    var r0 *model.UserEntity
    if rf, ok := ret.Get(0).(func(context.Context, int64) *model.UserEntity); ok {
Severity: Major
Found in internal/model/modelmock/user_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/refresh_token_provider.go on lines 61..81
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

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

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

func (_m *PermissionProvider) FindOneByID(ctx context.Context, id int64) (*model.PermissionEntity, error) {
    ret := _m.Called(ctx, id)

    var r0 *model.PermissionEntity
    if rf, ok := ret.Get(0).(func(context.Context, int64) *model.PermissionEntity); ok {
Severity: Major
Found in internal/model/modelmock/permission_provider.go and 4 other locations - About 3 hrs to fix
internal/model/modelmock/group_provider.go on lines 107..127
internal/model/modelmock/refresh_token_provider.go on lines 61..81
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

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

func (_m *GroupProvider) FindOneByID(_a0 context.Context, _a1 int64) (*model.GroupEntity, error) {
    ret := _m.Called(_a0, _a1)

    var r0 *model.GroupEntity
    if rf, ok := ret.Get(0).(func(context.Context, int64) *model.GroupEntity); ok {
Severity: Major
Found in internal/model/modelmock/group_provider.go and 4 other locations - About 3 hrs to fix
internal/model/modelmock/permission_provider.go on lines 85..105
internal/model/modelmock/refresh_token_provider.go on lines 61..81
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

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

func (_m *GroupProvider) IsGranted(_a0 context.Context, _a1 int64, _a2 charon.Permission) (bool, error) {
    ret := _m.Called(_a0, _a1, _a2)

    var r0 bool
    if rf, ok := ret.Get(0).(func(context.Context, int64, charon.Permission) bool); ok {
Severity: Major
Found in internal/model/modelmock/group_provider.go and 1 other location - About 3 hrs to fix
internal/model/modelmock/user_provider.go on lines 231..249

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

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 *UserProvider) IsGranted(ctx context.Context, id int64, permission charon.Permission) (bool, error) {
    ret := _m.Called(ctx, id, permission)

    var r0 bool
    if rf, ok := ret.Get(0).(func(context.Context, int64, charon.Permission) bool); ok {
Severity: Major
Found in internal/model/modelmock/user_provider.go and 1 other location - About 3 hrs to fix
internal/model/modelmock/group_provider.go on lines 153..171

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

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 *UserProvider) RegistrationConfirmation(ctx context.Context, id int64, confirmationToken string) (int64, error) {
    ret := _m.Called(ctx, id, confirmationToken)

    var r0 int64
    if rf, ok := ret.Get(0).(func(context.Context, int64, string) int64); ok {
Severity: Major
Found in internal/model/modelmock/user_provider.go and 1 other location - About 2 hrs to fix
internal/model/modelmock/user_groups_provider.go on lines 36..54

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

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 *UserGroupsProvider) Exists(ctx context.Context, userID int64, groupID int64) (bool, error) {
    ret := _m.Called(ctx, userID, groupID)

    var r0 bool
    if rf, ok := ret.Get(0).(func(context.Context, int64, int64) bool); ok {
Severity: Major
Found in internal/model/modelmock/user_groups_provider.go and 1 other location - About 2 hrs to fix
internal/model/modelmock/user_provider.go on lines 252..270

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

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

func (_m *GroupProvider) DeleteOneByID(_a0 context.Context, _a1 int64) (int64, error) {
    ret := _m.Called(_a0, _a1)

    var r0 int64
    if rf, ok := ret.Get(0).(func(context.Context, int64) int64); ok {
Severity: Major
Found in internal/model/modelmock/group_provider.go and 5 other locations - About 2 hrs to fix
internal/model/modelmock/user_groups_provider.go on lines 15..33
internal/model/modelmock/user_permissions_provider.go on lines 15..33
internal/model/modelmock/user_provider.go on lines 97..115
internal/model/modelmock/user_provider.go on lines 118..136
internal/model/modelmock/user_provider.go on lines 308..326

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

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

func (_m *UserProvider) UpdateLastLoginAt(ctx context.Context, id int64) (int64, error) {
    ret := _m.Called(ctx, id)

    var r0 int64
    if rf, ok := ret.Get(0).(func(context.Context, int64) int64); ok {
Severity: Major
Found in internal/model/modelmock/user_provider.go and 5 other locations - About 2 hrs to fix
internal/model/modelmock/group_provider.go on lines 40..58
internal/model/modelmock/user_groups_provider.go on lines 15..33
internal/model/modelmock/user_permissions_provider.go on lines 15..33
internal/model/modelmock/user_provider.go on lines 97..115
internal/model/modelmock/user_provider.go on lines 118..136

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

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

func (_m *UserProvider) DeleteOneByID(_a0 context.Context, _a1 int64) (int64, error) {
    ret := _m.Called(_a0, _a1)

    var r0 int64
    if rf, ok := ret.Get(0).(func(context.Context, int64) int64); ok {
Severity: Major
Found in internal/model/modelmock/user_provider.go and 5 other locations - About 2 hrs to fix
internal/model/modelmock/group_provider.go on lines 40..58
internal/model/modelmock/user_groups_provider.go on lines 15..33
internal/model/modelmock/user_permissions_provider.go on lines 15..33
internal/model/modelmock/user_provider.go on lines 118..136
internal/model/modelmock/user_provider.go on lines 308..326

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

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

func (_m *UserGroupsProvider) DeleteByUserID(ctx context.Context, id int64) (int64, error) {
    ret := _m.Called(ctx, id)

    var r0 int64
    if rf, ok := ret.Get(0).(func(context.Context, int64) int64); ok {
Severity: Major
Found in internal/model/modelmock/user_groups_provider.go and 5 other locations - About 2 hrs to fix
internal/model/modelmock/group_provider.go on lines 40..58
internal/model/modelmock/user_permissions_provider.go on lines 15..33
internal/model/modelmock/user_provider.go on lines 97..115
internal/model/modelmock/user_provider.go on lines 118..136
internal/model/modelmock/user_provider.go on lines 308..326

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

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