Nikolay-Lysenko/geniartor

View on GitHub

Showing 6 of 6 total issues

Function evaluate_absence_of_parallel_intervals has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def evaluate_absence_of_parallel_intervals(
        piece: Piece, n_degrees_to_penalty: Dict[int, float]
) -> float:
    """
    Evaluate absence of parallel intervals such as parallel fifths or octaves.
Severity: Minor
Found in geniartor/evaluation.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 generate_random_piece has 9 arguments (exceeds 8 allowed). Consider refactoring.
Open

def generate_random_piece(
Severity: Major
Found in geniartor/piece.py - About 35 mins to fix

    Function run_variable_neighborhood_search has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    def run_variable_neighborhood_search(
            piece: Piece,
            evaluation_params: Dict[str, Any],
            n_passes: int,
            fraction_to_try: float,
    Severity: Minor
    Found in geniartor/optimization.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

    Function evaluate_absence_of_large_intervals has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    def evaluate_absence_of_large_intervals(
            piece: Piece, max_n_semitones: int = 16
    ) -> float:
        """
        Evaluate absence of too large harmonic intervals between adjacent voices.
    Severity: Minor
    Found in geniartor/evaluation.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

    Function evaluate_absence_of_voice_crossing has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    def evaluate_absence_of_voice_crossing(piece: Piece) -> float:
        """
        Evaluate absence of voice crossing.
    
        :param piece:
    Severity: Minor
    Found in geniartor/evaluation.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

    Function evaluate_absence_of_narrow_ranges has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    def evaluate_absence_of_narrow_ranges(
            piece: Piece, penalties: Dict[int, float], range_size: int = 9
    ) -> float:
        """
        Evaluate melodic fluency based on absence of stalling within narrow ranges.
    Severity: Minor
    Found in geniartor/evaluation.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