muneebalam/scrapenhl2

View on GitHub

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.
Severity: Minor
Found in scrapenhl2/manipulate/manipulate.py - About 1 hr 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 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 );
Severity: Minor
Found in docs/build/html/_static/jquery-3.1.0.js - About 1 hr to fix

    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;
    
    
    Severity: Minor
    Found in docs/build/html/_static/jquery-3.1.0.js - About 1 hr to fix

      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;
      
      
      Severity: Minor
      Found in docs/build/_static/jquery-3.1.0.js - About 1 hr to fix

        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 );
        Severity: Minor
        Found in docs/build/_static/jquery-3.1.0.js - About 1 hr to fix

          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 ?
          Severity: Minor
          Found in docs/build/html/_static/jquery-3.1.0.js - About 1 hr to fix

            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;
                }
            Severity: Minor
            Found in docs/build/html/_static/websupport.js - About 1 hr to fix

              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 );
              
              
              Severity: Minor
              Found in docs/build/html/_static/jquery-3.1.0.js - About 1 hr to fix

                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;
                    }
                Severity: Minor
                Found in docs/build/_static/websupport.js - About 1 hr to fix

                  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 ?
                  Severity: Minor
                  Found in docs/build/_static/jquery-3.1.0.js - About 1 hr to fix

                    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 );
                    
                    
                    Severity: Minor
                    Found in docs/build/_static/jquery-3.1.0.js - About 1 hr to fix

                      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;
                      Severity: Minor
                      Found in docs/build/html/_static/jquery-3.1.0.js - About 1 hr to fix

                        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;
                        Severity: Minor
                        Found in docs/build/_static/jquery-3.1.0.js - About 1 hr to fix

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

                            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
                            Severity: Minor
                            Found in docs/build/_static/jquery-3.1.0.js - About 1 hr to fix

                              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.
                              
                              
                              Severity: Minor
                              Found in scrapenhl2/scrape/parse_pbp.py - About 1 hr 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 generic_5v5_log_graph_title has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def generic_5v5_log_graph_title(figtype, **kwargs):
                                  """
                                  Generates a figure title incorporating parameters from kwargs:
                              
                                  [Fig type] for [player, or multiple players, or team]
                              Severity: Minor
                              Found in scrapenhl2/plot/visualization_helper.py - About 1 hr 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 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
                              Severity: Minor
                              Found in scrapenhl2/manipulate/add_onice_players.py - About 1 hr 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 _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)
                              Severity: Minor
                              Found in scrapenhl2/manipulate/manipulate.py - About 1 hr 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_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
                              Severity: Minor
                              Found in scrapenhl2/manipulate/manipulate.py - About 1 hr 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