Showing 385 of 747 total issues
Function domManip
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
function domManip( collection, args, callback, ignored ) {
// Flatten any nested arrays
args = concat.apply( [], args );
Function performTermsSearch
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
performTermsSearch : function(searchterms, excluded, terms, titleterms) {
var docnames = this._index.docnames;
var filenames = this._index.filenames;
var titles = this._index.titles;
Function _create_pbp_df_json
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def _create_pbp_df_json(pbp, gameinfo):
"""
Creates a pandas dataframe from the pbp, making use of gameinfo (from schedule file) as well
:param pbp: dict, from pbp json
- 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_cfpct_ref_lines_to_plot
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def add_cfpct_ref_lines_to_plot(ax, refs=None):
"""
Adds reference lines to specified axes. For example, it could add 50%, 55%, and 45% CF% lines.
50% has the largest width and is solid. 40%, 60%, etc will be dashed with medium width. Other numbers will be
- 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 read_final_games
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def read_final_games(games, season):
"""
:param games:
:param 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_toi
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def parse_season_toi(season, force_overwrite=False):
"""
Parses toi from the given season. Final games covered only.
: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 add_onice_players_to_df
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def add_onice_players_to_df(df, focus_team, season, gamecol, player_output='ids'):
"""
Uses the _Secs column in df, the season, and the gamecol to join onto on-ice players.
: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
File game_h2h.py
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
This module contains methods for creating a game H2H chart.
"""
import matplotlib.pyplot as plt
File game_timeline.py
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
This module has methods for creating a game corsi timeline.
"""
import matplotlib.pyplot as plt
File gamebot.py
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
from twython import Twython
from twython import TwythonStreamer
import re
import time
import os
Function displayNextItem
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
function displayNextItem() {
// results left, load the summary and display it
if (results.length) {
var item = results.pop();
var listItem = $('<li style="display:none"></li>');
Function eq
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
function eq(a, b, stack) {
// Identical objects are equal. `0 === -0`, but they aren't identical.
// See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal.
if (a === b) return a !== 0 || 1 / a == 1 / b;
// A strict comparison is necessary because `null == undefined`.
Function init
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
init = jQuery.fn.init = function( selector, context, root ) {
var match, elem;
// HANDLE: $(""), $(null), $(undefined), $(false)
if ( !selector ) {
Function displayNextItem
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
function displayNextItem() {
// results left, load the summary and display it
if (results.length) {
var item = results.pop();
var listItem = $('<li style="display:none"></li>');
Function eq
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
function eq(a, b, stack) {
// Identical objects are equal. `0 === -0`, but they aren't identical.
// See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal.
if (a === b) return a !== 0 || 1 / a == 1 / b;
// A strict comparison is necessary because `null == undefined`.
Function init
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
init = jQuery.fn.init = function( selector, context, root ) {
var match, elem;
// HANDLE: $(""), $(null), $(undefined), $(false)
if ( !selector ) {
Function labelLine
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def labelLine(line, x, label=None, align=True, **kwargs):
"""Labels line with line2D label data"""
ax = line.get_axes()
xdata = line.get_xdata()
- 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 _combo_corsi_from_hrcodes
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def _combo_corsi_from_hrcodes(homedf=None, roaddf=None, corsidf=None, cfca=None, *hrcodes):
"""
Joins the homedf and roaddf as specified by hrcodes.
:param homedf: home team df (e.g. for TOI)
- 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 read_shifts_from_html_pages
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def read_shifts_from_html_pages(rawtoi1, rawtoi2, teamid1, teamid2, season, game):
"""
Aggregates information from two html pages given into a dataframe with one row per second and one col per player.
:param rawtoi1: str, html page of shift log for team id1
- 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_schedule
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def get_team_schedule(season=None, team=None, startdate=None, enddate=None):
"""
Gets the schedule for given team in given season. Or if startdate and enddate are specified, searches between
those dates. If season and startdate (and/or enddate) are specified, searches that season between those dates.
- 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"