okp4/cosmos-faucet

View on GitHub

Showing 24 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

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

      func (_m *ActorContext) Spawn(props *actor.Props) *actor.PID {
          ret := _m.Called(props)
      
          var r0 *actor.PID
          if rf, ok := ret.Get(0).(func(*actor.Props) *actor.PID); ok {
      Severity: Major
      Found in test/mock/actor_context.go and 2 other locations - About 1 hr to fix
      test/mock/actor_context.go on lines 147..160
      test/mock/actor_context.go on lines 330..343

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

      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 (_m *ActorContext) PoisonFuture(pid *actor.PID) *actor.Future {
          ret := _m.Called(pid)
      
          var r0 *actor.Future
          if rf, ok := ret.Get(0).(func(*actor.PID) *actor.Future); ok {
      Severity: Major
      Found in test/mock/actor_context.go and 2 other locations - About 1 hr to fix
      test/mock/actor_context.go on lines 265..278
      test/mock/actor_context.go on lines 330..343

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

      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 (_m *ActorContext) StopFuture(pid *actor.PID) *actor.Future {
          ret := _m.Called(pid)
      
          var r0 *actor.Future
          if rf, ok := ret.Get(0).(func(*actor.PID) *actor.Future); ok {
      Severity: Major
      Found in test/mock/actor_context.go and 2 other locations - About 1 hr to fix
      test/mock/actor_context.go on lines 147..160
      test/mock/actor_context.go on lines 265..278

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

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

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

        func (_m *ActorContext) ActorSystem() *actor.ActorSystem {
            ret := _m.Called()
        
            var r0 *actor.ActorSystem
            if rf, ok := ret.Get(0).(func() *actor.ActorSystem); ok {
        Severity: Major
        Found in test/mock/actor_context.go and 3 other locations - About 1 hr to fix
        test/mock/actor_context.go on lines 126..139
        test/mock/actor_context.go on lines 218..231
        test/mock/actor_context.go on lines 239..252

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

        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

        func (_m *ActorContext) Self() *actor.PID {
            ret := _m.Called()
        
            var r0 *actor.PID
            if rf, ok := ret.Get(0).(func() *actor.PID); ok {
        Severity: Major
        Found in test/mock/actor_context.go and 3 other locations - About 1 hr to fix
        test/mock/actor_context.go on lines 36..49
        test/mock/actor_context.go on lines 126..139
        test/mock/actor_context.go on lines 239..252

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

        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

        func (_m *ActorContext) Sender() *actor.PID {
            ret := _m.Called()
        
            var r0 *actor.PID
            if rf, ok := ret.Get(0).(func() *actor.PID); ok {
        Severity: Major
        Found in test/mock/actor_context.go and 3 other locations - About 1 hr to fix
        test/mock/actor_context.go on lines 36..49
        test/mock/actor_context.go on lines 126..139
        test/mock/actor_context.go on lines 218..231

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

        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

        func (_m *ActorContext) Parent() *actor.PID {
            ret := _m.Called()
        
            var r0 *actor.PID
            if rf, ok := ret.Get(0).(func() *actor.PID); ok {
        Severity: Major
        Found in test/mock/actor_context.go and 3 other locations - About 1 hr to fix
        test/mock/actor_context.go on lines 36..49
        test/mock/actor_context.go on lines 218..231
        test/mock/actor_context.go on lines 239..252

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

        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 (_m *ActorContext) MessageHeader() actor.ReadonlyMessageHeader {
            ret := _m.Called()
        
            var r0 actor.ReadonlyMessageHeader
            if rf, ok := ret.Get(0).(func() actor.ReadonlyMessageHeader); ok {
        Severity: Major
        Found in test/mock/actor_context.go and 1 other location - About 1 hr to fix
        test/mock/actor_context.go on lines 20..33

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

        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 (_m *ActorContext) Actor() actor.Actor {
            ret := _m.Called()
        
            var r0 actor.Actor
            if rf, ok := ret.Get(0).(func() actor.Actor); ok {
        Severity: Major
        Found in test/mock/actor_context.go and 1 other location - About 1 hr to fix
        test/mock/actor_context.go on lines 110..123

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

        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

                Convey("When receiving a Started message", func() {
                    mockedContext := &mock.ActorContext{}
                    mockedContext.On("Message").Return(&actor.Started{})
                    mockedContext.On("Spawn", Anything).Return(&actor.PID{})
                    txHandler.Receive(mockedContext)
        Severity: Major
        Found in pkg/cosmos/tx_test.go and 1 other location - About 1 hr to fix
        pkg/faucet/faucet_test.go on lines 49..60

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

        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

                Convey("When receiving a Started message", func() {
                    mockedContext := &mock.ActorContext{}
                    mockedContext.On("Message").Return(&actor.Started{})
                    mockedContext.On("Spawn", Anything).Return(&actor.PID{})
                    faucet.Receive(mockedContext)
        Severity: Major
        Found in pkg/faucet/faucet_test.go and 1 other location - About 1 hr to fix
        pkg/cosmos/tx_test.go on lines 208..219

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

        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

                        Convey("When receiving the message", func() {
                            mockedContext.On("Message").Return(msg)
        
                            Convey("Then it should crash", func() {
                                So(func() { txHandler.Receive(mockedContext) }, ShouldPanic)
        Severity: Major
        Found in pkg/cosmos/tx_test.go and 1 other location - About 1 hr to fix
        pkg/cosmos/tx_test.go on lines 276..285

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

        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

                        Convey("When receiving the message", func() {
                            mockedContext.On("Message").Return(msg)
        
                            Convey("Then it should crash", func() {
                                So(func() { txHandler.Receive(mockedContext) }, ShouldPanic)
        Severity: Major
        Found in pkg/cosmos/tx_test.go and 1 other location - About 1 hr to fix
        pkg/cosmos/tx_test.go on lines 310..319

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

        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

        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

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

                if rf, ok := ret.Get(0).(func(*actor.Props, string) *actor.PID); ok {
                    r0 = rf(props, prefix)
                } else {
                    if ret.Get(0) != nil {
                        r0 = ret.Get(0).(*actor.PID)
            Severity: Minor
            Found in test/mock/actor_context.go and 1 other location - About 35 mins to fix
            test/mock/actor_context.go on lines 285..291

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

            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 rf, ok := ret.Get(0).(func(*actor.Props, string) *actor.PID); ok {
                    r0 = rf(props, id)
                } else {
                    if ret.Get(0) != nil {
                        r0 = ret.Get(0).(*actor.PID)
            Severity: Minor
            Found in test/mock/actor_context.go and 1 other location - About 35 mins to fix
            test/mock/actor_context.go on lines 308..314

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

            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