muneebalam/scrapenhl2

View on GitHub
scrapenhl2/plot/visualization_helper.py

Summary

Maintainability
F
5 days
Test Coverage

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 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
    Severity: Minor
    Found in scrapenhl2/plot/visualization_helper.py - About 2 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 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 get_enddate_from_kwargs has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    def get_enddate_from_kwargs(**kwargs):
        """Returns 6/21 of endseason + 1, or enddate"""
    
        if 'enddate' in kwargs:
            return kwargs['enddate']
    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 parallel_coords has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def parallel_coords(backgrounddf, foregrounddf, groupcol, legendcol=None, axis=None):
    Severity: Minor
    Found in scrapenhl2/plot/visualization_helper.py - About 35 mins to fix

      Function add_good_bad_fast_slow has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def add_good_bad_fast_slow(margin=0.05, bottomleft='Slower', bottomright='Better', topleft='Worse', topright='Faster'):
      Severity: Minor
      Found in scrapenhl2/plot/visualization_helper.py - About 35 mins to fix

        Avoid too many return statements within this function.
        Open

                return get_enddate_from_kwargs(endseason=helper.infer_season_from_date(kwargs['startdate']))
        Severity: Major
        Found in scrapenhl2/plot/visualization_helper.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return get_enddate_from_kwargs(endseason=schedules.get_current_season())
          Severity: Major
          Found in scrapenhl2/plot/visualization_helper.py - About 30 mins to fix

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

                if 'min_toi' in kwargs and 'max_toi' in kwargs:
                    titlestr.append('TOI range: {0:.1f}-{1:.1f} min'.format(kwargs['min_toi'], kwargs['max_toi']))
                elif 'min_toi' in kwargs:
                    titlestr.append('TOI range: {0:.1f}+ min'.format(kwargs['min_toi']))
                elif 'min_toi' in kwargs:
            Severity: Major
            Found in scrapenhl2/plot/visualization_helper.py and 1 other location - About 7 hrs to fix
            scrapenhl2/plot/visualization_helper.py on lines 438..443

            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 113.

            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 'min_toi60' in kwargs and 'max_toi60' in kwargs:
                    titlestr.append('TOI60 range: {0:.1f}-{1:.1f} min'.format(kwargs['min_toi60'], kwargs['max_toi60']))
                elif 'min_toi60' in kwargs:
                    titlestr.append('TOI60 range: {0:.1f}+ min'.format(kwargs['min_toi60']))
                elif 'min_toi60' in kwargs:
            Severity: Major
            Found in scrapenhl2/plot/visualization_helper.py and 1 other location - About 7 hrs to fix
            scrapenhl2/plot/visualization_helper.py on lines 431..436

            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 113.

            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 'team' in kwargs:
                    teamid = team_info.team_as_id(kwargs['team'])
                    df2 = df.query("TeamID == {0:d}".format(teamid))
                    return df2
            Severity: Major
            Found in scrapenhl2/plot/visualization_helper.py and 1 other location - About 1 hr to fix
            scrapenhl2/plot/visualization_helper.py on lines 303..306

            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 47.

            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 'player' in kwargs:
                    playerid = players.player_as_id(kwargs['player'])
                    df2 = df.query("PlayerID == {0:d}".format(playerid))
                    return df2
            Severity: Major
            Found in scrapenhl2/plot/visualization_helper.py and 1 other location - About 1 hr to fix
            scrapenhl2/plot/visualization_helper.py on lines 285..288

            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 47.

            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 3 locations. Consider refactoring.
            Open

                if save_file is None:
                    plt.show()
                elif save_file == 'fig':
                    return plt.gcf()
                else:
            Severity: Major
            Found in scrapenhl2/plot/visualization_helper.py and 2 other locations - About 1 hr to fix
            scrapenhl2/plot/game_h2h.py on lines 227..232
            scrapenhl2/plot/game_timeline.py on lines 112..117

            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 45.

            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 'max_toi' in kwargs:
                    toitotals = toitotals.query('TOION <= {0:f}'.format(kwargs['max_toi'] / 60))
            Severity: Major
            Found in scrapenhl2/plot/visualization_helper.py and 1 other location - About 1 hr to fix
            scrapenhl2/plot/visualization_helper.py on lines 261..262

            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 39.

            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 'min_toi' in kwargs:
                    toitotals = toitotals.query('TOION >= {0:f}'.format(kwargs['min_toi'] / 60))  # TOION is in hrs; min_toi in mins
            Severity: Major
            Found in scrapenhl2/plot/visualization_helper.py and 1 other location - About 1 hr to fix
            scrapenhl2/plot/visualization_helper.py on lines 263..264

            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 39.

            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

                plt.gca().set_ylim(ymin - margin * ydiff, ymax + margin * ydiff)
            Severity: Major
            Found in scrapenhl2/plot/visualization_helper.py and 1 other location - About 1 hr to fix
            scrapenhl2/plot/visualization_helper.py on lines 666..666

            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 38.

            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

                plt.gca().set_xlim(xmin - margin * xdiff, xmax + margin * xdiff)
            Severity: Major
            Found in scrapenhl2/plot/visualization_helper.py and 1 other location - About 1 hr to fix
            scrapenhl2/plot/visualization_helper.py on lines 667..667

            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 38.

            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

                dataframe_long.loc[:, 'X'] = dataframe_long.variable.apply(lambda x: rev_xs[x])
            Severity: Minor
            Found in scrapenhl2/plot/visualization_helper.py and 1 other location - About 50 mins to fix
            scrapenhl2/plot/team_score_shot_rate.py on lines 37..37

            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 36.

            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

                    rollingdf.loc[:, '_Row'] = rollingdf[['PlayerID', '_Row']].groupby('PlayerID').cumsum()
            Severity: Minor
            Found in scrapenhl2/plot/visualization_helper.py and 1 other location - About 45 mins to fix
            scrapenhl2/plot/visualization_helper.py on lines 237..237

            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 35.

            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

                    df.loc[:, '_Row'] = df[['PlayerID', '_Row']].groupby('PlayerID').cumsum()
            Severity: Minor
            Found in scrapenhl2/plot/visualization_helper.py and 1 other location - About 45 mins to fix
            scrapenhl2/plot/visualization_helper.py on lines 239..239

            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 35.

            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 6 locations. Consider refactoring.
            Open

                toitotals.loc[:, 'TOI60'] = toitotals.TOION / (toitotals.TOION + toitotals.TOIOFF)
            Severity: Major
            Found in scrapenhl2/plot/visualization_helper.py and 5 other locations - About 40 mins to fix
            scrapenhl2/manipulate/manipulate.py on lines 440..440
            scrapenhl2/plot/team_score_shot_rate.py on lines 31..31
            scrapenhl2/plot/usage.py on lines 33..33
            scrapenhl2/plot/usage.py on lines 97..97
            scrapenhl2/plot/usage.py on lines 159..159

            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 34.

            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 6 locations. Consider refactoring.
            Open

                topy = np.array([org_ylim[1] for _ in range(len(refs))])
            Severity: Major
            Found in scrapenhl2/plot/visualization_helper.py and 5 other locations - About 35 mins to fix
            scrapenhl2/plot/visualization_helper.py on lines 600..600
            scrapenhl2/plot/visualization_helper.py on lines 601..601
            scrapenhl2/plot/visualization_helper.py on lines 608..608
            scrapenhl2/plot/visualization_helper.py on lines 609..609
            scrapenhl2/plot/visualization_helper.py on lines 610..610

            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 33.

            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 6 locations. Consider refactoring.
            Open

                leftx = np.array([org_xlim[0] for _ in range(len(refs))])
            Severity: Major
            Found in scrapenhl2/plot/visualization_helper.py and 5 other locations - About 35 mins to fix
            scrapenhl2/plot/visualization_helper.py on lines 600..600
            scrapenhl2/plot/visualization_helper.py on lines 601..601
            scrapenhl2/plot/visualization_helper.py on lines 609..609
            scrapenhl2/plot/visualization_helper.py on lines 610..610
            scrapenhl2/plot/visualization_helper.py on lines 611..611

            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 33.

            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 6 locations. Consider refactoring.
            Open

                x2 = np.array([org_xlim[1] for _ in range(len(refs))])
            Severity: Major
            Found in scrapenhl2/plot/visualization_helper.py and 5 other locations - About 35 mins to fix
            scrapenhl2/plot/visualization_helper.py on lines 600..600
            scrapenhl2/plot/visualization_helper.py on lines 608..608
            scrapenhl2/plot/visualization_helper.py on lines 609..609
            scrapenhl2/plot/visualization_helper.py on lines 610..610
            scrapenhl2/plot/visualization_helper.py on lines 611..611

            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 33.

            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 6 locations. Consider refactoring.
            Open

                rightx = np.array([org_xlim[1] for _ in range(len(refs))])
            Severity: Major
            Found in scrapenhl2/plot/visualization_helper.py and 5 other locations - About 35 mins to fix
            scrapenhl2/plot/visualization_helper.py on lines 600..600
            scrapenhl2/plot/visualization_helper.py on lines 601..601
            scrapenhl2/plot/visualization_helper.py on lines 608..608
            scrapenhl2/plot/visualization_helper.py on lines 610..610
            scrapenhl2/plot/visualization_helper.py on lines 611..611

            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 33.

            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 6 locations. Consider refactoring.
            Open

                x1 = np.array([org_xlim[0] for _ in range(len(refs))])
            Severity: Major
            Found in scrapenhl2/plot/visualization_helper.py and 5 other locations - About 35 mins to fix
            scrapenhl2/plot/visualization_helper.py on lines 601..601
            scrapenhl2/plot/visualization_helper.py on lines 608..608
            scrapenhl2/plot/visualization_helper.py on lines 609..609
            scrapenhl2/plot/visualization_helper.py on lines 610..610
            scrapenhl2/plot/visualization_helper.py on lines 611..611

            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 33.

            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 6 locations. Consider refactoring.
            Open

                bottomy = np.array([org_ylim[0] for _ in range(len(refs))])
            Severity: Major
            Found in scrapenhl2/plot/visualization_helper.py and 5 other locations - About 35 mins to fix
            scrapenhl2/plot/visualization_helper.py on lines 600..600
            scrapenhl2/plot/visualization_helper.py on lines 601..601
            scrapenhl2/plot/visualization_helper.py on lines 608..608
            scrapenhl2/plot/visualization_helper.py on lines 609..609
            scrapenhl2/plot/visualization_helper.py on lines 611..611

            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 33.

            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 'min_toi60' in kwargs:
                    toitotals = toitotals.query('TOI60 >= {0:f}'.format(kwargs['min_toi60']))
            Severity: Minor
            Found in scrapenhl2/plot/visualization_helper.py and 1 other location - About 35 mins to fix
            scrapenhl2/plot/visualization_helper.py on lines 267..268

            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 33.

            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 'max_toi60' in kwargs:
                    toitotals = toitotals.query('TOI60 <= {0:f}'.format(kwargs['max_toi60']))
            Severity: Minor
            Found in scrapenhl2/plot/visualization_helper.py and 1 other location - About 35 mins to fix
            scrapenhl2/plot/visualization_helper.py on lines 265..266

            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 33.

            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

            There are no issues that match your filters.

            Category
            Status