rgmining/synthetic

View on GitHub
synthetic/eval/cli.py

Summary

Maintainability
A
1 hr
Test Coverage
F
38%

Cyclomatic complexity is too high in function threshold. (7)
Open

@main.command()
@click.argument("method", type=click.Choice(GRAPH_TYPES, case_sensitive=False))
@click.option("--loop", type=int, default=20, metavar="LOOP", help="Number of iteration (default: 20).")
@click.option(
    "--param",
Severity: Minor
Found in synthetic/eval/cli.py by radon

Cyclomatic Complexity

Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

Construct Effect on CC Reasoning
if +1 An if statement is a single decision.
elif +1 The elif statement adds another decision.
else +0 The else statement does not cause a new decision. The decision is at the if.
for +1 There is a decision at the start of the loop.
while +1 There is a decision at the while statement.
except +1 Each except branch adds a new conditional path of execution.
finally +0 The finally block is unconditionally executed.
with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
assert +1 The assert statement internally roughly equals a conditional statement.
Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

Source: http://radon.readthedocs.org/en/latest/intro.html

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

def dcg(method: str, loop: int, param: list[tuple[str, str]], output: TextIO, plot: Optional[BinaryIO] = None) -> None:
Severity: Minor
Found in synthetic/eval/cli.py - About 35 mins to fix

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

    def threshold(
    Severity: Minor
    Found in synthetic/eval/cli.py - About 35 mins to fix

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

      def ranking(
      Severity: Minor
      Found in synthetic/eval/cli.py - About 35 mins to fix

        Line too long (104 > 79 characters)
        Open

        """This module defines a CLI command that evaluates a review graph algorithm with the synthetic dataset.
        Severity: Minor
        Found in synthetic/eval/cli.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Line too long (80 > 79 characters)
        Open

        #  rgmining-synthetic-dataset is distributed in the hope that it will be useful,
        Severity: Minor
        Found in synthetic/eval/cli.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Line too long (110 > 79 characters)
        Open

            "--output", type=click.File("w"), default=sys.stdout, help="File path to store results (default: stdout)."
        Severity: Minor
        Found in synthetic/eval/cli.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Line too long (118 > 79 characters)
        Open

                sys.exit(f"Failed to initialize a graph object. Some parameter might need to be given via --param flag:\n{e}")
        Severity: Minor
        Found in synthetic/eval/cli.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Line too long (104 > 79 characters)
        Open

        @click.option("--loop", type=int, default=20, metavar="LOOP", help="Number of iteration (default: 20).")
        Severity: Minor
        Found in synthetic/eval/cli.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Line too long (83 > 79 characters)
        Open

                a = sorted(g.reviewers, key=lambda r: r.anomalous_score, reverse=True)[:57]
        Severity: Minor
        Found in synthetic/eval/cli.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Line too long (104 > 79 characters)
        Open

        @click.option("--loop", type=int, default=20, metavar="LOOP", help="Number of iteration (default: 20).")
        Severity: Minor
        Found in synthetic/eval/cli.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Line too long (111 > 79 characters)
        Open

        @click.option("--plot", type=click.File("bw"), help="File name of the result graph. If set, plot an ROC curve")
        Severity: Minor
        Found in synthetic/eval/cli.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Line too long (111 > 79 characters)
        Open

        @click.option("--plot", type=click.File("bw"), help="File name of the result graph. If set, plot an ROC curve")
        Severity: Minor
        Found in synthetic/eval/cli.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Line too long (95 > 79 characters)
        Open

            help="Key and value pair passed to the chosen algorithm. This option can be set multiply.",
        Severity: Minor
        Found in synthetic/eval/cli.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Line too long (85 > 79 characters)
        Open

        #  along with rgmining-synthetic-dataset. If not, see <http://www.gnu.org/licenses/>.
        Severity: Minor
        Found in synthetic/eval/cli.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Line too long (105 > 79 characters)
        Open

            method: str, loop: int, param: list[tuple[str, str]], output: TextIO, plot: Optional[BinaryIO] = None
        Severity: Minor
        Found in synthetic/eval/cli.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Line too long (119 > 79 characters)
        Open

        def dcg(method: str, loop: int, param: list[tuple[str, str]], output: TextIO, plot: Optional[BinaryIO] = None) -> None:
        Severity: Minor
        Found in synthetic/eval/cli.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Line too long (91 > 79 characters)
        Open

                return synthetic.load(INSTALLED_GRAPHS[method](**{k: float(v) for k, v in params}))
        Severity: Minor
        Found in synthetic/eval/cli.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Line too long (95 > 79 characters)
        Open

            help="Key and value pair passed to the chosen algorithm. This option can be set multiply.",
        Severity: Minor
        Found in synthetic/eval/cli.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Line too long (105 > 79 characters)
        Open

            method: str, loop: int, param: list[tuple[str, str]], output: TextIO, plot: Optional[BinaryIO] = None
        Severity: Minor
        Found in synthetic/eval/cli.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Line too long (116 > 79 characters)
        Open

                    {"threshold": th, "true-positive": tp, "true-negative": tn, "false-positive": fp, "false-negative": fn},
        Severity: Minor
        Found in synthetic/eval/cli.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Line too long (82 > 79 characters)
        Open

            num_of_type1, num_of_type2, num_of_type3 = calc_anomalous_reviews(g.reviewers)
        Severity: Minor
        Found in synthetic/eval/cli.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Line too long (95 > 79 characters)
        Open

            help="Key and value pair passed to the chosen algorithm. This option can be set multiply.",
        Severity: Minor
        Found in synthetic/eval/cli.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Line too long (110 > 79 characters)
        Open

            "--output", type=click.File("w"), default=sys.stdout, help="File path to store results (default: stdout)."
        Severity: Minor
        Found in synthetic/eval/cli.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Line too long (85 > 79 characters)
        Open

        #  rgmining-synthetic-dataset is free software: you can redistribute it and/or modify
        Severity: Minor
        Found in synthetic/eval/cli.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Line too long (110 > 79 characters)
        Open

            "--output", type=click.File("w"), default=sys.stdout, help="File path to store results (default: stdout)."
        Severity: Minor
        Found in synthetic/eval/cli.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Line too long (111 > 79 characters)
        Open

        @click.option("--plot", type=click.File("bw"), help="File name of the result graph. If set, plot an ROC curve")
        Severity: Minor
        Found in synthetic/eval/cli.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        Line too long (104 > 79 characters)
        Open

        @click.option("--loop", type=int, default=20, metavar="LOOP", help="Number of iteration (default: 20).")
        Severity: Minor
        Found in synthetic/eval/cli.py by pep8

        Limit all lines to a maximum of 79 characters.

        There are still many devices around that are limited to 80 character
        lines; plus, limiting windows to 80 characters makes it possible to
        have several windows side-by-side.  The default wrapping on such
        devices looks ugly.  Therefore, please limit all lines to a maximum
        of 79 characters. For flowing long blocks of text (docstrings or
        comments), limiting the length to 72 characters is recommended.
        
        Reports error E501.

        There are no issues that match your filters.

        Category
        Status