mesg-foundation/core

View on GitHub

Showing 207 of 208 total issues

Method NewApp.prepForZeroHeightGenesis has 83 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (app *NewApp) prepForZeroHeightGenesis(ctx sdk.Context, jailWhiteList []string) {
    applyWhiteList := false

    //Check if there is a whitelist
    if len(jailWhiteList) > 0 {
Severity: Major
Found in app/export.go - About 2 hrs to fix

    Function AddGenesisAccountCmd has a Cognitive Complexity of 32 (exceeds 20 allowed). Consider refactoring.
    Open

    func AddGenesisAccountCmd(
        ctx *server.Context, cdc *codec.Codec, defaultNodeHome, defaultClientHome string,
    ) *cobra.Command {
        cmd := &cobra.Command{
            Use:   "add-genesis-account [address_or_key_name] [coin][,[coin]]",
    Severity: Minor
    Found in cmd/mesg-daemon/genaccounts.go - About 2 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method Orchestrator.startExecutionStream has a Cognitive Complexity of 32 (exceeds 20 allowed). Consider refactoring.
    Open

    func (s *Orchestrator) startExecutionStream(ctx context.Context) error {
        subscriber := xstrings.RandASCIILetters(8)
        query := fmt.Sprintf("%s.%s EXISTS AND %s.%s='%s'",
            executionmodule.EventType, executionmodule.AttributeKeyHash,
            executionmodule.EventType, sdk.AttributeKeyAction, executionmodule.AttributeActionCompleted,
    Severity: Minor
    Found in orchestrator/orchestrator.go - About 2 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

    func queryGetHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
        return func(w http.ResponseWriter, r *http.Request) {
            vars := mux.Vars(r)
    
            cliCtx, ok := rest.ParseQueryHeightOrReturnBadRequest(w, cliCtx, r)
    Severity: Major
    Found in x/execution/client/rest/query.go and 8 other locations - About 2 hrs to fix
    x/credit/client/rest/query.go on lines 25..45
    x/instance/client/rest/query.go on lines 25..45
    x/process/client/rest/query.go on lines 38..58
    x/process/client/rest/query.go on lines 115..135
    x/runner/client/rest/query.go on lines 39..59
    x/runner/client/rest/query.go on lines 137..157
    x/service/client/rest/query.go on lines 38..58
    x/service/client/rest/query.go on lines 132..152

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

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

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

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

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

    Refactorings

    Further Reading

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

    func queryGetHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
        return func(w http.ResponseWriter, r *http.Request) {
            vars := mux.Vars(r)
    
            cliCtx, ok := rest.ParseQueryHeightOrReturnBadRequest(w, cliCtx, r)
    Severity: Major
    Found in x/instance/client/rest/query.go and 8 other locations - About 2 hrs to fix
    x/credit/client/rest/query.go on lines 25..45
    x/execution/client/rest/query.go on lines 30..50
    x/process/client/rest/query.go on lines 38..58
    x/process/client/rest/query.go on lines 115..135
    x/runner/client/rest/query.go on lines 39..59
    x/runner/client/rest/query.go on lines 137..157
    x/service/client/rest/query.go on lines 38..58
    x/service/client/rest/query.go on lines 132..152

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

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

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

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

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

    Refactorings

    Further Reading

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

    func queryGetHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
        return func(w http.ResponseWriter, r *http.Request) {
            vars := mux.Vars(r)
    
            cliCtx, ok := rest.ParseQueryHeightOrReturnBadRequest(w, cliCtx, r)
    Severity: Major
    Found in x/runner/client/rest/query.go and 8 other locations - About 2 hrs to fix
    x/credit/client/rest/query.go on lines 25..45
    x/execution/client/rest/query.go on lines 30..50
    x/instance/client/rest/query.go on lines 25..45
    x/process/client/rest/query.go on lines 38..58
    x/process/client/rest/query.go on lines 115..135
    x/runner/client/rest/query.go on lines 137..157
    x/service/client/rest/query.go on lines 38..58
    x/service/client/rest/query.go on lines 132..152

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

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

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

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

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

    Refactorings

    Further Reading

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

    func queryExistHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
        return func(w http.ResponseWriter, r *http.Request) {
            vars := mux.Vars(r)
    
            cliCtx, ok := rest.ParseQueryHeightOrReturnBadRequest(w, cliCtx, r)
    Severity: Major
    Found in x/service/client/rest/query.go and 8 other locations - About 2 hrs to fix
    x/credit/client/rest/query.go on lines 25..45
    x/execution/client/rest/query.go on lines 30..50
    x/instance/client/rest/query.go on lines 25..45
    x/process/client/rest/query.go on lines 38..58
    x/process/client/rest/query.go on lines 115..135
    x/runner/client/rest/query.go on lines 39..59
    x/runner/client/rest/query.go on lines 137..157
    x/service/client/rest/query.go on lines 38..58

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

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

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

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

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

    Refactorings

    Further Reading

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

    func queryGetHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
        return func(w http.ResponseWriter, r *http.Request) {
            vars := mux.Vars(r)
    
            cliCtx, ok := rest.ParseQueryHeightOrReturnBadRequest(w, cliCtx, r)
    Severity: Major
    Found in x/process/client/rest/query.go and 8 other locations - About 2 hrs to fix
    x/credit/client/rest/query.go on lines 25..45
    x/execution/client/rest/query.go on lines 30..50
    x/instance/client/rest/query.go on lines 25..45
    x/process/client/rest/query.go on lines 115..135
    x/runner/client/rest/query.go on lines 39..59
    x/runner/client/rest/query.go on lines 137..157
    x/service/client/rest/query.go on lines 38..58
    x/service/client/rest/query.go on lines 132..152

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

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

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

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

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

    Refactorings

    Further Reading

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

    func queryExistHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
        return func(w http.ResponseWriter, r *http.Request) {
            vars := mux.Vars(r)
    
            cliCtx, ok := rest.ParseQueryHeightOrReturnBadRequest(w, cliCtx, r)
    Severity: Major
    Found in x/process/client/rest/query.go and 8 other locations - About 2 hrs to fix
    x/credit/client/rest/query.go on lines 25..45
    x/execution/client/rest/query.go on lines 30..50
    x/instance/client/rest/query.go on lines 25..45
    x/process/client/rest/query.go on lines 38..58
    x/runner/client/rest/query.go on lines 39..59
    x/runner/client/rest/query.go on lines 137..157
    x/service/client/rest/query.go on lines 38..58
    x/service/client/rest/query.go on lines 132..152

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

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

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

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

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

    Refactorings

    Further Reading

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

    func queryGetHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
        return func(w http.ResponseWriter, r *http.Request) {
            vars := mux.Vars(r)
    
            cliCtx, ok := rest.ParseQueryHeightOrReturnBadRequest(w, cliCtx, r)
    Severity: Major
    Found in x/service/client/rest/query.go and 8 other locations - About 2 hrs to fix
    x/credit/client/rest/query.go on lines 25..45
    x/execution/client/rest/query.go on lines 30..50
    x/instance/client/rest/query.go on lines 25..45
    x/process/client/rest/query.go on lines 38..58
    x/process/client/rest/query.go on lines 115..135
    x/runner/client/rest/query.go on lines 39..59
    x/runner/client/rest/query.go on lines 137..157
    x/service/client/rest/query.go on lines 132..152

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

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

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

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

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

    Refactorings

    Further Reading

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

    func queryGetHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
        return func(w http.ResponseWriter, r *http.Request) {
            vars := mux.Vars(r)
    
            cliCtx, ok := rest.ParseQueryHeightOrReturnBadRequest(w, cliCtx, r)
    Severity: Major
    Found in x/credit/client/rest/query.go and 8 other locations - About 2 hrs to fix
    x/execution/client/rest/query.go on lines 30..50
    x/instance/client/rest/query.go on lines 25..45
    x/process/client/rest/query.go on lines 38..58
    x/process/client/rest/query.go on lines 115..135
    x/runner/client/rest/query.go on lines 39..59
    x/runner/client/rest/query.go on lines 137..157
    x/service/client/rest/query.go on lines 38..58
    x/service/client/rest/query.go on lines 132..152

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

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

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

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

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

    Refactorings

    Further Reading

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

    func queryExistHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
        return func(w http.ResponseWriter, r *http.Request) {
            vars := mux.Vars(r)
    
            cliCtx, ok := rest.ParseQueryHeightOrReturnBadRequest(w, cliCtx, r)
    Severity: Major
    Found in x/runner/client/rest/query.go and 8 other locations - About 2 hrs to fix
    x/credit/client/rest/query.go on lines 25..45
    x/execution/client/rest/query.go on lines 30..50
    x/instance/client/rest/query.go on lines 25..45
    x/process/client/rest/query.go on lines 38..58
    x/process/client/rest/query.go on lines 115..135
    x/runner/client/rest/query.go on lines 39..59
    x/service/client/rest/query.go on lines 38..58
    x/service/client/rest/query.go on lines 132..152

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

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

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

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

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

    Refactorings

    Further Reading

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

    package process
    
    import (
        sdk "github.com/cosmos/cosmos-sdk/types"
        "github.com/mesg-foundation/engine/x/process/internal/types"
    Severity: Major
    Found in x/process/genesis.go and 4 other locations - About 2 hrs to fix
    x/instance/genesis.go on lines 1..25
    x/ownership/genesis.go on lines 1..25
    x/runner/genesis.go on lines 1..25
    x/service/genesis.go on lines 1..25

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

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

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

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

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

    Refactorings

    Further Reading

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

    package instance
    
    import (
        sdk "github.com/cosmos/cosmos-sdk/types"
        "github.com/mesg-foundation/engine/x/instance/internal/types"
    Severity: Major
    Found in x/instance/genesis.go and 4 other locations - About 2 hrs to fix
    x/ownership/genesis.go on lines 1..25
    x/process/genesis.go on lines 1..25
    x/runner/genesis.go on lines 1..25
    x/service/genesis.go on lines 1..25

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

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

    package types
    
    import (
        fmt "fmt"
    
    
    Severity: Major
    Found in x/process/internal/types/genesis.go and 3 other locations - About 2 hrs to fix
    x/ownership/internal/types/genesis.go on lines 1..35
    x/runner/internal/types/genesis.go on lines 1..35
    x/service/internal/types/genesis.go on lines 1..35

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 195.

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

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

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

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

    Refactorings

    Further Reading

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

    package runner
    
    import (
        sdk "github.com/cosmos/cosmos-sdk/types"
        "github.com/mesg-foundation/engine/x/runner/internal/types"
    Severity: Major
    Found in x/runner/genesis.go and 4 other locations - About 2 hrs to fix
    x/instance/genesis.go on lines 1..25
    x/ownership/genesis.go on lines 1..25
    x/process/genesis.go on lines 1..25
    x/service/genesis.go on lines 1..25

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

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

    package types
    
    import (
        fmt "fmt"
    
    
    Severity: Major
    Found in x/ownership/internal/types/genesis.go and 3 other locations - About 2 hrs to fix
    x/process/internal/types/genesis.go on lines 1..35
    x/runner/internal/types/genesis.go on lines 1..35
    x/service/internal/types/genesis.go on lines 1..35

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 195.

    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

    Function New has 25 return statements (exceeds 6 allowed).
    Open

    func New(prefix string) (*validator.Validate, ut.Translator) {
        en := en.New()
        uni := ut.New(en, en)
        trans, _ := uni.GetTranslator("en")
        validate := validator.New()
    Severity: Major
    Found in ext/xvalidator/validator.go - About 2 hrs to fix

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

      package service
      
      import (
          sdk "github.com/cosmos/cosmos-sdk/types"
          "github.com/mesg-foundation/engine/x/service/internal/types"
      Severity: Major
      Found in x/service/genesis.go and 4 other locations - About 2 hrs to fix
      x/instance/genesis.go on lines 1..25
      x/ownership/genesis.go on lines 1..25
      x/process/genesis.go on lines 1..25
      x/runner/genesis.go on lines 1..25

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

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

      package types
      
      import (
          fmt "fmt"
      
      
      Severity: Major
      Found in x/runner/internal/types/genesis.go and 3 other locations - About 2 hrs to fix
      x/ownership/internal/types/genesis.go on lines 1..35
      x/process/internal/types/genesis.go on lines 1..35
      x/service/internal/types/genesis.go on lines 1..35

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 195.

      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