Showing 385 of 747 total issues
Function infer_zones_for_faceoffs
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def infer_zones_for_faceoffs(df, directions, xcol='X', ycol='Y', timecol='Time', focus_team=None, season=None,
faceoffs=True):
"""
Inferring zones for events from XY is hard--this method takes are of that by referencing against the JSON's
notes on which team went which direction in which period.
- 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 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
var i = 0,
len = elems.length,
bulk = key == null;
Function toggleClass
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
toggleClass: function( value, stateVal ) {
var type = typeof value;
if ( typeof stateVal === "boolean" && type === "string" ) {
return stateVal ? this.addClass( value ) : this.removeClass( value );
Function access
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
var i = 0,
len = elems.length,
bulk = key == null;
Function toggleClass
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
toggleClass: function( value, stateVal ) {
var type = typeof value;
if ( typeof stateVal === "boolean" && type === "string" ) {
return stateVal ? this.addClass( value ) : this.removeClass( value );
Function dispatch
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
dispatch: function( nativeEvent ) {
// Make a writable jQuery.Event from the native event object
var event = jQuery.event.fix( nativeEvent );
Function handleVote
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function handleVote(link) {
if (!opts.voting) {
showError("You'll need to login to vote.");
return;
}
Function adjustCSS
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function adjustCSS( elem, prop, valueParts, tween ) {
var adjusted,
scale = 1,
maxIterations = 20,
currentValue = tween ?
Function handleVote
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function handleVote(link) {
if (!opts.voting) {
showError("You'll need to login to vote.");
return;
}
Function dispatch
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
dispatch: function( nativeEvent ) {
// Make a writable jQuery.Event from the native event object
var event = jQuery.event.fix( nativeEvent );
Function adjustCSS
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function adjustCSS( elem, prop, valueParts, tween ) {
var adjusted,
scale = 1,
maxIterations = 20,
currentValue = tween ?
Function ajaxHandleResponses
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ajaxHandleResponses( s, jqXHR, responses ) {
var ct, type, finalDataType, firstDataType,
contents = s.contents,
dataTypes = s.dataTypes;
Function ajaxHandleResponses
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ajaxHandleResponses( s, jqXHR, responses ) {
var ct, type, finalDataType, firstDataType,
contents = s.contents,
dataTypes = s.dataTypes;
Function mightThrow
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
mightThrow = function() {
var returned, then;
// Support: Promises/A+ section 2.3.3.3.3
// https://promisesaplus.com/#point-59
Function mightThrow
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
mightThrow = function() {
var returned, then;
// Support: Promises/A+ section 2.3.3.3.3
// https://promisesaplus.com/#point-59
Function get_5v5_corsi_pm
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def get_5v5_corsi_pm(season, game, cfca=None):
"""
Returns a dataframe from home team perspective. Each row is a Corsi event, with time and note of whether it's
positive or negative for home team.
- 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 add_times_to_file
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def add_times_to_file(df, periodcol, timecol, time_format):
"""
Uses specified periodcol, timecol, and time_format col to calculate _Secs, time elapsed in game.
:param df: dataframe
- 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_directions_for_xy_for_season
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def get_directions_for_xy_for_season(season, team):
"""
Gets directions for team specified using get_directions_for_xy_for_game
: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 _teams_to_read
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _teams_to_read(**kwargs):
"""
Method concatenates unique values from keyword arguments named team, team_for, and team_ag
:param kwargs: kwargs as given to get_pbp_events, for example
:return: a set of int (team IDs)
- 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 try_url_n_times
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def try_url_n_times(url, timeout=5, n=5):
"""
A helper method that tries to access given url up to five times, returning the page.
:param url: str, the url to access
- 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"