rgmining/synthetic

View on GitHub

Showing 53 of 53 total issues

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

def load(g: GT) -> GT:
"""Load synthetic dataset.
 
Args:
g: an instance of bipartite graph.
Severity: Minor
Found in synthetic/loader.py by radon

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

Function calc_anomalous_reviews has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def calc_anomalous_reviews(reviewers: Iterable[Reviewer]) -> AnomalousReviews:
"""Counts the number of anomalous reviewers.
 
Args:
reviewers: A collection of reviewers.
Severity: Minor
Found in synthetic/eval/score.py - About 45 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

      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 dcg has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        def dcg(reviewers: Iterable[Reviewer], k: int) -> float:
        """Computes a DCG score for a top-k ranking.
         
        Args:
        reviewers: A collection of reviewers.
        Severity: Minor
        Found in synthetic/eval/score.py - About 25 mins to fix

        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/__init__.py by pep8

        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

        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/score.py by pep8

        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

        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

        Line too long (107 > 79 characters)
        Open

        for i, r in enumerate(sorted(reviewers, key=lambda rv: rv.anomalous_score, reverse=True)[:k], start=1):
        Severity: Minor
        Found in synthetic/eval/score.py by pep8

        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

        Line too long (107 > 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

        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

        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

        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/loader.py by pep8

        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/__init__.py by pep8

        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/__init__.py by pep8
        Severity
        Category
        Status
        Source
        Language