Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider code complexity tracking, and other tools. #5

Open
jenstroeger opened this issue Oct 11, 2021 · 10 comments
Open

Consider code complexity tracking, and other tools. #5

jenstroeger opened this issue Oct 11, 2021 · 10 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@jenstroeger
Copy link
Owner

jenstroeger commented Oct 11, 2021

Tools like Wily and Radon allow to track code complexity metrics, e.g. based on cyclomatic complexity or Halstaed’s complexity metrics. It might make sense to track these (and other?) metrics to measure software maintainability.

In addition, e.g. Bandit or dlint might be useful additions?

@jenstroeger
Copy link
Owner Author

jenstroeger commented Jun 14, 2022

See also the Complexity section of Awesome flake8 plugins. There’s also the wemake-python-styleguide plugin which acts as a wrapper around a bunch of other tools and plugins

In addition, e.g. Bandit or dlint might be useful additions?

PR #214 adds Bandit as git commit hook.

@jenstroeger
Copy link
Owner Author

It probably makes sense to consider the pip-audit package too (see discussion).

@jenstroeger
Copy link
Owner Author

jenstroeger commented Aug 6, 2022

It probably makes sense to consider the pip-audit package too (see discussion).

Played around with it, and the tools looks useful:

> pip-audit 
Found 2 known vulnerabilities in 2 packages
Name     Version ID             Fix Versions
-------- ------- -------------- ------------
lxml     4.7.1   PYSEC-2022-230 4.9.1
waitress 2.1.1   PYSEC-2022-205 2.1.2

However, I wouldn’t use it as a commit hook because dependecies don’t change that often. Instead, it would probably make sense to add it to our Makefile:

.PHONY: upgrade force-upgrade
upgrade: .venv/upgraded-on
.venv/upgraded-on: pyproject.toml
python -m pip install --upgrade pip
python -m pip install --upgrade wheel
python -m pip install --upgrade --upgrade-strategy eager --editable .[hooks,dev,test,docs]
$(MAKE) upgrade-quiet

Call git-audit right after the packages have been updated:

python -m pip_audit

However, if a pip-audit run fails then it fails setting up a venv during an Action run and thereby fails the Action 🤔

@jenstroeger
Copy link
Owner Author

jenstroeger commented Nov 21, 2022

Moving PR #377 over here (and closing): I stumbled upon the dependency-review-action which looked useful. Not sure if build.yaml is a good place, or better pr-change-set.yaml. What do you think, @behnazh?

@behnazh
Copy link
Collaborator

behnazh commented Nov 21, 2022

Another tool too consider is guarddog.

@jenstroeger
Copy link
Owner Author

And then there’s super-linter, which looks rather interesting too 🤓

@jenstroeger
Copy link
Owner Author

pylint offers a number of optional checkers which we can review. I didn’t find a list of additional, third-party checkers though…

@jenstroeger
Copy link
Owner Author

There’s also Ruff which incorporates lint and flake and various checkers in one single tool.

@jenstroeger
Copy link
Owner Author

Another interesting tool is import-linter that checks if user-specified import contracts are met by the code.

@jenstroeger
Copy link
Owner Author

And perflint looks like a useful pylint plugin, too.

@behnazh behnazh mentioned this issue Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants