octomation/go-service

View on GitHub

Showing 28 of 64 total issues

File service.twirp.go has 1073 lines of code (exceeds 500 allowed). Consider refactoring.
Open

// Code generated by protoc-gen-twirp v8.1.3, DO NOT EDIT.
// source: v1/service.proto

package v1

Severity: Major
Found in api/rpc/v1/service.twirp.go - About 1 day to fix

    Function Run has 81 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func Run(cnf *config.Server) *cobra.Command {
        command := cobra.Command{
            Use:   "run",
            Short: "run the server",
            Long:  "Start listening required protocols.",
    Severity: Major
    Found in internal/command/server.go - About 2 hrs to fix

      Method greeterServiceServer.serveSignJSON has 71 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func (s *greeterServiceServer) serveSignJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
          var err error
          ctx = ctxsetters.WithMethodName(ctx, "Sign")
          ctx, err = callRequestRouted(ctx, s.hooks)
          if err != nil {
      Severity: Minor
      Found in api/rpc/v1/service.twirp.go - About 1 hr to fix

        Method greeterServiceServer.serveHelloJSON has 71 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func (s *greeterServiceServer) serveHelloJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
            var err error
            ctx = ctxsetters.WithMethodName(ctx, "Hello")
            ctx, err = callRequestRouted(ctx, s.hooks)
            if err != nil {
        Severity: Minor
        Found in api/rpc/v1/service.twirp.go - About 1 hr to fix

          Function file_v1_service_proto_init has 71 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func file_v1_service_proto_init() {
              if File_v1_service_proto != nil {
                  return
              }
              if !protoimpl.UnsafeEnabled {
          Severity: Minor
          Found in api/rpc/v1/service.pb.go - About 1 hr to fix

            Method greeterServiceServer.serveSignProtobuf has 68 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func (s *greeterServiceServer) serveSignProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
                var err error
                ctx = ctxsetters.WithMethodName(ctx, "Sign")
                ctx, err = callRequestRouted(ctx, s.hooks)
                if err != nil {
            Severity: Minor
            Found in api/rpc/v1/service.twirp.go - About 1 hr to fix

              Method greeterServiceServer.serveHelloProtobuf has 68 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func (s *greeterServiceServer) serveHelloProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
                  var err error
                  ctx = ctxsetters.WithMethodName(ctx, "Hello")
                  ctx, err = callRequestRouted(ctx, s.hooks)
                  if err != nil {
              Severity: Minor
              Found in api/rpc/v1/service.twirp.go - About 1 hr to fix

                Method greeterServiceServer.serveHelloProtobuf has 11 return statements (exceeds 4 allowed).
                Open

                func (s *greeterServiceServer) serveHelloProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
                    var err error
                    ctx = ctxsetters.WithMethodName(ctx, "Hello")
                    ctx, err = callRequestRouted(ctx, s.hooks)
                    if err != nil {
                Severity: Major
                Found in api/rpc/v1/service.twirp.go - About 1 hr to fix

                  Function doProtobufRequest has 11 return statements (exceeds 4 allowed).
                  Open

                  func doProtobufRequest(ctx context.Context, client HTTPClient, hooks *twirp.ClientHooks, url string, in, out proto.Message) (_ context.Context, err error) {
                      reqBodyBytes, err := proto.Marshal(in)
                      if err != nil {
                          return ctx, wrapInternal(err, "failed to marshal proto request")
                      }
                  Severity: Major
                  Found in api/rpc/v1/service.twirp.go - About 1 hr to fix

                    Method greeterServiceServer.serveSignProtobuf has 11 return statements (exceeds 4 allowed).
                    Open

                    func (s *greeterServiceServer) serveSignProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
                        var err error
                        ctx = ctxsetters.WithMethodName(ctx, "Sign")
                        ctx, err = callRequestRouted(ctx, s.hooks)
                        if err != nil {
                    Severity: Major
                    Found in api/rpc/v1/service.twirp.go - About 1 hr to fix

                      Function doJSONRequest has 11 return statements (exceeds 4 allowed).
                      Open

                      func doJSONRequest(ctx context.Context, client HTTPClient, hooks *twirp.ClientHooks, url string, in, out proto.Message) (_ context.Context, err error) {
                          marshaler := &protojson.MarshalOptions{UseProtoNames: true}
                          reqBytes, err := marshaler.Marshal(in)
                          if err != nil {
                              return ctx, wrapInternal(err, "failed to marshal json request")
                      Severity: Major
                      Found in api/rpc/v1/service.twirp.go - About 1 hr to fix

                        Method greeterServiceServer.serveSignJSON has 11 return statements (exceeds 4 allowed).
                        Open

                        func (s *greeterServiceServer) serveSignJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
                            var err error
                            ctx = ctxsetters.WithMethodName(ctx, "Sign")
                            ctx, err = callRequestRouted(ctx, s.hooks)
                            if err != nil {
                        Severity: Major
                        Found in api/rpc/v1/service.twirp.go - About 1 hr to fix

                          Method greeterServiceServer.serveHelloJSON has 11 return statements (exceeds 4 allowed).
                          Open

                          func (s *greeterServiceServer) serveHelloJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
                              var err error
                              ctx = ctxsetters.WithMethodName(ctx, "Hello")
                              ctx, err = callRequestRouted(ctx, s.hooks)
                              if err != nil {
                          Severity: Major
                          Found in api/rpc/v1/service.twirp.go - About 1 hr to fix

                            Method greeterServiceServer.ServeHTTP has 7 return statements (exceeds 4 allowed).
                            Open

                            func (s *greeterServiceServer) ServeHTTP(resp http.ResponseWriter, req *http.Request) {
                                ctx := req.Context()
                                ctx = ctxsetters.WithPackageName(ctx, "api.rpc.v1")
                                ctx = ctxsetters.WithServiceName(ctx, "GreeterService")
                                ctx = ctxsetters.WithResponseWriter(ctx, resp)
                            Severity: Major
                            Found in api/rpc/v1/service.twirp.go - About 45 mins to fix

                              Method greeterServiceProtobufClient.Hello has 6 return statements (exceeds 4 allowed).
                              Open

                              func (c *greeterServiceProtobufClient) Hello(ctx context.Context, in *HelloRequest) (*HelloResponse, error) {
                                  ctx = ctxsetters.WithPackageName(ctx, "api.rpc.v1")
                                  ctx = ctxsetters.WithServiceName(ctx, "GreeterService")
                                  ctx = ctxsetters.WithMethodName(ctx, "Hello")
                                  caller := c.callHello
                              Severity: Major
                              Found in api/rpc/v1/service.twirp.go - About 40 mins to fix

                                Method greeterServiceJSONClient.Sign has 6 return statements (exceeds 4 allowed).
                                Open

                                func (c *greeterServiceJSONClient) Sign(ctx context.Context, in *SignRequest) (*SignResponse, error) {
                                    ctx = ctxsetters.WithPackageName(ctx, "api.rpc.v1")
                                    ctx = ctxsetters.WithServiceName(ctx, "GreeterService")
                                    ctx = ctxsetters.WithMethodName(ctx, "Sign")
                                    caller := c.callSign
                                Severity: Major
                                Found in api/rpc/v1/service.twirp.go - About 40 mins to fix

                                  Method greeterServiceProtobufClient.Sign has 6 return statements (exceeds 4 allowed).
                                  Open

                                  func (c *greeterServiceProtobufClient) Sign(ctx context.Context, in *SignRequest) (*SignResponse, error) {
                                      ctx = ctxsetters.WithPackageName(ctx, "api.rpc.v1")
                                      ctx = ctxsetters.WithServiceName(ctx, "GreeterService")
                                      ctx = ctxsetters.WithMethodName(ctx, "Sign")
                                      caller := c.callSign
                                  Severity: Major
                                  Found in api/rpc/v1/service.twirp.go - About 40 mins to fix

                                    Method greeterServiceJSONClient.Hello has 6 return statements (exceeds 4 allowed).
                                    Open

                                    func (c *greeterServiceJSONClient) Hello(ctx context.Context, in *HelloRequest) (*HelloResponse, error) {
                                        ctx = ctxsetters.WithPackageName(ctx, "api.rpc.v1")
                                        ctx = ctxsetters.WithServiceName(ctx, "GreeterService")
                                        ctx = ctxsetters.WithMethodName(ctx, "Hello")
                                        caller := c.callHello
                                    Severity: Major
                                    Found in api/rpc/v1/service.twirp.go - About 40 mins to fix

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

                                      func local_request_GreeterService_Sign_0(ctx context.Context, marshaler runtime.Marshaler, server GreeterServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
                                      Severity: Minor
                                      Found in api/rpc/v1/service.pb.gw.go - About 35 mins to fix

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

                                        func doJSONRequest(ctx context.Context, client HTTPClient, hooks *twirp.ClientHooks, url string, in, out proto.Message) (_ context.Context, err error) {
                                        Severity: Minor
                                        Found in api/rpc/v1/service.twirp.go - About 35 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language