muneebalam/scrapenhl2

View on GitHub

Showing 385 of 747 total issues

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

def labelLines(lines, align=True, xvals=None, **kwargs):
    """Labels lines in a line graph"""

    ax = lines[0].get_axes()
    labLines = []
Severity: Minor
Found in scrapenhl2/plot/label_lines.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 get_directions_for_xy_for_game has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def get_directions_for_xy_for_game(season, game):
    """
    It doesn't seem like there are rules for whether positive X in XY event locations corresponds to offensive zone
    events, for example. Best way is to use fields in the the json.

Severity: Minor
Found in scrapenhl2/manipulate/manipulate.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 team_5v5_shot_rates_by_score has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def team_5v5_shot_rates_by_score(season):
    """
    Uses the team TOI and PBP logs to group by team and game and score state for this season. 5v5 only.

    :param season: int, the season
Severity: Minor
Found in scrapenhl2/manipulate/manipulate.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 player_cf_graphs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def player_cf_graphs(tweetdata):
    """
    If tweet fits
    :param tweetdata:
    :return:
Severity: Minor
Found in scrapenhl2/twitterbot/gamebot.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 generate_toicomp has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def generate_toicomp(season):
    """
    Generates toicomp at a player-game level
    :param season: int, the season
    :return: df,
Severity: Minor
Found in scrapenhl2/manipulate/manipulate.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