Project

General

Profile

Actions

Code checker in evaluation

Radon

Radon is a Python tool which computes various code metrics. Installation:

apt install radon

E.g. to show metrics about cyclic complexity execute in project root:
radon cc openatlas

SonarQube

SonarQube is an open source code scanner that takes some effort to set up but gives quite interesting statistics and hints about security, readability, ...
OpenAtlas has already a SonarQube project configuration file sonar-project.properties in the project root and output files are ignored in .gitignore.
Below are specific instructions for my computer, you will have to adapt path, authentication and similar after setting up SonarQube on yours.

/home/alex/media/new/sonar/sonarqube-8.9.0.43852/bin/linux-x86-64/sonar.sh console

Change into the respective project directory and execute in another terminal:
/home/alex/media/new/sonar/sonar-scanner-4.6.1.2450-linux/bin/sonar-scanner

Go to http://localhost:9000 (user authentication is disabled on my computer but was admin/a with -Dsonar.login=d1fe14fb054295f1b716d267bdb55ad7aa3964c6)

Tabnanny

Tabnanny checks your source code for ambiguous indentation. To run in the project root (which should produce no errors):

python3 -m tabnanny .

Black

Black is a Python code formatter. I personally don't like the string and parenthesis formatting but it could still be useful to check the code with it from time to time.
To install on Debian and run tests in project root without writing it to files:

apt install black
black --diff -S .

Flake8

Works nice but is already covered with Pylint. Installation:

apt install flake8

To show results, execute in project root:

flake8 openatlas

Coala

coala, sadly no Debian package or PyCharm plugin seems to be available (2022)

Updated by Alexander Watzinger 7 months ago · 18 revisions

Also available in: PDF HTML TXT