Skip to content

0.4.0

Latest
Compare
Choose a tag to compare
@rohaquinlop rohaquinlop released this 21 Jun 03:41
5df86cb

Breaking changes

The cognitive complexity now considers the If Expression used in the code.

Example:

def greet(name, is_morning):
    greeting = "Good morning" if is_morning else "Hello"
    print(f"{greeting}, {name}!")

greet("Alice", True)

This function has a cognitive complexity of 1 due to the If Expression used in the variable assignment, this also is considered when using a Call Expression and so on.

Fixed

Found an edge case that could cause a memory overflow, fixed this by filtering the cognitive complexity of the orelse values in an If Statement and kept propagating the nesting level subtraction.

What's Changed

Full Changelog: 0.3.3...0.4.0