octomation/go-service

View on GitHub
api/rpc/v1/service.twirp.go

Summary

Maintainability
F
2 wks
Test Coverage

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

    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

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

                                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

                                  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

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

                                    func doProtobufRequest(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

                                      Function errorFromResponse has 5 return statements (exceeds 4 allowed).
                                      Open

                                      func errorFromResponse(resp *http.Response) twirp.Error {
                                          statusCode := resp.StatusCode
                                          statusText := http.StatusText(statusCode)
                                      
                                          if isHTTPRedirect(statusCode) {
                                      Severity: Major
                                      Found in api/rpc/v1/service.twirp.go - About 35 mins to fix

                                        Similar blocks of code found in 2 locations. 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: Major
                                        Found in api/rpc/v1/service.twirp.go and 1 other location - About 1 day to fix
                                        api/rpc/v1/service.twirp.go on lines 447..528

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

                                        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 (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 and 1 other location - About 1 day to fix
                                        api/rpc/v1/service.twirp.go on lines 627..708

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

                                        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 (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 and 1 other location - About 1 day to fix
                                        api/rpc/v1/service.twirp.go on lines 710..787

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

                                        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 (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 and 1 other location - About 1 day to fix
                                        api/rpc/v1/service.twirp.go on lines 530..607

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

                                        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 (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 and 3 other locations - About 4 hrs to fix
                                        api/rpc/v1/service.twirp.go on lines 88..115
                                        api/rpc/v1/service.twirp.go on lines 134..161
                                        api/rpc/v1/service.twirp.go on lines 273..300

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

                                        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 (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 and 3 other locations - About 4 hrs to fix
                                        api/rpc/v1/service.twirp.go on lines 88..115
                                        api/rpc/v1/service.twirp.go on lines 134..161
                                        api/rpc/v1/service.twirp.go on lines 227..254

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

                                        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 (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 and 3 other locations - About 4 hrs to fix
                                        api/rpc/v1/service.twirp.go on lines 134..161
                                        api/rpc/v1/service.twirp.go on lines 227..254
                                        api/rpc/v1/service.twirp.go on lines 273..300

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

                                        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 (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 and 3 other locations - About 4 hrs to fix
                                        api/rpc/v1/service.twirp.go on lines 88..115
                                        api/rpc/v1/service.twirp.go on lines 227..254
                                        api/rpc/v1/service.twirp.go on lines 273..300

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

                                        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 NewGreeterServiceProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) GreeterService {
                                            if c, ok := client.(*http.Client); ok {
                                                client = withoutRedirects(c)
                                            }
                                        
                                        
                                        Severity: Major
                                        Found in api/rpc/v1/service.twirp.go and 1 other location - About 2 hrs to fix
                                        api/rpc/v1/service.twirp.go on lines 193..225

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

                                        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 NewGreeterServiceJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) GreeterService {
                                            if c, ok := client.(*http.Client); ok {
                                                client = withoutRedirects(c)
                                            }
                                        
                                        
                                        Severity: Major
                                        Found in api/rpc/v1/service.twirp.go and 1 other location - About 2 hrs to fix
                                        api/rpc/v1/service.twirp.go on lines 54..86

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

                                        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 (s *greeterServiceServer) serveHello(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
                                            header := req.Header.Get("Content-Type")
                                            i := strings.Index(header, ";")
                                            if i == -1 {
                                                i = len(header)
                                        Severity: Major
                                        Found in api/rpc/v1/service.twirp.go and 1 other location - About 2 hrs to fix
                                        api/rpc/v1/service.twirp.go on lines 609..625

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

                                        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 (s *greeterServiceServer) serveSign(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
                                            header := req.Header.Get("Content-Type")
                                            i := strings.Index(header, ";")
                                            if i == -1 {
                                                i = len(header)
                                        Severity: Major
                                        Found in api/rpc/v1/service.twirp.go and 1 other location - About 2 hrs to fix
                                        api/rpc/v1/service.twirp.go on lines 429..445

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

                                        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 (c *greeterServiceProtobufClient) callHello(ctx context.Context, in *HelloRequest) (*HelloResponse, error) {
                                            out := new(HelloResponse)
                                            ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[0], in, out)
                                            if err != nil {
                                                twerr, ok := err.(twirp.Error)
                                        Severity: Major
                                        Found in api/rpc/v1/service.twirp.go and 3 other locations - About 1 hr to fix
                                        api/rpc/v1/service.twirp.go on lines 163..178
                                        api/rpc/v1/service.twirp.go on lines 256..271
                                        api/rpc/v1/service.twirp.go on lines 302..317

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

                                        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 (c *greeterServiceJSONClient) callSign(ctx context.Context, in *SignRequest) (*SignResponse, error) {
                                            out := new(SignResponse)
                                            ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[1], in, out)
                                            if err != nil {
                                                twerr, ok := err.(twirp.Error)
                                        Severity: Major
                                        Found in api/rpc/v1/service.twirp.go and 3 other locations - About 1 hr to fix
                                        api/rpc/v1/service.twirp.go on lines 117..132
                                        api/rpc/v1/service.twirp.go on lines 163..178
                                        api/rpc/v1/service.twirp.go on lines 256..271

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

                                        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 (c *greeterServiceProtobufClient) callSign(ctx context.Context, in *SignRequest) (*SignResponse, error) {
                                            out := new(SignResponse)
                                            ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[1], in, out)
                                            if err != nil {
                                                twerr, ok := err.(twirp.Error)
                                        Severity: Major
                                        Found in api/rpc/v1/service.twirp.go and 3 other locations - About 1 hr to fix
                                        api/rpc/v1/service.twirp.go on lines 117..132
                                        api/rpc/v1/service.twirp.go on lines 256..271
                                        api/rpc/v1/service.twirp.go on lines 302..317

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

                                        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 (c *greeterServiceJSONClient) callHello(ctx context.Context, in *HelloRequest) (*HelloResponse, error) {
                                            out := new(HelloResponse)
                                            ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[0], in, out)
                                            if err != nil {
                                                twerr, ok := err.(twirp.Error)
                                        Severity: Major
                                        Found in api/rpc/v1/service.twirp.go and 3 other locations - About 1 hr to fix
                                        api/rpc/v1/service.twirp.go on lines 117..132
                                        api/rpc/v1/service.twirp.go on lines 163..178
                                        api/rpc/v1/service.twirp.go on lines 302..317

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

                                        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

                                        There are no issues that match your filters.

                                        Category
                                        Status