peake100/rogerRabbit-go

View on GitHub

Showing 18 of 18 total issues

ChannelMiddlewares has 46 methods (exceeds 20 allowed). Consider refactoring.
Open

type ChannelMiddlewares struct {
    // TRANSPORT METHOD HANDLERS
    // -------------------------

    // transportClose is the handler invoked when transportManager.Close is called.
Severity: Minor
Found in pkg/amqp/configChannelMiddleware.go - About 6 hrs to fix

    Method ChannelMiddlewares.innerAddProviderMethods has 165 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func (config *ChannelMiddlewares) innerAddProviderMethods(
        provider amqpmiddleware.ProvidesMiddleware,
    ) (methodsFound bool) {
        if hasMethods, ok := provider.(amqpmiddleware.ProvidesClose); ok {
            config.AddClose(hasMethods.Close)
    Severity: Major
    Found in pkg/amqp/configChannelMiddleware.go - About 5 hrs to fix

      Channel has 36 methods (exceeds 20 allowed). Consider refactoring.
      Open

      type Channel struct {
          // underlyingChannel is the the transport object that contains our current underlying
          // connection.
          // The current, underlying channel object.
          underlyingChannel *BasicChannel
      Severity: Minor
      Found in pkg/amqp/channel.go - About 4 hrs to fix

        LoggingMiddlewareChannel has 34 methods (exceeds 20 allowed). Consider refactoring.
        Open

        type LoggingMiddlewareChannel struct {
            loggingMiddlewareCore
        }
        Severity: Minor
        Found in pkg/amqp/defaultmiddlewares/logging.go - About 4 hrs to fix

          File logging.go has 595 lines of code (exceeds 500 allowed). Consider refactoring.
          Open

          package defaultmiddlewares
          
          import (
              "context"
              "github.com/peake100/rogerRabbit-go/pkg/amqp/amqpmiddleware"
          Severity: Minor
          Found in pkg/amqp/defaultmiddlewares/logging.go - About 4 hrs to fix

            Method ChannelMiddlewares.innerAddProviderMethods has a Cognitive Complexity of 41 (exceeds 20 allowed). Consider refactoring.
            Open

            func (config *ChannelMiddlewares) innerAddProviderMethods(
                provider amqpmiddleware.ProvidesMiddleware,
            ) (methodsFound bool) {
                if hasMethods, ok := provider.(amqpmiddleware.ProvidesClose); ok {
                    config.AddClose(hasMethods.Close)
            Severity: Minor
            Found in pkg/amqp/configChannelMiddleware.go - About 3 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

            channelHandlerBuilder has 30 methods (exceeds 20 allowed). Consider refactoring.
            Open

            type channelHandlerBuilder struct {
                connection *Connection
                channel    *Channel
            
                middlewares ChannelMiddlewares
            Severity: Minor
            Found in pkg/amqp/channelHandlersBuilder.go - About 3 hrs to fix

              RouteDeclarationMiddleware has 21 methods (exceeds 20 allowed). Consider refactoring.
              Open

              type RouteDeclarationMiddleware struct {
                  // declareQueues is a map queues that must be declared upon re-establishing the
                  // channel. We use a map so we can remove queues from this list on queue delete.
                  declareQueues *sync.Map
                  // declareExchanges us a map of exchanges that must be declared upon re-establishing
              Severity: Minor
              Found in pkg/amqp/defaultmiddlewares/routeDeclaration.go - About 2 hrs to fix

                Function newConnection has 56 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                func newConnection(url string, config Config) (*Connection, error) {
                    // Extract our config into a streadway.Config
                    streadwayConfig := streadway.Config{
                        SASL:            config.SASL,
                        Vhost:           config.Vhost,
                Severity: Minor
                Found in pkg/amqp/connection.go - About 1 hr to fix

                  Method Producer.Publish has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      ctx context.Context,
                      exchange string,
                      key string,
                      mandatory bool,
                      immediate bool,
                  Severity: Minor
                  Found in pkg/roger/rproducer/producer.go - About 45 mins to fix

                    Method AmqpSuite.publishMessagesConfirm has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        ctx context.Context,
                        t *testing.T,
                        count int,
                        confirmations <-chan amqp.Confirmation,
                        returns <-chan amqp.Return,
                    Severity: Minor
                    Found in pkg/amqptest/testSuite.go - About 45 mins to fix

                      Method Producer.QueueForPublication has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          ctx context.Context,
                          exchange string,
                          key string,
                          mandatory bool,
                          immediate bool,
                      Severity: Minor
                      Found in pkg/roger/rproducer/producer.go - About 45 mins to fix

                        Method Producer.queueOrder has 6 return statements (exceeds 4 allowed).
                        Open

                        func (producer *Producer) queueOrder(order *Publication) error {
                            // We are going to use a closure to grab and release the lock so we don't hold onto
                            // it longer than we have to.
                            err := func() error {
                                // Put a read hold on closing the order channel so it isn't closed out from
                        Severity: Major
                        Found in pkg/roger/rproducer/producer.go - About 40 mins to fix

                          Method RouteDeclarationMiddleware.reconnectHandler has 6 return statements (exceeds 4 allowed).
                          Open

                          func (middleware *RouteDeclarationMiddleware) reconnectHandler(
                              ctx context.Context,
                              args amqpmiddleware.ArgsChannelReconnect,
                              next amqpmiddleware.HandlerChannelReconnect,
                          ) (amqpmiddleware.ResultsChannelReconnect, error) {
                          Severity: Major
                          Found in pkg/amqp/defaultmiddlewares/routeDeclaration.go - About 40 mins to fix

                            Method loggingMiddlewareCore.logMethod has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                ctx context.Context,
                                methodLogger zerolog.Logger,
                                args interface{},
                                results interface{},
                                err error,
                            Severity: Minor
                            Found in pkg/amqp/defaultmiddlewares/logging.go - About 35 mins to fix

                              Method Channel.Publish has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  exchange string,
                                  key string,
                                  mandatory bool,
                                  immediate bool,
                                  msg Publishing,
                              Severity: Minor
                              Found in pkg/amqp/channel.go - About 35 mins to fix

                                Method DefaultLogging.logDeliveryResult has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    delivery amqp.Delivery,
                                    requeue bool,
                                    err error,
                                    start time.Time,
                                    logger zerolog.Logger,
                                Severity: Minor
                                Found in pkg/roger/rconsumer/middleware/defaultmiddlewares.go - About 35 mins to fix

                                  Method AmqpSuite.createSingleTestQueue has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      name string,
                                      exchange string,
                                      exchangeKey string,
                                      cleanup bool,
                                      channel *amqp.Channel,
                                  Severity: Minor
                                  Found in pkg/amqptest/testSuite.go - About 35 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language