github rohaquinlop/complexipy 0.4.0

latest releases: 4.0.2, 4.0.1, 4.0.0...
15 months ago

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

Don't miss a new complexipy release

NewReleases is sending notifications on new releases.