rgmining/rsd

View on GitHub

Showing 3 of 22 total issues

File graph.py has 372 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#
#  graph.py
#
#  Copyright (c) 2016-2022 Junpei Kawamoto
#
Severity: Minor
Found in rsd/graph.py - About 4 hrs to fix

    Function retrieve_reviews has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def retrieve_reviews(
            self, review: Review, time_diff: Optional[float] = None, score_diff: float = 0.25
        ) -> ReviewSet:
            """Find agree and disagree reviews.
    
    
    Severity: Minor
    Found in rsd/graph.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 update_agreement has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def update_agreement(self, delta: float) -> float:
            """Update agreement of this review.
    
            This process considers reviews posted in a close time span of this review.
            More precisely, let :math:`t` be the time when this review posted
    Severity: Minor
    Found in rsd/graph.py - About 25 mins 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

    Severity
    Category
    Status
    Source
    Language