Showing 7 of 24 total issues
ActorContext
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
Open
type ActorContext struct {
mock.Mock
}
Function TestMakeTx
has 135 lines of code (exceeds 70 allowed). Consider refactoring. Open
Open
func TestMakeTx(t *testing.T) {
Convey("Given a tx handler actor", t, func() {
txHandler := NewTxHandler(
WithMnemonicMust(mnemonic),
WithChainID(chainID),
Function NewStartCommand
has 84 lines of code (exceeds 70 allowed). Consider refactoring. Open
Open
func NewStartCommand() *cobra.Command {
var addr string
var batchWindow time.Duration
var metrics bool
var health bool
Method resolver.CheckRecaptcha
has 8 return statements (exceeds 4 allowed). Open
Open
func (c resolver) CheckRecaptcha(ctx ctx.Context, response *string) error {
if !c.enable {
return nil
}
Function BootstrapActors
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
chainID string,
privKey crypto.PrivKey,
sendAmount types.Coins,
grpcAddress string,
tls credentials.TransportCredentials,
Method TxHandler.SignTx
has 5 return statements (exceeds 4 allowed). Open
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,
Method TxHandler.Receive
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
Open
func (handler *TxHandler) Receive(ctx actor.Context) {
switch msg := ctx.Message().(type) {
case *actor.Started:
handler.cosmosClient = ctx.Spawn(handler.cosmosClientProps)
- Read upRead up
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"