nuts-foundation/nuts-node

View on GitHub

Showing 46 of 178 total issues

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

func (s redisSessionStore) Get(key string, target interface{}) error {
    result, err := s.client.Get(context.Background(), s.toRedisKey(key)).Result()
    if err != nil {
        if errors.Is(redis.Nil, err) {
            return ErrNotFound
Severity: Minor
Found in storage/session_redis.go and 1 other location - About 1 hr to fix
storage/session_redis.go on lines 102..112

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

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

            if types := strings.Split(args[1], ","); len(types) != 1 {
                if err := request.Type.FromIssueVCRequestType1(types); err != nil {
                    return fmt.Errorf("invalid credential type: %w", err)
                }
            } else {
Severity: Minor
Found in vcr/cmd/cmd.go and 1 other location - About 50 mins to fix
vcr/cmd/cmd.go on lines 172..180

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

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

                if contexts := strings.Split(args[0], ","); len(contexts) != 1 {
                    if err := request.Context.FromIssueVCRequestContext1(contexts); err != nil {
                        return fmt.Errorf("invalid @context: %w", err)
                    }
                } else {
Severity: Minor
Found in vcr/cmd/cmd.go and 1 other location - About 50 mins to fix
vcr/cmd/cmd.go on lines 183..191

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

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 (c *vcr) Trust(credentialType ssi.URI, issuer ssi.URI) error {
    err := c.trustConfig.AddTrust(credentialType, issuer)
    if err != nil {
        log.Logger().
            WithField(core.LogFieldCredentialType, credentialType).
Severity: Minor
Found in vcr/vcr.go and 1 other location - About 50 mins to fix
vcr/vcr.go on lines 449..458

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

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 (c *vcr) Untrust(credentialType ssi.URI, issuer ssi.URI) error {
    err := c.trustConfig.RemoveTrust(credentialType, issuer)
    if err != nil {
        log.Logger().
            WithField(core.LogFieldCredentialType, credentialType).
Severity: Minor
Found in vcr/vcr.go and 1 other location - About 50 mins to fix
vcr/vcr.go on lines 438..447

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

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 (hb HTTPClient) Untrust(credentialType string, issuer string) error {
    ctx := context.Background()

    body := UntrustIssuerJSONRequestBody{
        CredentialType: credentialType,
Severity: Minor
Found in vcr/api/vcr/v2/client.go and 1 other location - About 50 mins to fix
vcr/api/vcr/v2/client.go on lines 48..62

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

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 (hb HTTPClient) Trust(credentialType string, issuer string) error {
    ctx := context.Background()

    body := TrustIssuerJSONRequestBody{
        CredentialType: credentialType,
Severity: Minor
Found in vcr/api/vcr/v2/client.go and 1 other location - About 50 mins to fix
vcr/api/vcr/v2/client.go on lines 65..79

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

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

func keyAgreementSort(result *did.Document) less {
    return func(i, j int) bool {
        is := result.KeyAgreement[i].ID.String()
        js := result.KeyAgreement[j].ID.String()
        return strings.Compare(is, js) == -1
Severity: Major
Found in vdr/didnuts/didstore/merge.go and 6 other locations - About 45 mins to fix
vdr/didnuts/didstore/merge.go on lines 155..161
vdr/didnuts/didstore/merge.go on lines 171..177
vdr/didnuts/didstore/merge.go on lines 179..185
vdr/didnuts/didstore/merge.go on lines 187..193
vdr/didnuts/didstore/merge.go on lines 195..201
vdr/didnuts/didstore/merge.go on lines 203..209

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 115.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

func assertionSort(result *did.Document) less {
    return func(i, j int) bool {
        is := result.AssertionMethod[i].ID.String()
        js := result.AssertionMethod[j].ID.String()
        return strings.Compare(is, js) == -1
Severity: Major
Found in vdr/didnuts/didstore/merge.go and 6 other locations - About 45 mins to fix
vdr/didnuts/didstore/merge.go on lines 155..161
vdr/didnuts/didstore/merge.go on lines 163..169
vdr/didnuts/didstore/merge.go on lines 179..185
vdr/didnuts/didstore/merge.go on lines 187..193
vdr/didnuts/didstore/merge.go on lines 195..201
vdr/didnuts/didstore/merge.go on lines 203..209

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 115.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

func verificationMethodSort(result *did.Document) less {
    return func(i, j int) bool {
        is := result.VerificationMethod[i].ID.String()
        js := result.VerificationMethod[j].ID.String()
        return strings.Compare(is, js) == -1
Severity: Major
Found in vdr/didnuts/didstore/merge.go and 6 other locations - About 45 mins to fix
vdr/didnuts/didstore/merge.go on lines 163..169
vdr/didnuts/didstore/merge.go on lines 171..177
vdr/didnuts/didstore/merge.go on lines 179..185
vdr/didnuts/didstore/merge.go on lines 187..193
vdr/didnuts/didstore/merge.go on lines 195..201
vdr/didnuts/didstore/merge.go on lines 203..209

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 115.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

func capabilityInvocationSort(result *did.Document) less {
    return func(i, j int) bool {
        is := result.CapabilityInvocation[i].ID.String()
        js := result.CapabilityInvocation[j].ID.String()
        return strings.Compare(is, js) == -1
Severity: Major
Found in vdr/didnuts/didstore/merge.go and 6 other locations - About 45 mins to fix
vdr/didnuts/didstore/merge.go on lines 155..161
vdr/didnuts/didstore/merge.go on lines 163..169
vdr/didnuts/didstore/merge.go on lines 171..177
vdr/didnuts/didstore/merge.go on lines 179..185
vdr/didnuts/didstore/merge.go on lines 195..201
vdr/didnuts/didstore/merge.go on lines 203..209

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 115.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

func authenticationSort(result *did.Document) less {
    return func(i, j int) bool {
        is := result.Authentication[i].ID.String()
        js := result.Authentication[j].ID.String()
        return strings.Compare(is, js) == -1
Severity: Major
Found in vdr/didnuts/didstore/merge.go and 6 other locations - About 45 mins to fix
vdr/didnuts/didstore/merge.go on lines 155..161
vdr/didnuts/didstore/merge.go on lines 163..169
vdr/didnuts/didstore/merge.go on lines 171..177
vdr/didnuts/didstore/merge.go on lines 187..193
vdr/didnuts/didstore/merge.go on lines 195..201
vdr/didnuts/didstore/merge.go on lines 203..209

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 115.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

func serviceSort(result *did.Document) less {
    return func(i, j int) bool {
        is := result.Service[i].ID.String()
        js := result.Service[j].ID.String()
        return strings.Compare(is, js) == -1
Severity: Major
Found in vdr/didnuts/didstore/merge.go and 6 other locations - About 45 mins to fix
vdr/didnuts/didstore/merge.go on lines 155..161
vdr/didnuts/didstore/merge.go on lines 163..169
vdr/didnuts/didstore/merge.go on lines 171..177
vdr/didnuts/didstore/merge.go on lines 179..185
vdr/didnuts/didstore/merge.go on lines 187..193
vdr/didnuts/didstore/merge.go on lines 195..201

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 115.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

func capabilityDelegationSort(result *did.Document) less {
    return func(i, j int) bool {
        is := result.CapabilityDelegation[i].ID.String()
        js := result.CapabilityDelegation[j].ID.String()
        return strings.Compare(is, js) == -1
Severity: Major
Found in vdr/didnuts/didstore/merge.go and 6 other locations - About 45 mins to fix
vdr/didnuts/didstore/merge.go on lines 155..161
vdr/didnuts/didstore/merge.go on lines 163..169
vdr/didnuts/didstore/merge.go on lines 171..177
vdr/didnuts/didstore/merge.go on lines 179..185
vdr/didnuts/didstore/merge.go on lines 187..193
vdr/didnuts/didstore/merge.go on lines 203..209

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 115.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

func (s *state) IsPresent(ctx context.Context, hash hash.SHA256Hash) (present bool, err error) {
    err = s.db.Read(ctx, func(tx stoabs.ReadTx) error {
        present = s.graph.isPresent(tx, hash)
        return nil
    })
Severity: Minor
Found in network/dag/state.go and 1 other location - About 45 mins to fix
network/dag/state.go on lines 278..284

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 115.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

func (s *state) IsPayloadPresent(ctx context.Context, hash hash.SHA256Hash) (present bool, err error) {
    err = s.db.Read(ctx, func(tx stoabs.ReadTx) error {
        present = s.payloadStore.isPayloadPresent(tx, hash)
        return nil
    })
Severity: Minor
Found in network/dag/state.go and 1 other location - About 45 mins to fix
network/dag/state.go on lines 286..292

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 115.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

                if iParts.Tokenizer != nil {
                    tokenizer := strings.ToLower(*iParts.Tokenizer)
                    switch tokenizer {
                    case "whitespaceorexact":
                        options = append(options, leia.TokenizerOption(whitespaceOrExactTokenizer))
Severity: Minor
Found in vcr/vcr.go and 1 other location - About 40 mins to fix
vcr/vcr.go on lines 354..364

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

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

                if iParts.Transformer != nil {
                    transformer := strings.ToLower(*iParts.Transformer)
                    switch transformer {
                    case "cologne":
                        options = append(options, leia.TransformerOption(CologneTransformer))
Severity: Minor
Found in vcr/vcr.go and 1 other location - About 40 mins to fix
vcr/vcr.go on lines 343..353

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

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 *memorySessionStore) Start(ctx context.Context) {
    done := ctx.Done()

    go func() {
        timer := time.NewTicker(s.expiryInterval)
Severity: Minor
Found in auth/services/selfsigned/store.go and 1 other location - About 40 mins to fix
network/transport/v2/conversation.go on lines 96..110

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

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 (cMan *conversationManager) start(ctx context.Context) {
    done := ctx.Done()

    go func() {
        timer := time.NewTicker(cMan.validity)
Severity: Minor
Found in network/transport/v2/conversation.go and 1 other location - About 40 mins to fix
auth/services/selfsigned/store.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 108.

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