xmidt-org/wrp-go

View on GitHub

Showing 73 of 224 total issues

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

func (x *ServiceAlive) CodecEncodeSelf(e *codec1978.Encoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Encoder(e)
    _, _, _ = h, z, r
    if z.EncBasicHandle().CheckCircularRef {
Severity: Major
Found in messages_codec.go and 1 other location - About 7 hrs to fix
messages_codec.go on lines 3210..3257

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

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 (x *Unknown) CodecEncodeSelf(e *codec1978.Encoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Encoder(e)
    _, _, _ = h, z, r
    if z.EncBasicHandle().CheckCircularRef {
Severity: Major
Found in messages_codec.go and 1 other location - About 7 hrs to fix
messages_codec.go on lines 3084..3131

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

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 (x *Unknown) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    var yyj6 int
Severity: Major
Found in messages_codec.go and 1 other location - About 3 hrs to fix
messages_codec.go on lines 3180..3203

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

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 (x *ServiceAlive) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    var yyj6 int
Severity: Major
Found in messages_codec.go and 1 other location - About 3 hrs to fix
messages_codec.go on lines 3306..3329

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

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 (x *ServiceAlive) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    var yyhl3 bool = l >= 0
Severity: Major
Found in messages_codec.go and 1 other location - About 3 hrs to fix
messages_codec.go on lines 3284..3304

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

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 (x *Unknown) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    var yyhl3 bool = l >= 0
Severity: Major
Found in messages_codec.go and 1 other location - About 3 hrs to fix
messages_codec.go on lines 3158..3178

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

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

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

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

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

Refactorings

Further Reading

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

            } else {
                z.EncWriteMapElemKey()
                r.EncodeString(`msg_type`)
                z.EncWriteMapElemValue()
                if yyxt12 := z.Extension(x.Type); yyxt12 != nil {
Severity: Major
Found in messages_codec.go and 1 other location - About 2 hrs to fix
messages_codec.go on lines 2939..2960

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

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 z.EncBasicHandle().Canonical {
                z.EncWriteMapElemKey()
                r.EncodeString(`msg_type`)
                z.EncWriteMapElemValue()
                if yyxt9 := z.Extension(x.Type); yyxt9 != nil {
Severity: Major
Found in messages_codec.go and 1 other location - About 2 hrs to fix
messages_codec.go on lines 2960..2981

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

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 (x *ServiceAlive) CodecDecodeSelf(d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    yyct2 := r.ContainerType()
Severity: Major
Found in messages_codec.go and 6 other locations - About 2 hrs to fix
messages_codec.go on lines 688..711
messages_codec.go on lines 1481..1504
messages_codec.go on lines 2026..2049
messages_codec.go on lines 2649..2672
messages_codec.go on lines 2987..3010
messages_codec.go on lines 3259..3282

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

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 (x *ServiceRegistration) CodecDecodeSelf(d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    yyct2 := r.ContainerType()
Severity: Major
Found in messages_codec.go and 6 other locations - About 2 hrs to fix
messages_codec.go on lines 688..711
messages_codec.go on lines 1481..1504
messages_codec.go on lines 2026..2049
messages_codec.go on lines 2649..2672
messages_codec.go on lines 3133..3156
messages_codec.go on lines 3259..3282

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

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 (x *SimpleRequestResponse) CodecDecodeSelf(d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    yyct2 := r.ContainerType()
Severity: Major
Found in messages_codec.go and 6 other locations - About 2 hrs to fix
messages_codec.go on lines 688..711
messages_codec.go on lines 2026..2049
messages_codec.go on lines 2649..2672
messages_codec.go on lines 2987..3010
messages_codec.go on lines 3133..3156
messages_codec.go on lines 3259..3282

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

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 (x *SimpleEvent) CodecDecodeSelf(d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    yyct2 := r.ContainerType()
Severity: Major
Found in messages_codec.go and 6 other locations - About 2 hrs to fix
messages_codec.go on lines 688..711
messages_codec.go on lines 1481..1504
messages_codec.go on lines 2649..2672
messages_codec.go on lines 2987..3010
messages_codec.go on lines 3133..3156
messages_codec.go on lines 3259..3282

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

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 (x *Message) CodecDecodeSelf(d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    yyct2 := r.ContainerType()
Severity: Major
Found in messages_codec.go and 6 other locations - About 2 hrs to fix
messages_codec.go on lines 1481..1504
messages_codec.go on lines 2026..2049
messages_codec.go on lines 2649..2672
messages_codec.go on lines 2987..3010
messages_codec.go on lines 3133..3156
messages_codec.go on lines 3259..3282

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

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 (x *CRUD) CodecDecodeSelf(d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    yyct2 := r.ContainerType()
Severity: Major
Found in messages_codec.go and 6 other locations - About 2 hrs to fix
messages_codec.go on lines 688..711
messages_codec.go on lines 1481..1504
messages_codec.go on lines 2026..2049
messages_codec.go on lines 2987..3010
messages_codec.go on lines 3133..3156
messages_codec.go on lines 3259..3282

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

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 (x *Unknown) CodecDecodeSelf(d *codec1978.Decoder) {
    var h codecSelfer3232
    z, r := codec1978.GenHelper().Decoder(d)
    _, _, _ = h, z, r
    yyct2 := r.ContainerType()
Severity: Major
Found in messages_codec.go and 6 other locations - About 2 hrs to fix
messages_codec.go on lines 688..711
messages_codec.go on lines 1481..1504
messages_codec.go on lines 2026..2049
messages_codec.go on lines 2649..2672
messages_codec.go on lines 2987..3010
messages_codec.go on lines 3133..3156

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

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 getHeaders(h http.Header) []string {
    headers, ok := h[HeadersHeader]
    if !ok || len(headers) == 0 {
        // Check alternative header version
        headers, ok = h[headersHeader]
Severity: Major
Found in wrphttp/headers.go and 1 other location - About 1 hr to fix
wrphttp/headers.go on lines 169..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 187.

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 getPartnerIDs(h http.Header) []string {
    headers, ok := h[PartnerIdHeader]
    if !ok || len(headers) == 0 {
        // Check alternative header version
        headers, ok = h[partnerIdHeader]
Severity: Major
Found in wrphttp/headers.go and 1 other location - About 1 hr to fix
wrphttp/headers.go on lines 217..239

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

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 ReplaceDestinationSelfLocator(me string) NormifierOption {
    full, err := ParseLocator(me)
    if err != nil {
        return errorOption(err)
    }
Severity: Major
Found in normify.go and 1 other location - About 1 hr to fix
normify.go on lines 99..119

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

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 ReplaceSourceSelfLocator(me string) NormifierOption {
    full, err := ParseLocator(me)
    if err != nil {
        return errorOption(err)
    }
Severity: Major
Found in normify.go and 1 other location - About 1 hr to fix
normify.go on lines 124..144

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

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 NewSimpleEventTypeWithMetric(tf *touchstone.Factory, labelNames ...string) (ValidatorFunc, error) {
    m, err := newSimpleEventTypeErrorTotal(tf, labelNames...)

    return func(msg wrp.Message, ls prometheus.Labels) error {
        err := SimpleEventType(msg)
Severity: Major
Found in wrpvalidator/messageValidator.go and 7 other locations - About 1 hr to fix
wrpvalidator/messageValidator.go on lines 81..92
wrpvalidator/messageValidator.go on lines 109..120
wrpvalidator/specValidator.go on lines 58..69
wrpvalidator/specValidator.go on lines 72..83
wrpvalidator/specValidator.go on lines 86..97
wrpvalidator/specValidator.go on lines 100..111
wrpvalidator/validator.go on lines 178..189

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

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