Releases: rohaquinlop/complexipy
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
0.3.1
Release Notes
What's Changed
- Require python >= 3.8
- Fix the logic followed to calculate the cognitive complexity.
- The assignment statements only add cognitive complexity when
IfExp
are being used. BinOp
by itself don't add cognitive complexity.
- The assignment statements only add cognitive complexity when
- Add
-s
--sort
optional parameter to sort the output.
PRs
- feat(build|report|docs): #27 Add sort option to the output by @rohaquinlop in #30
- fix(algorithm): #16 fix cognitive complexity by @rohaquinlop in #34
- feat(build): #31 require python >= 3.8 by @rohaquinlop in #35
Full Changelog: 0.3.0...0.3.1
0.3.0
Breaking changes
- Now, by default the cognitive complexity is calculated at a
function level
, this means that the maximum complexity will be evaluated for each function inside the python files, it is still available to get the cognitive complexity per file. - Added new parameters.
- There is more information about the stages when running
complexipy
over git repositories (using the URL). - Reduced verbosity.
- Enhanced the algorithm to measure the cognitive complexity, the results obtained are closer to the Sonar implementation.
- Now the CSV report generation is implemented in Rust instead of Python, this improves the performance.
- Updated docs.
Acknowledgments
- Thanks to everyone in for the feedback
- Special thanks to @ganncamp for taking the time to read the repo, her recommendations, and work.
- Special thanks to @korneevm for your contributions to the project, excellent ideas!
What's Changed
- fix(docs) Changed max complexity argument name to match the code by @korneevm in #11
- fit(report|docs) Add -d params to be able to show only files with complexity above the max_complexity by @korneevm in #14
- feat(build): #16 enhance try cognitive complexity by @rohaquinlop in #18
- feat(test): #16 add unit testing by @rohaquinlop in #20
- feat(build|docs): #15 add function level complexity analysis by @rohaquinlop in #21
- feat(docs): #15 add cognitive complexity explanation by @rohaquinlop in #22
- feat(build): #23 add progress bars by @rohaquinlop in #24
- feat(build|docs): #25 add quiet option by @rohaquinlop in #26
New Contributors
Full Changelog: 0.2.2...0.3.0
0.2.2
Full Changelog: 0.2.1...0.2.2
0.2.1
Update the README.md file
Full Changelog: 0.2.0...0.2.1
0.2.0
What's Changed
- feat(build): #3 ignore paths by @rohaquinlop in #6
- feat(build): #1 add support for git repositories by @rohaquinlop in #7
- feat(report): #4 change the output format to CSV by @rohaquinlop in #8
- feat(build|docs): #4 update readme by @rohaquinlop in #9
- feat(build): #5 fix cognitive complexity algorithm by @rohaquinlop in #10
New Contributors
- @rohaquinlop made their first contribution in #6
Full Changelog: 1.0.0...0.2.0