NullVoxPopuli/emberclear

View on GitHub

Showing 16 of 41 total issues

Function onData has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  @action
  @waitFor
  async onData(data: EncryptedMessage) {
    if (isDestroyed(this)) return;

Severity: Minor
Found in client/web/pinochle/app/game/networking/host.ts - About 1 hr to fix

    Function onData has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

      @action
      @waitFor
      async onData(data: EncryptedMessage) {
        if (isDestroyed(this)) return;
    
    
    Severity: Minor
    Found in client/web/pinochle/app/game/networking/host.ts - About 1 hr 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 onData has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      @action
      @waitFor
      async onData(data: EncryptedMessage) {
        if (isDestroyed(this)) return;
    
    
    Severity: Minor
    Found in client/web/pinochle/app/game/networking/guest.ts - About 1 hr to fix

      Function isKeyMatchingVoteDiff has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        private isKeyMatchingVoteDiff(vote: VoteChain): boolean {
          if (!vote.previousVoteChain) {
            return this.isProperMoveBase(vote);
          }
      
      
      Severity: Minor
      Found in client/web/emberclear/app/services/channels/vote-verifier.ts - About 1 hr to fix

        Function getPoints has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function getPoints(num: number) {
          let viewportWidth = window.innerWidth;
          let left = 0;
          let right = viewportWidth;
          let bottom = window.innerHeight;
        Severity: Minor
        Found in client/web/pinochle/app/components/hand/-animation/key-frames.ts - About 1 hr to fix

          Function stack has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            @action
            stack() {
              let cards = this.element.querySelectorAll('.playing-card');
          
              let { path } = getPoints(cards.length);
          Severity: Minor
          Found in client/web/pinochle/app/modifiers/stack.ts - About 1 hr to fix

            Function markReadTask has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

              @task({ withTestWaiter: true })
              async markReadTask() {
                let attempts = 0;
            
                while (attempts < 100) {
            Severity: Minor
            Found in client/web/emberclear/app/modifiers/read-watcher.ts - About 35 mins 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

            Avoid too many return statements within this function.
            Open

                    return;
            Severity: Major
            Found in client/web/pinochle/app/game/networking/guest.ts - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return;
              Severity: Major
              Found in client/web/pinochle/app/game/networking/guest.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return;
                Severity: Major
                Found in client/web/pinochle/app/game/networking/host.ts - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return;
                  Severity: Major
                  Found in client/web/pinochle/app/game/networking/host.ts - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return;
                    Severity: Major
                    Found in client/web/pinochle/app/game/networking/guest.ts - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return;
                      Severity: Major
                      Found in client/web/pinochle/app/game/networking/guest.ts - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                  return;
                        Severity: Major
                        Found in client/web/pinochle/app/game/networking/host.ts - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return;
                          Severity: Major
                          Found in client/web/pinochle/app/game/networking/guest.ts - About 30 mins to fix

                            Function isValidChain has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                              async isValidChain(channel: ChannelContextChain): Promise<boolean> {
                                let isFirstContextChain: boolean = !channel.previousChain && !channel.supportingVote;
                            
                                if (isFirstContextChain) {
                                  return this.isValidSingleChain(channel);
                            Severity: Minor
                            Found in client/web/emberclear/app/services/channels/channel-verifier.ts - About 25 mins 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

                            Severity
                            Category
                            Status
                            Source
                            Language