LLKennedy/httpgrpc

View on GitHub

Showing 125 of 125 total issues

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

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
//     protoc-gen-go v1.25.0
//     protoc        v3.10.1
// source: service.proto
Severity: Major
Found in internal/testservice/service/service.pb.go - About 1 day to fix

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

    export class ConvertInput extends Object implements tsjson.ProtoJSONCompatible {
        /** A field */
        public rawData?: Uint8Array;
        public ToProtoJSON(): Object {
            return {
    Severity: Major
    Found in internal/testservice/service/service.ts and 2 other locations - About 6 hrs to fix
    internal/testservice/service/service.ts on lines 85..99
    internal/testservice/service/service.ts on lines 208..222

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

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

    export class UploadPhotoRequest extends Object implements tsjson.ProtoJSONCompatible {
        /** A field */
        public data?: Uint8Array;
        public ToProtoJSON(): Object {
            return {
    Severity: Major
    Found in internal/testservice/service/service.ts and 2 other locations - About 6 hrs to fix
    internal/testservice/service/service.ts on lines 85..99
    internal/testservice/service/service.ts on lines 102..116

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

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

    export class BroadcastData extends Object implements tsjson.ProtoJSONCompatible {
        /** A field */
        public rawData?: Uint8Array;
        public ToProtoJSON(): Object {
            return {
    Severity: Major
    Found in internal/testservice/service/service.ts and 2 other locations - About 6 hrs to fix
    internal/testservice/service/service.ts on lines 102..116
    internal/testservice/service/service.ts on lines 208..222

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

    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

    export class BroadcastRequest extends Object implements tsjson.ProtoJSONCompatible {
        /** A field */
        public id?: string;
        public ToProtoJSON(): Object {
            return {
    Severity: Major
    Found in internal/testservice/service/service.ts and 1 other location - About 6 hrs to fix
    internal/testservice/service/service.ts on lines 119..133

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

    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

    export class RandomResponse extends Object implements tsjson.ProtoJSONCompatible {
        /** A field */
        public number?: number;
        public ToProtoJSON(): Object {
            return {
    Severity: Major
    Found in internal/testservice/service/service.ts and 3 other locations - About 6 hrs to fix
    internal/testservice/service/service.ts on lines 51..65
    internal/testservice/service/service.ts on lines 136..150
    internal/testservice/service/service.ts on lines 153..167

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

    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

    export class ConvertOutput extends Object implements tsjson.ProtoJSONCompatible {
        /** A field */
        public convertedData?: string;
        public ToProtoJSON(): Object {
            return {
    Severity: Major
    Found in internal/testservice/service/service.ts and 1 other location - About 6 hrs to fix
    internal/testservice/service/service.ts on lines 68..82

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

    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

    export class FibonacciResponse extends Object implements tsjson.ProtoJSONCompatible {
        /** A field */
        public number?: number;
        public ToProtoJSON(): Object {
            return {
    Severity: Major
    Found in internal/testservice/service/service.ts and 3 other locations - About 6 hrs to fix
    internal/testservice/service/service.ts on lines 51..65
    internal/testservice/service/service.ts on lines 136..150
    internal/testservice/service/service.ts on lines 191..205

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

    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

    export class FibonacciRequest extends Object implements tsjson.ProtoJSONCompatible {
        /** A field */
        public n?: number;
        public ToProtoJSON(): Object {
            return {
    Severity: Major
    Found in internal/testservice/service/service.ts and 3 other locations - About 6 hrs to fix
    internal/testservice/service/service.ts on lines 51..65
    internal/testservice/service/service.ts on lines 153..167
    internal/testservice/service/service.ts on lines 191..205

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

    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

    export class FeedResponse extends Object implements tsjson.ProtoJSONCompatible {
        /** A field */
        public received?: number;
        public ToProtoJSON(): Object {
            return {
    Severity: Major
    Found in internal/testservice/service/service.ts and 3 other locations - About 6 hrs to fix
    internal/testservice/service/service.ts on lines 136..150
    internal/testservice/service/service.ts on lines 153..167
    internal/testservice/service/service.ts on lines 191..205

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

    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

    Function file_service_proto_init has 168 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func file_service_proto_init() {
        if File_service_proto != nil {
            return
        }
        if !protoimpl.UnsafeEnabled {
    Severity: Major
    Found in internal/testservice/service/service.pb.go - About 5 hrs to fix

      File proxy.pb.go has 619 lines of code (exceeds 500 allowed). Consider refactoring.
      Open

      // Code generated by protoc-gen-go. DO NOT EDIT.
      // versions:
      //     protoc-gen-go v1.25.0
      //     protoc        v3.10.1
      // source: proxy.proto
      Severity: Minor
      Found in httpapi/proxy.pb.go - About 4 hrs to fix

        File service_grpc.pb.go has 582 lines of code (exceeds 500 allowed). Consider refactoring.
        Open

        // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
        
        package service
        
        import (
        Severity: Minor
        Found in internal/testservice/service/service_grpc.pb.go - About 4 hrs to fix

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              protected async StartClientStream<ReqT extends ProtoJSONCompatible, ResT = any>(endpoint: string, parseResponse: Parser<ResT>): Promise<ClientStream<ReqT, ResT>> {
                  let url = this.BuildURL(endpoint, true);
                  let ws = new MercuryWebSocket(url, parseResponse);
                  // Establish the connection, set up event listeners, etc.
                  await ws.init();
          Severity: Major
          Found in client/src/client/client.ts and 1 other location - About 3 hrs to fix
          client/src/client/client.ts on lines 59..65

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

          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

              protected async StartDualStream<ReqT extends ProtoJSONCompatible, ResT = any>(endpoint: string, parseResponse: Parser<ResT>): Promise<DualStream<ReqT, ResT>> {
                  let url = this.BuildURL(endpoint, true);
                  let ws = new MercuryWebSocket(url, parseResponse);
                  // Establish the connection, set up event listeners, etc.
                  await ws.init();
          Severity: Major
          Found in client/src/client/client.ts and 1 other location - About 3 hrs to fix
          client/src/client/client.ts on lines 44..50

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

          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

          File websocket.ts has 306 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import { ProtoJSONCompatible, Parser } from "@llkennedy/protoc-gen-tsjson";
          import { IMutex, Mutex } from "../common";
          import * as uuid from "uuid";
          
          export const EOFMessage = "EOF";
          Severity: Minor
          Found in client/src/websocket/websocket.ts - About 3 hrs to fix

            Function file_service_proto_init has a Cognitive Complexity of 38 (exceeds 20 allowed). Consider refactoring.
            Open

            func file_service_proto_init() {
                if File_service_proto != nil {
                    return
                }
                if !protoimpl.UnsafeEnabled {
            Severity: Minor
            Found in internal/testservice/service/service.pb.go - About 3 hrs to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function file_proxy_proto_init has 100 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func file_proxy_proto_init() {
                if File_proxy_proto != nil {
                    return
                }
                if !protoimpl.UnsafeEnabled {
            Severity: Major
            Found in httpapi/proxy.pb.go - About 3 hrs to fix

              Function initConnection has 63 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private async initConnection(): Promise<EstablishedWebsocket<ReqT, ResT>> {
                      if (this.initialised) {
                          throw new Error("cannot initialise MercuryWebSocket twice");
                      }
                      this.initialised = true;
              Severity: Major
              Found in client/src/websocket/websocket.ts - About 2 hrs to fix

                Similar blocks of code found in 6 locations. Consider refactoring.
                Open

                func _App_Fibonacci_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
                    in := new(FibonacciRequest)
                    if err := dec(in); err != nil {
                        return nil, err
                    }
                Severity: Major
                Found in internal/testservice/service/service_grpc.pb.go and 5 other locations - About 2 hrs to fix
                httpapi/proxy_grpc.pb.go on lines 108..124
                internal/testservice/service/service_grpc.pb.go on lines 238..254
                internal/testservice/service/service_grpc.pb.go on lines 256..272
                internal/testservice/service/service_grpc.pb.go on lines 563..579
                internal/testservice/service/service_grpc.pb.go on lines 581..597

                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