Releases: rohaquinlop/complexipy
3.0.0
complexipy
v3.0.0 Release Notes
We are thrilled to announce the release of complexipy v3.0.0, a major update that brings significant new features, enhancements, and important changes to the complexipy
ecosystem. This release focuses on expanding the reach of complexipy
with WebAssembly (WASM) support, improving usability with new output options, and strengthening integrations with developer workflows.
⚠️ Breaking Changes
- Simplified Complexity Threshold: The
--max-complexity
argument has been removed.complexipy
now uses a fixed cognitive complexity threshold of 15. The tool will exit with an error if any function meets or exceeds this threshold. This change simplifies configuration and aligns with established cognitive complexity best practices. To show all functions regardless of their complexity score, use the new--ignore-complexity
(-i
) flag. (PR #73)
🚀 What's New in v3.0.0
Major Features & Enhancements
-
WebAssembly (WASM) Support
complexipy
's core analysis engine can now be compiled to WebAssembly! This is a game-changer, allowing cognitive complexity analysis to run directly in the browser. This opens up exciting possibilities for interactive web applications and enhances tools like the VSCode extension. (PR #72) -
JSON Output for Seamless Integrations
We've introduced a new--output-json
(-j
) option in the CLI. You can now get complexity analysis results in a machine-readable JSON format, making it easier to integratecomplexipy
into your scripts and development toolchains. (PR #74)
💻 Command Line Interface (CLI)
- Enhanced Analysis and Reporting: The CLI has been overhauled for better control and clarity (PR #73):
- A new
--ignore-complexity
(-i
) flag has been added to display all functions, regardless of whether they exceed the complexity threshold. - The
--details
(-d
) option now also affects CSV and JSON outputs, allowing you to generate reports that include all functions or only those exceeding the complexity limit. - You can now sort results by complexity score (
asc
,desc
) or byname
.
- A new
⚙️ Ecosystem & Integrations
This release also strengthens the ecosystem around complexipy
, making it easier than ever to integrate into your daily workflow.
-
Pre-commit Hook
You can now usecomplexipy
as a pre-commit hook to automatically check for code complexity before you commit. This is a great way to enforce code quality standards across your team. The documentation has been updated with clear instructions for easy setup. (PR #75) -
VSCode Extension
The complexipy VSCode extension continues to provide real-time complexity analysis directly in your editor, with visual indicators to help you write more maintainable code. -
GitHub Action
Automate complexity checks in your CI/CD pipeline with the complexipy GitHub Action. It's a powerful way to ensure that code quality remains high with every pull request.
Full Changelog
- WASM support by @rohaquinlop in #72
- fix(cli) #68: Enhance complexity analysis options by @rohaquinlop in #73
- feat(cli): #70 Add JSON output option for complexity analysis by @rohaquinlop in #74
- chore: add pre-commit hook information by @rohaquinlop in #75
2.1.1
What's Changed
- fix(python): #65 fix compatibility with python 3.8 by @rohaquinlop in #66
Full Changelog: 2.1.0...2.1.1
2.1.0
What's Changed
- fix(rust): #63 Fix dictionary expression count bool ops by @rohaquinlop in #64
Full Changelog: 2.0.0...2.1.0
2.0.0
What's Changed
- feat(rust): Change parser from rustpython to ruff_python_parser by @rohaquinlop in #62
Full Changelog: 1.2.0...2.0.0
1.2.0
Errors
- The output_summary function call was missing the
files_complexities
argument
What's Changed
- fix(python): #57 fix output_summary function call by @rohaquinlop in #58
Full Changelog: 1.1.0...1.2.0
1.1.0
New Features
- Multiple Paths Support: Users can now pass multiple paths to analyze, enhancing flexibility and usability. This feature was recommended by: @illusional
Breaking changes
- Deprecated
-l
option, simplifying the command-line interface - The
file level
isn't being supported in order to focus on the functions instead of all the file.
PRs
0.5.0
🐙 Now you can use complexipy from your python code!
@andrewdea added this feature, now it's possible to call complexipy from your python code.
Here is an example:
>>> from complexipy import file_complexity
>>> fc = file_complexity("path/to/file.py")
>>> fc.complexity
1
Evaluate code snippet
>>> from complexipy import code_complexity
>>> snippet = """for x in range(0, 10):
print(x)
"""
>>> cc = code_complexity(snippet)
cc.complexity
1
What's Changed
- Expose library commands by @andrewdea in #45
- document library-usage in README by @andrewdea in #49
- feat(CI): #50 fix CI workflow by @rohaquinlop in #51
- feat(build): #52 improve usability of the package by @rohaquinlop in #53
- feat(docs): #52 update documentation by @rohaquinlop in #54
New Contributors
- @andrewdea made their first contribution in #45
Full Changelog: 0.4.0...0.5.0
0.4.0
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
- feat(back): #40 update cognitive complexity algorithm by @rohaquinlop in #44
Full Changelog: 0.3.3...0.4.0
0.3.3
What's Changed
- fix(rust): #41 update ci and remove unused dependencies by @rohaquinlop in #43
Full Changelog: 0.3.2...0.3.3
0.3.2
What's Changed
- When using
--details low
, in some cases the summary table is empty, so in this case then the table won't be printed but an informational message.
PRs
- feat(cli): #37 no files found by @rohaquinlop in #38
Full Changelog: 0.3.1...0.3.2