SoftwareUnderstanding / inspect4py

Static code analysis package for Python repositories
https://inspect4py.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
27 stars 10 forks source link

Some scripts are tagged as tests when they should not #311

Open dgarijo opened 3 years ago

dgarijo commented 3 years ago

Right now we check if the assert commands are used in tests. I have detected some places (e.g., repo Tface) where the assert expressions are used just to check if the inputs to the script are correct. This is not a good practice, but we should not assume that any function with assert is a test. Alternatives:

dgarijo commented 3 years ago

Other repos to test this with: asciicinema, pyLODE, PyCG

dgarijo commented 3 years ago

We could flag assert in non-tests as a bad practice.

dgarijo commented 3 years ago

@rosafilgueira says that the function extract_relations can be used to address the first issue (see which files are imported in which)