Closed andrewdea closed 2 weeks ago
Hey @andrewdea, thank you for your contribution!
This is a use case I didn't consider, and I find it really useful, so I appreciate these changes.
Can you please create an issue to relate this PR? And a new issue to discuss the new languages to support them.
@rohaquinlop thanks a lot for the comments! I will go through your suggested changes tomorrow. In the meantime I have created issues:
@rohaquinlop applied the suggested changes, let me know if I'm missing anything 😃
The error at sdist
pipeline is related to maturin-action #291, and it seems that can be solved using the ubuntu-22.04
image explicitly as mentioned in the issue
...
runs-on: ubuntu-22.04
...
@andrewdea We will ignore that error in this PR, there are another pipelines that are failing due to ImportError
's
@andrewdea Can you please modify the CI.yml
file and change this line?
...
sdist:
runs-on: ubuntu-22.04
steps:
...
It seems that without that, the unit tests won't run 😢
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Hello and thank you for this really cool library!
I've tried using this from my python code, but I realized that I needed to expose some of the internal commands.
I made a couple of changes, outlined below. If possible, I would also like to help expand this library so that it can cover other languages besides python.
outline of changes
create a Rust function
code_complexity
, that computes the complexity on a string of python codeexpose this function at the level of the python library This way, we can evaluate the complexity on any string of code:
This is particularly useful in situations where we want to evaluate stand-alone snippets that might not be part of a file-system.
I thought the Rust function
cognitive_complexity
was also really useful as a library command, so I exposed it at the python level. Because of Rust's naming rules, it seems it wouldn't allow me to keep that name: it would clash with the module of the same name. So I renamed the functionfunction_complexityfile_complexity
, which I thought would clarify how it differs fromcode_complexity
. I don't have a strong opinion on the function-names: feel free to propose better ones.Let me know what you think and if there's any edits you'd like me to make before merging, thanks again!
Related issue: #46