octomation/go-service

View on GitHub

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

    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) 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) 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 2 locations. Consider refactoring.
    Open

    package main
    
    import (
        "context"
        "fmt"
    Severity: Major
    Found in cmd/client/main.go and 1 other location - About 6 hrs to fix
    cmd/server/main.go on lines 1..64

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

    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

    package main
    
    import (
        "context"
        "fmt"
    Severity: Major
    Found in cmd/server/main.go and 1 other location - About 6 hrs to fix
    cmd/client/main.go on lines 1..64

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

    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

        mux.Handle("GET", pattern_GreeterService_Sign_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
            ctx, cancel := context.WithCancel(req.Context())
            defer cancel()
            var stream runtime.ServerTransportStream
            ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
    Severity: Major
    Found in api/rpc/v1/service.pb.gw.go and 1 other location - About 4 hrs to fix
    api/rpc/v1/service.pb.gw.go on lines 92..115

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

    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

        mux.Handle("POST", pattern_GreeterService_Hello_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
            ctx, cancel := context.WithCancel(req.Context())
            defer cancel()
            var stream runtime.ServerTransportStream
            ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
    Severity: Major
    Found in api/rpc/v1/service.pb.gw.go and 1 other location - About 4 hrs to fix
    api/rpc/v1/service.pb.gw.go on lines 117..140

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

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

        mux.Handle("GET", pattern_GreeterService_Sign_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
            ctx, cancel := context.WithCancel(req.Context())
            defer cancel()
            inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
            var err error
    Severity: Major
    Found in api/rpc/v1/service.pb.gw.go and 1 other location - About 2 hrs to fix
    api/rpc/v1/service.pb.gw.go on lines 183..203

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

    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

        mux.Handle("POST", pattern_GreeterService_Hello_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
            ctx, cancel := context.WithCancel(req.Context())
            defer cancel()
            inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
            var err error
    Severity: Major
    Found in api/rpc/v1/service.pb.gw.go and 1 other location - About 2 hrs to fix
    api/rpc/v1/service.pb.gw.go on lines 205..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 240.

    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 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 _GreeterService_Sign_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
        in := new(SignRequest)
        if err := dec(in); err != nil {
            return nil, err
        }
    Severity: Major
    Found in api/rpc/v1/service_grpc.pb.go and 1 other location - About 2 hrs to fix
    api/rpc/v1/service_grpc.pb.go on lines 93..109

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

    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