mesg-foundation/core

View on GitHub

Showing 113 of 208 total issues

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

func GetTxCmd(cdc *codec.Codec) *cobra.Command {
    executionTxCmd := &cobra.Command{
        Use:                        types.ModuleName,
        Short:                      fmt.Sprintf("%s transactions subcommands", strings.Title(types.ModuleName)),
        DisableFlagParsing:         true,
Severity: Major
Found in x/execution/client/cli/tx.go and 2 other locations - About 1 hr to fix
x/process/client/cli/tx.go on lines 21..36
x/runner/client/cli/tx.go on lines 21..36

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

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

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

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

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

Refactorings

Further Reading

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

func GetTxCmd(cdc *codec.Codec) *cobra.Command {
    processTxCmd := &cobra.Command{
        Use:                        types.ModuleName,
        Short:                      fmt.Sprintf("%s transactions subcommands", strings.Title(types.ModuleName)),
        DisableFlagParsing:         true,
Severity: Major
Found in x/process/client/cli/tx.go and 2 other locations - About 1 hr to fix
x/execution/client/cli/tx.go on lines 20..34
x/runner/client/cli/tx.go on lines 21..36

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

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

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

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

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

Refactorings

Further Reading

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

func GetTxCmd(cdc *codec.Codec) *cobra.Command {
    runnerTxCmd := &cobra.Command{
        Use:                        types.ModuleName,
        Short:                      fmt.Sprintf("%s transactions subcommands", strings.Title(types.ModuleName)),
        DisableFlagParsing:         true,
Severity: Major
Found in x/runner/client/cli/tx.go and 2 other locations - About 1 hr to fix
x/execution/client/cli/tx.go on lines 20..34
x/process/client/cli/tx.go on lines 21..36

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

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

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

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

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

Refactorings

Further Reading

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

func GetQueryCmd(queryRoute string, cdc *codec.Codec) *cobra.Command {
    // Group credit queries under a subcommand
    creditQueryCmd := &cobra.Command{
        Use:                        types.ModuleName,
        Short:                      fmt.Sprintf("Query commands for the %s module", types.ModuleName),
Severity: Major
Found in x/credit/client/cli/query.go and 2 other locations - About 1 hr to fix
x/execution/client/cli/query.go on lines 16..34
x/instance/client/cli/query.go on lines 16..34

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

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

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

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

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

Refactorings

Further Reading

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

func GetQueryCmd(queryRoute string, cdc *codec.Codec) *cobra.Command {
    // Group instance queries under a subcommand
    instanceQueryCmd := &cobra.Command{
        Use:                        types.ModuleName,
        Short:                      fmt.Sprintf("Query commands for the %s module", types.ModuleName),
Severity: Major
Found in x/instance/client/cli/query.go and 2 other locations - About 1 hr to fix
x/credit/client/cli/query.go on lines 15..33
x/execution/client/cli/query.go on lines 16..34

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

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

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

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

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

Refactorings

Further Reading

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

func GetQueryCmd(queryRoute string, cdc *codec.Codec) *cobra.Command {
    // Group execution queries under a subcommand
    executionQueryCmd := &cobra.Command{
        Use:                        types.ModuleName,
        Short:                      fmt.Sprintf("Query commands for the %s module", types.ModuleName),
Severity: Major
Found in x/execution/client/cli/query.go and 2 other locations - About 1 hr to fix
x/credit/client/cli/query.go on lines 15..33
x/instance/client/cli/query.go on lines 16..34

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

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

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

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

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

Refactorings

Further Reading

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

func GetTxCmd(cdc *codec.Codec) *cobra.Command {
    ownershipTxCmd := &cobra.Command{
        Use:                        types.ModuleName,
        Short:                      fmt.Sprintf("%s transactions subcommands", strings.Title(types.ModuleName)),
        DisableFlagParsing:         true,
Severity: Major
Found in x/ownership/client/cli/tx.go and 2 other locations - About 1 hr to fix
x/credit/client/cli/tx.go on lines 20..33
x/service/client/cli/tx.go on lines 20..34

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

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

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

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

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

Refactorings

Further Reading

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

func GetTxCmd(cdc *codec.Codec) *cobra.Command {
    serviceTxCmd := &cobra.Command{
        Use:                        types.ModuleName,
        Short:                      fmt.Sprintf("%s transactions subcommands", strings.Title(types.ModuleName)),
        DisableFlagParsing:         true,
Severity: Major
Found in x/service/client/cli/tx.go and 2 other locations - About 1 hr to fix
x/credit/client/cli/tx.go on lines 20..33
x/ownership/client/cli/tx.go on lines 21..34

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

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

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

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

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

Refactorings

Further Reading

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

func GetTxCmd(cdc *codec.Codec) *cobra.Command {
    creditTxCmd := &cobra.Command{
        Use:                        types.ModuleName,
        Short:                      fmt.Sprintf("%s transactions subcommands", strings.Title(types.ModuleName)),
        DisableFlagParsing:         true,
Severity: Major
Found in x/credit/client/cli/tx.go and 2 other locations - About 1 hr to fix
x/ownership/client/cli/tx.go on lines 21..34
x/service/client/cli/tx.go on lines 20..34

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

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

        event := sdk.NewEvent(
            types.EventType,
            sdk.NewAttribute(sdk.AttributeKeyAction, types.AttributeActionCreated),
            sdk.NewAttribute(types.AttributeKeyHash, exec.Hash.String()),
            sdk.NewAttribute(types.AttributeKeyAddress, exec.Address.String()),
Severity: Major
Found in x/execution/internal/keeper/keeper.go and 1 other location - About 1 hr to fix
x/execution/internal/keeper/keeper.go on lines 153..160

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

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

            event := sdk.NewEvent(
                types.EventType,
                sdk.NewAttribute(sdk.AttributeKeyAction, types.AttributeActionProposed),
                sdk.NewAttribute(types.AttributeKeyHash, exec.Hash.String()),
                sdk.NewAttribute(types.AttributeKeyAddress, exec.Address.String()),
Severity: Major
Found in x/execution/internal/keeper/keeper.go and 1 other location - About 1 hr to fix
x/execution/internal/keeper/keeper.go on lines 197..204

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

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

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

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

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

Refactorings

Further Reading

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

func (s *Service) RequireTaskInputs(taskKey string, inputs *types.Struct) error {
    t, err := s.GetTask(taskKey)
    if err != nil {
        return err
    }
Severity: Major
Found in service/service.go and 2 other locations - About 50 mins to fix
service/service.go on lines 86..95
service/service.go on lines 98..107

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

func (s *Service) RequireEventData(eventKey string, data *types.Struct) error {
    e, err := s.GetEvent(eventKey)
    if err != nil {
        return err
    }
Severity: Major
Found in service/service.go and 2 other locations - About 50 mins to fix
service/service.go on lines 74..83
service/service.go on lines 86..95

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

func (s *Service) RequireTaskOutputs(taskKey string, outputs *types.Struct) error {
    t, err := s.GetTask(taskKey)
    if err != nil {
        return err
    }
Severity: Major
Found in service/service.go and 2 other locations - About 50 mins to fix
service/service.go on lines 74..83
service/service.go on lines 98..107

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

    ctx.EventManager().EmitEvent(
        sdk.NewEvent(
            types.EventType,
            sdk.NewAttribute(sdk.AttributeKeyAction, types.AttributeActionCreated),
            sdk.NewAttribute(types.AttributeKeyHash, r.Hash.String()),
Severity: Minor
Found in x/runner/internal/keeper/keeper.go and 1 other location - About 50 mins to fix
x/runner/internal/keeper/keeper.go on lines 103..111

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

    ctx.EventManager().EmitEvent(
        sdk.NewEvent(
            types.EventType,
            sdk.NewAttribute(sdk.AttributeKeyAction, types.AttributeActionDeleted),
            sdk.NewAttribute(types.AttributeKeyHash, r.Hash.String()),
Severity: Minor
Found in x/runner/internal/keeper/keeper.go and 1 other location - About 50 mins to fix
x/runner/internal/keeper/keeper.go on lines 69..77

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

    validate.RegisterTranslation("deccoins", trans, func(ut ut.Translator) error {
        return ut.Add("deccoins", "{0} must be a valid deccoins", false)
    }, func(ut ut.Translator, fe validator.FieldError) string {
        t, _ := ut.T(fe.Tag(), fe.Field(), prefix)
        return t
Severity: Major
Found in ext/xvalidator/validator.go and 11 other locations - About 45 mins to fix
ext/xvalidator/validator.go on lines 49..54
ext/xvalidator/validator.go on lines 57..62
ext/xvalidator/validator.go on lines 65..70
ext/xvalidator/validator.go on lines 73..78
ext/xvalidator/validator.go on lines 81..86
ext/xvalidator/validator.go on lines 89..94
ext/xvalidator/validator.go on lines 97..102
ext/xvalidator/validator.go on lines 105..110
ext/xvalidator/validator.go on lines 121..126
ext/xvalidator/validator.go on lines 129..134
ext/xvalidator/validator.go on lines 137..142

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

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

    validate.RegisterTranslation("bigint", trans, func(ut ut.Translator) error {
        return ut.Add("bigint", "{0} must be a valid big int", false)
    }, func(ut ut.Translator, fe validator.FieldError) string {
        t, _ := ut.T(fe.Tag(), fe.Field(), prefix)
        return t
Severity: Major
Found in ext/xvalidator/validator.go and 11 other locations - About 45 mins to fix
ext/xvalidator/validator.go on lines 49..54
ext/xvalidator/validator.go on lines 57..62
ext/xvalidator/validator.go on lines 65..70
ext/xvalidator/validator.go on lines 73..78
ext/xvalidator/validator.go on lines 81..86
ext/xvalidator/validator.go on lines 89..94
ext/xvalidator/validator.go on lines 97..102
ext/xvalidator/validator.go on lines 105..110
ext/xvalidator/validator.go on lines 113..118
ext/xvalidator/validator.go on lines 121..126
ext/xvalidator/validator.go on lines 129..134

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

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

    validate.RegisterTranslation("coin", trans, func(ut ut.Translator) error {
        return ut.Add("coin", "{0} must be a valid coin", false)
    }, func(ut ut.Translator, fe validator.FieldError) string {
        t, _ := ut.T(fe.Tag(), fe.Field(), prefix)
        return t
Severity: Major
Found in ext/xvalidator/validator.go and 11 other locations - About 45 mins to fix
ext/xvalidator/validator.go on lines 49..54
ext/xvalidator/validator.go on lines 57..62
ext/xvalidator/validator.go on lines 65..70
ext/xvalidator/validator.go on lines 73..78
ext/xvalidator/validator.go on lines 81..86
ext/xvalidator/validator.go on lines 89..94
ext/xvalidator/validator.go on lines 105..110
ext/xvalidator/validator.go on lines 113..118
ext/xvalidator/validator.go on lines 121..126
ext/xvalidator/validator.go on lines 129..134
ext/xvalidator/validator.go on lines 137..142

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

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

    validate.RegisterTranslation("domain", trans, func(ut ut.Translator) error {
        return ut.Add("domain", "{0} must respect domain-style notation (eg: author.name)", false)
    }, func(ut ut.Translator, fe validator.FieldError) string {
        t, _ := ut.T(fe.Tag(), fe.Field(), prefix)
        return t
Severity: Major
Found in ext/xvalidator/validator.go and 11 other locations - About 45 mins to fix
ext/xvalidator/validator.go on lines 49..54
ext/xvalidator/validator.go on lines 57..62
ext/xvalidator/validator.go on lines 73..78
ext/xvalidator/validator.go on lines 81..86
ext/xvalidator/validator.go on lines 89..94
ext/xvalidator/validator.go on lines 97..102
ext/xvalidator/validator.go on lines 105..110
ext/xvalidator/validator.go on lines 113..118
ext/xvalidator/validator.go on lines 121..126
ext/xvalidator/validator.go on lines 129..134
ext/xvalidator/validator.go on lines 137..142

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

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