djbrown/hbscorez

View on GitHub

Showing 30 of 113 total issues

Avoid too many return statements within this function.
Open

            return
Severity: Major
Found in src/players/management/commands/import_reports.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return
    Severity: Major
    Found in src/leagues/management/commands/import_leagues.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return
      Severity: Major
      Found in src/players/management/commands/import_reports.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return
        Severity: Major
        Found in src/leagues/management/commands/import_leagues.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return Leg.BEWTEEN
          Severity: Major
          Found in src/games/models.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return
            Severity: Major
            Found in src/players/management/commands/parse_report.py - About 30 mins to fix

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

              def add_ranking_place(items: list, field: str):
                  """
                  Adds 'place' to all items according to their order.
                  If the value of the specified field on any given item matches the value on the field of the previous item,
                  then the item gets the same place as its predecessor.
              Severity: Minor
              Found in src/base/logic.py - 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

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

              def scrape_association(url: str, options):
                  html = http.get_text(url)
                  dom = parsing.html_dom(html)
              
                  abbreviation = parsing.parse_association_abbreviation(url)
              Severity: Minor
              Found in src/associations/management/commands/import_associations.py - 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

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

                  def create_or_update_team(name, short_name, league, club, bhv_id, logger: logging.Logger = logging.getLogger()):
                      team = Team.objects.filter(bhv_id=bhv_id).first()
                      if team is None:
                          team = Team.objects.create(name=name, short_name=short_name, league=league, club=club, bhv_id=bhv_id)
                          logger.info("CREATED Team: %s", team)
              Severity: Minor
              Found in src/teams/models.py - 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

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

              def scrape_sports_hall(game_row, processed: set[int] | None = None) -> SportsHall | None:
                  if processed is None:
                      processed = set()
              
                  if len(game_row[3]) != 1:
              Severity: Minor
              Found in src/base/logic.py - 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