Showing 28 of 64 total issues
File service.twirp.go
has 1073 lines of code (exceeds 500 allowed). Consider refactoring. Open
Open
// Code generated by protoc-gen-twirp v8.1.3, DO NOT EDIT.
// source: v1/service.proto
package v1
Function Run
has 81 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func Run(cnf *config.Server) *cobra.Command {
command := cobra.Command{
Use: "run",
Short: "run the server",
Long: "Start listening required protocols.",
Method greeterServiceServer.serveSignJSON
has 71 lines of code (exceeds 50 allowed). Consider refactoring. Open
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 {
Method greeterServiceServer.serveHelloJSON
has 71 lines of code (exceeds 50 allowed). Consider refactoring. Open
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 {
Function file_v1_service_proto_init
has 71 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func file_v1_service_proto_init() {
if File_v1_service_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
Method greeterServiceServer.serveSignProtobuf
has 68 lines of code (exceeds 50 allowed). Consider refactoring. Open
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 {
Method greeterServiceServer.serveHelloProtobuf
has 68 lines of code (exceeds 50 allowed). Consider refactoring. Open
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 {
Method greeterServiceServer.serveHelloProtobuf
has 11 return statements (exceeds 4 allowed). Open
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 {
Function doProtobufRequest
has 11 return statements (exceeds 4 allowed). Open
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")
}
Method greeterServiceServer.serveSignProtobuf
has 11 return statements (exceeds 4 allowed). Open
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 {
Function doJSONRequest
has 11 return statements (exceeds 4 allowed). Open
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")
Method greeterServiceServer.serveSignJSON
has 11 return statements (exceeds 4 allowed). Open
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 {
Method greeterServiceServer.serveHelloJSON
has 11 return statements (exceeds 4 allowed). Open
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 {
Method greeterServiceServer.ServeHTTP
has 7 return statements (exceeds 4 allowed). Open
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)
Method greeterServiceProtobufClient.Hello
has 6 return statements (exceeds 4 allowed). Open
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
Method greeterServiceJSONClient.Sign
has 6 return statements (exceeds 4 allowed). Open
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
Method greeterServiceProtobufClient.Sign
has 6 return statements (exceeds 4 allowed). Open
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
Method greeterServiceJSONClient.Hello
has 6 return statements (exceeds 4 allowed). Open
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
Function local_request_GreeterService_Sign_0
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
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) {
Function doJSONRequest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func doJSONRequest(ctx context.Context, client HTTPClient, hooks *twirp.ClientHooks, url string, in, out proto.Message) (_ context.Context, err error) {