opcotech/elemo

View on GitHub

Showing 170 of 170 total issues

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

func (i *IssueRelation) Validate() error {
    if err := validate.Struct(i); err != nil {
        return errors.Join(ErrInvalidIssueRelationDetails, err)
    }
    if err := i.ID.Validate(); err != nil {
Severity: Major
Found in internal/model/issue.go and 1 other location - About 1 hr to fix
internal/model/assignment.go on lines 61..75

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

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 (a *Assignment) Validate() error {
    if err := validate.Struct(a); err != nil {
        return errors.Join(ErrInvalidAssignmentDetails, err)
    }
    if err := a.ID.Validate(); err != nil {
Severity: Major
Found in internal/model/assignment.go and 1 other location - About 1 hr to fix
internal/model/issue.go on lines 272..286

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

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 (r *CachedUserRepository) Delete(ctx context.Context, id model.ID) error {
    if err := clearUsersKey(ctx, r.cacheRepo, id); err != nil {
        return err
    }

Severity: Major
Found in internal/repository/redis/user.go and 1 other location - About 1 hr to fix
internal/repository/redis/document.go on lines 170..188

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

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 (r *CachedDocumentRepository) Delete(ctx context.Context, id model.ID) error {
    if err := clearDocumentsKey(ctx, r.cacheRepo, id); err != nil {
        return err
    }

Severity: Major
Found in internal/repository/redis/document.go and 1 other location - About 1 hr to fix
internal/repository/redis/user.go on lines 160..178

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

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

        asynq.RedisClientOpt{
            Addr:         s.conf.Broker.Address(),
            Username:     s.conf.Broker.Username,
            Password:     s.conf.Broker.Password,
            DB:           s.conf.Broker.Database,
Severity: Major
Found in internal/queue/scheduler.go and 2 other locations - About 1 hr to fix
internal/queue/client.go on lines 137..146
internal/transport/async/worker.go on lines 128..137

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

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

type SystemController interface {
    V1SystemHealth(ctx context.Context, request api.V1SystemHealthRequestObject) (api.V1SystemHealthResponseObject, error)
    V1SystemHeartbeat(ctx context.Context, request api.V1SystemHeartbeatRequestObject) (api.V1SystemHeartbeatResponseObject, error)
    V1SystemVersion(ctx context.Context, request api.V1SystemVersionRequestObject) (api.V1SystemVersionResponseObject, error)
    V1SystemLicense(ctx context.Context, request api.V1SystemLicenseRequestObject) (api.V1SystemLicenseResponseObject, error)
Severity: Major
Found in internal/transport/http/system.go and 1 other location - About 1 hr to fix
internal/transport/http/notification.go on lines 15..20

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

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

        asynq.RedisClientOpt{
            Addr:         w.conf.Broker.Address(),
            Username:     w.conf.Broker.Username,
            Password:     w.conf.Broker.Password,
            DB:           w.conf.Broker.Database,
Severity: Major
Found in internal/transport/async/worker.go and 2 other locations - About 1 hr to fix
internal/queue/client.go on lines 137..146
internal/queue/scheduler.go on lines 114..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 170.

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

    brokerOpts := asynq.RedisClientOpt{
        Addr:         c.conf.Broker.Address(),
        Username:     c.conf.Broker.Username,
        Password:     c.conf.Broker.Password,
        DB:           c.conf.Broker.Database,
Severity: Major
Found in internal/queue/client.go and 2 other locations - About 1 hr to fix
internal/queue/scheduler.go on lines 114..123
internal/transport/async/worker.go on lines 128..137

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

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

type NotificationController interface {
    V1NotificationGet(ctx context.Context, request api.V1NotificationGetRequestObject) (api.V1NotificationGetResponseObject, error)
    V1NotificationsGet(ctx context.Context, request api.V1NotificationsGetRequestObject) (api.V1NotificationsGetResponseObject, error)
    V1NotificationUpdate(ctx context.Context, request api.V1NotificationUpdateRequestObject) (api.V1NotificationUpdateResponseObject, error)
    V1NotificationDelete(ctx context.Context, request api.V1NotificationDeleteRequestObject) (api.V1NotificationDeleteResponseObject, error)
Severity: Major
Found in internal/transport/http/notification.go and 1 other location - About 1 hr to fix
internal/transport/http/system.go on lines 17..22

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

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 (s *organizationService) Get(ctx context.Context, id model.ID) (*model.Organization, error) {
    ctx, span := s.tracer.Start(ctx, "service.organizationService/Get")
    defer span.End()

    if err := id.Validate(); err != nil {
Severity: Major
Found in internal/service/organization.go and 1 other location - About 1 hr to fix
internal/service/user.go on lines 78..92

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

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 (s *userService) Get(ctx context.Context, id model.ID) (*model.User, error) {
    ctx, span := s.tracer.Start(ctx, "service.userService/Get")
    defer span.End()

    if err := id.Validate(); err != nil {
Severity: Major
Found in internal/service/user.go and 1 other location - About 1 hr to fix
internal/service/organization.go on lines 79..93

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

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 (r *AttachmentRepository) Delete(ctx context.Context, id model.ID) error {
    ctx, span := r.tracer.Start(ctx, "repository.neo4j.AttachmentRepository/Delete")
    defer span.End()

    cypher := `MATCH (a:` + id.Label() + ` {id: $id}) DETACH DELETE a`
Severity: Major
Found in internal/repository/neo4j/attachment.go and 8 other locations - About 1 hr to fix
internal/repository/neo4j/assignment.go on lines 156..170
internal/repository/neo4j/comment.go on lines 164..178
internal/repository/neo4j/document.go on lines 214..228
internal/repository/neo4j/label.go on lines 190..204
internal/repository/neo4j/namespace.go on lines 162..178
internal/repository/neo4j/organization.go on lines 236..250
internal/repository/neo4j/project.go on lines 199..213
internal/repository/neo4j/todo.go on lines 185..199

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

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 (r *ProjectRepository) Delete(ctx context.Context, id model.ID) error {
    ctx, span := r.tracer.Start(ctx, "repository.neo4j.ProjectRepository/Delete")
    defer span.End()

    cypher := `MATCH (p:` + id.Label() + ` {id: $id}) DETACH DELETE p`
Severity: Major
Found in internal/repository/neo4j/project.go and 8 other locations - About 1 hr to fix
internal/repository/neo4j/assignment.go on lines 156..170
internal/repository/neo4j/attachment.go on lines 164..178
internal/repository/neo4j/comment.go on lines 164..178
internal/repository/neo4j/document.go on lines 214..228
internal/repository/neo4j/label.go on lines 190..204
internal/repository/neo4j/namespace.go on lines 162..178
internal/repository/neo4j/organization.go on lines 236..250
internal/repository/neo4j/todo.go on lines 185..199

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

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 (r *DocumentRepository) Delete(ctx context.Context, id model.ID) error {
    ctx, span := r.tracer.Start(ctx, "repository.neo4j.DocumentRepository/Delete")
    defer span.End()

    cypher := `MATCH (d:` + id.Label() + ` {id: $id}) DETACH DELETE d`
Severity: Major
Found in internal/repository/neo4j/document.go and 8 other locations - About 1 hr to fix
internal/repository/neo4j/assignment.go on lines 156..170
internal/repository/neo4j/attachment.go on lines 164..178
internal/repository/neo4j/comment.go on lines 164..178
internal/repository/neo4j/label.go on lines 190..204
internal/repository/neo4j/namespace.go on lines 162..178
internal/repository/neo4j/organization.go on lines 236..250
internal/repository/neo4j/project.go on lines 199..213
internal/repository/neo4j/todo.go on lines 185..199

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

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 (r *AssignmentRepository) Delete(ctx context.Context, id model.ID) error {
    ctx, span := r.tracer.Start(ctx, "repository.neo4j.AssignmentRepository/Delete")
    defer span.End()

    cypher := `MATCH (u)-[a:` + EdgeKindAssignedTo.String() + ` {id: $id}]->(r) DELETE a`
Severity: Major
Found in internal/repository/neo4j/assignment.go and 8 other locations - About 1 hr to fix
internal/repository/neo4j/attachment.go on lines 164..178
internal/repository/neo4j/comment.go on lines 164..178
internal/repository/neo4j/document.go on lines 214..228
internal/repository/neo4j/label.go on lines 190..204
internal/repository/neo4j/namespace.go on lines 162..178
internal/repository/neo4j/organization.go on lines 236..250
internal/repository/neo4j/project.go on lines 199..213
internal/repository/neo4j/todo.go on lines 185..199

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

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 (r *TodoRepository) Delete(ctx context.Context, id model.ID) error {
    ctx, span := r.tracer.Start(ctx, "repository.neo4j.TodoRepository/Delete")
    defer span.End()

    cypher := `MATCH (t:` + id.Label() + ` {id: $id}) DETACH DELETE t`
Severity: Major
Found in internal/repository/neo4j/todo.go and 8 other locations - About 1 hr to fix
internal/repository/neo4j/assignment.go on lines 156..170
internal/repository/neo4j/attachment.go on lines 164..178
internal/repository/neo4j/comment.go on lines 164..178
internal/repository/neo4j/document.go on lines 214..228
internal/repository/neo4j/label.go on lines 190..204
internal/repository/neo4j/namespace.go on lines 162..178
internal/repository/neo4j/organization.go on lines 236..250
internal/repository/neo4j/project.go on lines 199..213

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

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 (r *CommentRepository) Delete(ctx context.Context, id model.ID) error {
    ctx, span := r.tracer.Start(ctx, "repository.neo4j.CommentRepository/Delete")
    defer span.End()

    cypher := `MATCH (d:` + id.Label() + ` {id: $id}) DETACH DELETE d`
Severity: Major
Found in internal/repository/neo4j/comment.go and 8 other locations - About 1 hr to fix
internal/repository/neo4j/assignment.go on lines 156..170
internal/repository/neo4j/attachment.go on lines 164..178
internal/repository/neo4j/document.go on lines 214..228
internal/repository/neo4j/label.go on lines 190..204
internal/repository/neo4j/namespace.go on lines 162..178
internal/repository/neo4j/organization.go on lines 236..250
internal/repository/neo4j/project.go on lines 199..213
internal/repository/neo4j/todo.go on lines 185..199

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

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 (r *NamespaceRepository) Delete(ctx context.Context, id model.ID) error {
    ctx, span := r.tracer.Start(ctx, "repository.neo4j.NamespaceRepository/Delete")
    defer span.End()

    cypher := `
Severity: Major
Found in internal/repository/neo4j/namespace.go and 8 other locations - About 1 hr to fix
internal/repository/neo4j/assignment.go on lines 156..170
internal/repository/neo4j/attachment.go on lines 164..178
internal/repository/neo4j/comment.go on lines 164..178
internal/repository/neo4j/document.go on lines 214..228
internal/repository/neo4j/label.go on lines 190..204
internal/repository/neo4j/organization.go on lines 236..250
internal/repository/neo4j/project.go on lines 199..213
internal/repository/neo4j/todo.go on lines 185..199

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

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 (r *OrganizationRepository) Delete(ctx context.Context, id model.ID) error {
    ctx, span := r.tracer.Start(ctx, "repository.neo4j.OrganizationRepository/Delete")
    defer span.End()

    cypher := `MATCH (o:` + id.Label() + ` {id: $id}), (o)-[r]-() DETACH DELETE o, r`
Severity: Major
Found in internal/repository/neo4j/organization.go and 8 other locations - About 1 hr to fix
internal/repository/neo4j/assignment.go on lines 156..170
internal/repository/neo4j/attachment.go on lines 164..178
internal/repository/neo4j/comment.go on lines 164..178
internal/repository/neo4j/document.go on lines 214..228
internal/repository/neo4j/label.go on lines 190..204
internal/repository/neo4j/namespace.go on lines 162..178
internal/repository/neo4j/project.go on lines 199..213
internal/repository/neo4j/todo.go on lines 185..199

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

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 (r *LabelRepository) Delete(ctx context.Context, id model.ID) error {
    ctx, span := r.tracer.Start(ctx, "repository.neo4j.LabelRepository/Delete")
    defer span.End()

    cypher := `MATCH (l:` + id.Label() + ` {id: $id}) DETACH DELETE l`
Severity: Major
Found in internal/repository/neo4j/label.go and 8 other locations - About 1 hr to fix
internal/repository/neo4j/assignment.go on lines 156..170
internal/repository/neo4j/attachment.go on lines 164..178
internal/repository/neo4j/comment.go on lines 164..178
internal/repository/neo4j/document.go on lines 214..228
internal/repository/neo4j/namespace.go on lines 162..178
internal/repository/neo4j/organization.go on lines 236..250
internal/repository/neo4j/project.go on lines 199..213
internal/repository/neo4j/todo.go on lines 185..199

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

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