muneebalam/scrapenhl2

View on GitHub

Showing 724 of 747 total issues

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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                if len(df) == 0:
                    print('Could not find ID for {0:s}'.format(team))
                    return None
                elif len(df) == 1:
                    return df.ID.iloc[0]
        Severity: Major
        Found in scrapenhl2/scrape/team_info.py and 1 other location - About 4 hrs to fix
        scrapenhl2/scrape/players.py on lines 413..421

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 84.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                if len(df) == 0:
                    print('Could not find name for {0:.0f}'.format(playerid))
                    return None
                elif len(df) == 1:
                    return df.Name.iloc[0]
        Severity: Major
        Found in scrapenhl2/scrape/players.py and 1 other location - About 4 hrs to fix
        scrapenhl2/scrape/team_info.py on lines 192..200

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 84.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                  for i in range(len(hrcode)):
                      if hrcode[i].upper() == 'H':
                          dfs_to_join.append(homedf)
                      elif hrcode[i].lower() == 'R':
                          dfs_to_join.append(roaddf)
          Severity: Major
          Found in scrapenhl2/manipulate/combos.py and 1 other location - About 4 hrs to fix
          scrapenhl2/manipulate/combos.py on lines 133..139

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 83.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                  for i in range(len(hrcode)):
                      if hrcode[i].upper() == 'H':
                          dfs_to_join.append(homedf)
                      elif hrcode[i].lower() == 'R':
                          dfs_to_join.append(roaddf)
          Severity: Major
          Found in scrapenhl2/manipulate/combos.py and 1 other location - About 4 hrs to fix
          scrapenhl2/manipulate/combos.py on lines 82..88

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 83.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          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

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                        toi = toi[['Game', 'Team', 'TeamScore', 'OppScore', 'Time']] \
                            .assign(ScoreState=toi.TeamScore - toi.OppScore) \
                            .drop_duplicates() \
                            .drop({'TeamScore', 'OppScore', 'Time'}, axis=1) \
                            .assign(Secs=1) \
                Severity: Major
                Found in scrapenhl2/manipulate/manipulate.py and 2 other locations - About 4 hrs to fix
                scrapenhl2/manipulate/manipulate.py on lines 1546..1551
                scrapenhl2/manipulate/manipulate.py on lines 1589..1594

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 79.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                        pbp = pbp[['Game', 'Team', 'TeamScore', 'OppScore', 'Index']] \
                            .assign(ScoreState=pbp.TeamScore - pbp.OppScore) \
                            .drop_duplicates() \
                            .drop({'TeamScore', 'OppScore', 'Index'}, axis=1) \
                            .assign(Count=1) \
                Severity: Major
                Found in scrapenhl2/manipulate/manipulate.py and 2 other locations - About 4 hrs to fix
                scrapenhl2/manipulate/manipulate.py on lines 1546..1551
                scrapenhl2/manipulate/manipulate.py on lines 1581..1586

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 79.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                        toi = toi[['Game', 'Team', 'Time', 'TeamScore', 'OppScore']] \
                            .assign(ScoreState=toi.TeamScore - toi.OppScore) \
                            .drop_duplicates() \
                            .drop({'Time', 'TeamScore', 'OppScore'}, axis=1) \
                            .assign(Secs=1) \
                Severity: Major
                Found in scrapenhl2/manipulate/manipulate.py and 2 other locations - About 4 hrs to fix
                scrapenhl2/manipulate/manipulate.py on lines 1581..1586
                scrapenhl2/manipulate/manipulate.py on lines 1589..1594

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 79.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                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

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                        with open(tlfile, 'rb') as photo:
                            response = twitter.upload_media(media=photo)
                            twitter.update_status(
                                status='@{3:s} TL: {0:s} @ {1:s} ({2:s}){4:s}'.format(rname, hname, status,
                                                                                      tweetdata['user']['screen_name'],
                    Severity: Major
                    Found in scrapenhl2/twitterbot/gamebot.py and 1 other location - About 4 hrs to fix
                    scrapenhl2/twitterbot/gamebot.py on lines 116..122

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 77.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                        with open(h2hfile, 'rb') as photo:
                            response = twitter.upload_media(media=photo)
                            twitter.update_status(
                                status='@{3:s} H2H: {0:s} @ {1:s} ({2:s}){4:s}'.format(rname, hname, status,
                                                                                       tweetdata['user']['screen_name'], suffix),
                    Severity: Major
                    Found in scrapenhl2/twitterbot/gamebot.py and 1 other location - About 4 hrs to fix
                    scrapenhl2/twitterbot/gamebot.py on lines 123..130

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 77.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 3 locations. Consider refactoring.
                    Open

                    def get_5v5_player_log(season, force_create=False):
                        """
                    
                        :param season: int, the season
                        :param force_create: bool, create from scratch even if it exists?
                    Severity: Major
                    Found in scrapenhl2/manipulate/manipulate.py and 2 other locations - About 4 hrs to fix
                    scrapenhl2/manipulate/manipulate.py on lines 31..44
                    scrapenhl2/manipulate/manipulate.py on lines 455..470

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 76.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 3 locations. Consider refactoring.
                    Open

                    def get_player_toion_toioff_file(season, force_create=False):
                        """
                    
                        :param season: int, the season
                        :param force_create: bool, should this be read from file if possible, or created from scratch
                    Severity: Major
                    Found in scrapenhl2/manipulate/manipulate.py and 2 other locations - About 4 hrs to fix
                    scrapenhl2/manipulate/manipulate.py on lines 455..470
                    scrapenhl2/manipulate/manipulate.py on lines 514..527

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 76.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Severity
                    Category
                    Status
                    Source
                    Language