muneebalam/scrapenhl2

View on GitHub

Showing 385 of 747 total issues

File manipulate.py has 1246 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import functools
import os
import os.path

import feather
Severity: Major
Found in scrapenhl2/manipulate/manipulate.py - About 3 days to fix

    Function on_success has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring.
    Open

        def on_success(self, data):
            if 'text' in data:
                print(data['text'])
    
                if r'https://t.co/' in data['text']:
    Severity: Minor
    Found in scrapenhl2/twitterbot/gamebot.py - About 1 day 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 update_team_logs has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
    Open

    def update_team_logs(season, force_overwrite=False, force_games=None):
        """
        This method looks at the schedule for the given season and writes pbp for scraped games to file.
        It also adds the strength at each pbp event to the log. It only includes games that have both PBP *and* TOI.
    
    
    Severity: Minor
    Found in scrapenhl2/scrape/teams.py - About 1 day 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

    File visualization_helper.py has 497 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """
    This method contains utilities for visualization.
    """
    
    import numpy as np
    Severity: Minor
    Found in scrapenhl2/plot/visualization_helper.py - About 7 hrs to fix

      Function performObjectSearch has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
      Open

        performObjectSearch : function(object, otherterms) {
          var filenames = this._index.filenames;
          var docnames = this._index.docnames;
          var objects = this._index.objects;
          var objnames = this._index.objnames;
      Severity: Minor
      Found in docs/build/html/_static/searchtools.js - About 6 hrs 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 performObjectSearch has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
      Open

        performObjectSearch : function(object, otherterms) {
          var filenames = this._index.filenames;
          var docnames = this._index.docnames;
          var objects = this._index.objects;
          var objnames = this._index.objnames;
      Severity: Minor
      Found in docs/build/_static/searchtools.js - About 6 hrs 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 Stemmer has 151 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var Stemmer = function() {
      
        var step2list = {
          ational: 'ate',
          tional: 'tion',
      Severity: Major
      Found in docs/build/_static/searchtools.js - About 6 hrs to fix

        File players.py has 418 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        """
        This module contains methods related to individual player info.
        """
        
        import functools
        Severity: Minor
        Found in scrapenhl2/scrape/players.py - About 6 hrs to fix

          Function _filter_for_players has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
          Open

          def _filter_for_players(data, **kwargs):
              """
              Uses the players_on_ice, players_on_ice_for, players_on_ice_ag, acting_player, and receiving_player keyword
              arguments to filter the data.
              :param data: a dataframe with pbp data
          Severity: Minor
          Found in scrapenhl2/manipulate/manipulate.py - About 5 hrs 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 defaultPrefilter has 122 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function defaultPrefilter( elem, props, opts ) {
              var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
                  isBox = "width" in props || "height" in props,
                  anim = this,
                  orig = {},
          Severity: Major
          Found in docs/build/html/_static/jquery-3.1.0.js - About 4 hrs to fix

            Function defaultPrefilter has 122 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function defaultPrefilter( elem, props, opts ) {
                var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
                    isBox = "width" in props || "height" in props,
                    anim = this,
                    orig = {},
            Severity: Major
            Found in docs/build/_static/jquery-3.1.0.js - About 4 hrs to fix

              Function Callbacks has 121 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              jQuery.Callbacks = function( options ) {
              
                  // Convert options from String-formatted to Object-formatted if needed
                  // (we check in cache first)
                  options = typeof options === "string" ?
              Severity: Major
              Found in docs/build/html/_static/jquery-3.1.0.js - About 4 hrs to fix

                Function Callbacks has 121 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                jQuery.Callbacks = function( options ) {
                
                    // Convert options from String-formatted to Object-formatted if needed
                    // (we check in cache first)
                    options = typeof options === "string" ?
                Severity: Major
                Found in docs/build/_static/jquery-3.1.0.js - About 4 hrs to fix

                  File parse_toi.py has 367 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  """
                  This module contains methods for parsing TOI.
                  """
                  
                  import os.path
                  Severity: Minor
                  Found in scrapenhl2/scrape/parse_toi.py - About 4 hrs to fix

                    Function query has 118 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      query : function(query) {
                        var i;
                        var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"];
                    
                        // stem the searchterms and add them to the correct list
                    Severity: Major
                    Found in docs/build/html/_static/searchtools.js - About 4 hrs to fix

                      Function query has 118 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        query : function(query) {
                          var i;
                          var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"];
                      
                          // stem the searchterms and add them to the correct list
                      Severity: Major
                      Found in docs/build/_static/searchtools.js - About 4 hrs to fix

                        File schedules.py has 358 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        """
                        This module contains methods related to season schedules.
                        """
                        
                        import arrow
                        Severity: Minor
                        Found in scrapenhl2/scrape/schedules.py - About 4 hrs to fix

                          Function stemWord has 109 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            this.stemWord = function (w) {
                              var stem;
                              var suffix;
                              var firstch;
                              var origword = w;
                          Severity: Major
                          Found in docs/build/html/_static/searchtools.js - About 4 hrs to fix

                            Function stemWord has 109 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              this.stemWord = function (w) {
                                var stem;
                                var suffix;
                                var firstch;
                                var origword = w;
                            Severity: Major
                            Found in docs/build/_static/searchtools.js - About 4 hrs to fix

                              Function then has 102 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                              then: function( onFulfilled, onRejected, onProgress ) {
                                                  var maxDepth = 0;
                                                  function resolve( depth, deferred, handler, special ) {
                                                      return function() {
                                                          var that = this,
                              Severity: Major
                              Found in docs/build/html/_static/jquery-3.1.0.js - About 4 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language