muneebalam/scrapenhl2

View on GitHub

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,
Severity: Major
Found in scrapenhl2/manipulate/manipulate.py - About 1 hr to fix

    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']:
    Severity: Major
    Found in scrapenhl2/plot/team_lineup_cf.py - About 1 hr to fix

      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
      Severity: Minor
      Found in scrapenhl2/scrape/scrape_pbp.py - About 55 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 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.
      Severity: Minor
      Found in scrapenhl2/manipulate/manipulate.py - About 55 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_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
      Severity: Minor
      Found in scrapenhl2/manipulate/combos.py - About 55 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 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
      Severity: Minor
      Found in scrapenhl2/scrape/parse_pbp.py - About 55 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 access has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
      Severity: Major
      Found in docs/build/html/_static/jquery-3.1.0.js - About 50 mins to fix

        Function access has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
        Severity: Major
        Found in docs/build/_static/jquery-3.1.0.js - About 50 mins to fix

          Function setMatcher has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
          Severity: Minor
          Found in docs/build/html/_static/jquery-3.1.0.js - About 45 mins to fix

            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
            Severity: Major
            Found in docs/build/html/_static/jquery-3.1.0.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  if ( restoreDisplay == null ) {
                                      display = style.display;
                                      restoreDisplay = display === "none" ? "" : display;
                                  }
              Severity: Major
              Found in docs/build/html/_static/jquery-3.1.0.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if ( nid === expando ) {
                                            context.removeAttribute( "id" );
                                        }
                Severity: Major
                Found in docs/build/html/_static/jquery-3.1.0.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      while ( i-- ) {
                                          groups[i] = "#" + nid + " " + toSelector( groups[i] );
                                      }
                  Severity: Major
                  Found in docs/build/html/_static/jquery-3.1.0.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        if ( rscriptType.test( node.type || "" ) &&
                                            !dataPriv.access( node, "globalEval" ) &&
                                            jQuery.contains( doc, node ) ) {
                    
                                            if ( node.src ) {
                    Severity: Major
                    Found in docs/build/html/_static/jquery-3.1.0.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
                                                  cur = cur.replace( " " + clazz + " ", " " );
                                              }
                      Severity: Major
                      Found in docs/build/html/_static/jquery-3.1.0.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                        } else if ( copy !== undefined ) {
                                            target[ name ] = copy;
                                        }
                        Severity: Major
                        Found in docs/build/html/_static/jquery-3.1.0.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                              if ( ofType ?
                                                                  node.nodeName.toLowerCase() === name :
                                                                  node.nodeType === 1 ) {
                          
                                                                  return false;
                          Severity: Major
                          Found in docs/build/html/_static/jquery-3.1.0.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                                if ( ( ofType ?
                                                                    node.nodeName.toLowerCase() === name :
                                                                    node.nodeType === 1 ) &&
                                                                    ++diff ) {
                            
                            
                            Severity: Major
                            Found in docs/build/html/_static/jquery-3.1.0.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      if ( ( event.result = ret ) === false ) {
                                                          event.preventDefault();
                                                          event.stopPropagation();
                                                      }
                              Severity: Major
                              Found in docs/build/html/_static/jquery-3.1.0.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                            if (!allfound) {
                                              continue;
                                            }
                                Severity: Major
                                Found in docs/build/html/_static/searchtools.js - About 45 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language