fedden/pluribus-poker-AI

View on GitHub

Showing 17 of 21 total issues

Consider simplifying this complex logical expression.
Open

    if all(c_rank == 14 for c_rank in ranks):
        return 0
    elif all(c_rank == 13 for c_rank in ranks):
        return 1
    elif all(c_rank == 12 for c_rank in ranks):
Severity: Critical
Found in poker_ai/clustering/preflop.py - About 2 hrs to fix

    Card has 22 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Card:
        """Card to represent a poker card."""
    
        def __init__(self, rank: Union[str, int], suit: str):
            """Instanciate the card."""
    Severity: Minor
    Found in poker_ai/poker/card.py - About 2 hrs to fix

      Function cssLoaders has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      exports.cssLoaders = function (options) {
        options = options || {}
      
        const cssLoader = {
          loader: 'css-loader',
      Severity: Minor
      Found in applications/visualisation/frontend/build/utils.js - About 1 hr to fix

        Function __init__ has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def __init__(
                self,
                strategy_interval: int,
                n_iterations: int,
                lcfr_threshold: int,
        Severity: Minor
        Found in poker_ai/ai/multiprocess/server.py - About 1 hr to fix

          Avoid deeply nested control flow statements.
          Open

                              if action == "quit":
                                  user_results.add_result(strategy_path, agent, state, og_name_to_name)
                                  log.info(term.pink("quit"))
                                  break
                              elif action == "new game":
          Severity: Major
          Found in poker_ai/terminal/runner.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if selected_action_i < 0:
                                    selected_action_i = len(legal_actions) - 1
                            elif key.name == "KEY_RIGHT":
            Severity: Major
            Found in poker_ai/terminal/runner.py - About 45 mins to fix

              Avoid too many return statements within this function.
              Open

                      return 12 if suited else 22
              Severity: Major
              Found in poker_ai/clustering/preflop.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return 7 if suited else 17
                Severity: Major
                Found in poker_ai/clustering/preflop.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return 9 if suited else 19
                  Severity: Major
                  Found in poker_ai/clustering/preflop.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return 8 if suited else 18
                    Severity: Major
                    Found in poker_ai/clustering/preflop.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return 11 if suited else 21
                      Severity: Major
                      Found in poker_ai/clustering/preflop.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return 13 if suited else 23
                        Severity: Major
                        Found in poker_ai/clustering/preflop.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return 6 if suited else 16
                          Severity: Major
                          Found in poker_ai/clustering/preflop.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                    return 10 if suited else 20
                            Severity: Major
                            Found in poker_ai/clustering/preflop.py - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                      return 14 if suited else 24
                              Severity: Major
                              Found in poker_ai/clustering/preflop.py - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                        return 4
                                Severity: Major
                                Found in poker_ai/clustering/preflop.py - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                          return 5 if suited else 15
                                  Severity: Major
                                  Found in poker_ai/clustering/preflop.py - About 30 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language