Showing 385 of 747 total issues
Function infer_zones_for_faceoffs
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def infer_zones_for_faceoffs(df, directions, xcol='X', ycol='Y', timecol='Time', focus_team=None, season=None,
Consider simplifying this complex logical expression. Open
if 'l1' in kwargs and 'l2' in kwargs and 'l3' in kwargs and 'l4' in kwargs and \
'p1' in kwargs and 'p2' in kwargs and 'p3' in kwargs:
# Change all to IDs
# Go on this strange order because it'll be the order of the plots below
for key in ['l1', 'p1', 'l2', 'p2', 'l3', 'p3', 'l4']:
Function scrape_season_pbp
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def scrape_season_pbp(season, force_overwrite=False):
"""
Scrapes and parses pbp from the given season.
:param season: int, the season
- Read upRead up
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 convert_to_all_combos
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def convert_to_all_combos(df, fillval=0, *args):
"""
This method takes a dataframe and makes sure all possible combinations of given arguments are present.
For example, if you want df to have all combos of P1 and P2, it will create a dataframe with all possible combos,
left join existing dataframe onto that, and return that df. Uses fillval to fill *all* non-key columns.
- Read upRead up
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_team_combo_corsi
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get_team_combo_corsi(season, team, games, n_players=2):
"""
Gets combo Corsi for team for specified games
:param season: int, the season
- Read upRead up
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 parse_season_pbp
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def parse_season_pbp(season, force_overwrite=False):
"""
Parses pbp from the given season.
:param season: int, the season
- Read upRead up
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 access
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
Function access
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
Function setMatcher
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
Avoid deeply nested control flow statements. Open
for ( type in data.events ) {
if ( special[ type ] ) {
jQuery.event.remove( elem, type );
// This is a shortcut to avoid jQuery.event.remove's overhead
Avoid deeply nested control flow statements. Open
if ( restoreDisplay == null ) {
display = style.display;
restoreDisplay = display === "none" ? "" : display;
}
Avoid deeply nested control flow statements. Open
if ( nid === expando ) {
context.removeAttribute( "id" );
}
Avoid deeply nested control flow statements. Open
while ( i-- ) {
groups[i] = "#" + nid + " " + toSelector( groups[i] );
}
Avoid deeply nested control flow statements. Open
if ( rscriptType.test( node.type || "" ) &&
!dataPriv.access( node, "globalEval" ) &&
jQuery.contains( doc, node ) ) {
if ( node.src ) {
Avoid deeply nested control flow statements. Open
while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
cur = cur.replace( " " + clazz + " ", " " );
}
Avoid deeply nested control flow statements. Open
} else if ( copy !== undefined ) {
target[ name ] = copy;
}
Avoid deeply nested control flow statements. Open
if ( ofType ?
node.nodeName.toLowerCase() === name :
node.nodeType === 1 ) {
return false;
Avoid deeply nested control flow statements. Open
if ( ( ofType ?
node.nodeName.toLowerCase() === name :
node.nodeType === 1 ) &&
++diff ) {
Avoid deeply nested control flow statements. Open
if ( ( event.result = ret ) === false ) {
event.preventDefault();
event.stopPropagation();
}
Avoid deeply nested control flow statements. Open
if (!allfound) {
continue;
}