okp4/cosmos-faucet

View on GitHub

Showing 7 of 24 total issues

ActorContext has 31 methods (exceeds 20 allowed). Consider refactoring.
Open

type ActorContext struct {
    mock.Mock
}
Severity: Minor
Found in test/mock/actor_context.go - About 3 hrs to fix

    Function TestMakeTx has 135 lines of code (exceeds 70 allowed). Consider refactoring.
    Open

    func TestMakeTx(t *testing.T) {
        Convey("Given a tx handler actor", t, func() {
            txHandler := NewTxHandler(
                WithMnemonicMust(mnemonic),
                WithChainID(chainID),
    Severity: Major
    Found in pkg/cosmos/tx_test.go - About 3 hrs to fix

      Function NewStartCommand has 84 lines of code (exceeds 70 allowed). Consider refactoring.
      Open

      func NewStartCommand() *cobra.Command {
          var addr string
          var batchWindow time.Duration
          var metrics bool
          var health bool
      Severity: Major
      Found in cmd/start.go - About 1 hr to fix

        Method resolver.CheckRecaptcha has 8 return statements (exceeds 4 allowed).
        Open

        func (c resolver) CheckRecaptcha(ctx ctx.Context, response *string) error {
            if !c.enable {
                return nil
            }
        
        
        Severity: Major
        Found in pkg/captcha/verify.go - About 50 mins to fix

          Function BootstrapActors has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              chainID string,
              privKey crypto.PrivKey,
              sendAmount types.Coins,
              grpcAddress string,
              tls credentials.TransportCredentials,
          Severity: Minor
          Found in pkg/actor/system/bootstrap.go - About 35 mins to fix

            Method TxHandler.SignTx has 5 return statements (exceeds 4 allowed).
            Open

            func (handler *TxHandler) SignTx(txBuilder sdk.TxBuilder, signerData authsigning.SignerData) (authsigning.Tx, error) {
                sig := signing.SignatureV2{
                    PubKey: handler.privKey.PubKey(),
                    Data: &signing.SingleSignatureData{
                        SignMode:  handler.signMode,
            Severity: Major
            Found in pkg/cosmos/tx.go - About 35 mins to fix

              Method TxHandler.Receive has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
              Open

              func (handler *TxHandler) Receive(ctx actor.Context) {
                  switch msg := ctx.Message().(type) {
                  case *actor.Started:
                      handler.cosmosClient = ctx.Spawn(handler.cosmosClientProps)
              
              
              Severity: Minor
              Found in pkg/cosmos/tx.go - About 25 mins 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

              Severity
              Category
              Status
              Source
              Language