Viper - a code complexity metrics reporter
Input
all kinds of source code files
Output
For each file, list of functiton information. For a function, analyze to get following data: - scope (namespace, class or function as ancester nodes of this function)
- fqdn (fully qualified domain name: scope + name)
- name (the identifier)
- signature (normalized function signature, keep unchanged when compiled function name is not changed)
- line (line number of identifier)
- start (start line number of function definition)
- end (end line number of function definition)
- ccm (mccabe-style cyclomatic complexity metric, Traditional: each
casestatement counts +1) - modified_ccm (mccabe-style cyclomatic complexity metric, Modified:
switchstatement counts +1) - statements (number of statements in the function body)
Supported Languages
- C (
.c,.h) - C++ (
.cpp,.cxx,.cc,.hpp,.hxx,.hh) - Python (
.py,.pyw) - SystemVerilog (
.sv,.svh)
Output Formats
Viper supports multiple output formats out of the box. Use the --format option:
default: Human-readable list of functions (default)pmccabe: pmccabe-compatible tab-separated format (Modified CCM, Traditional CCM, Statements, First line, # Lines, filename(line): function_name)
Implementation Idea
- use python 3.14.2
- utilize tree_sitter module and tree_sitter_xxx language packs to parse source code to get AST, then analyze AST to get function information
- support inputs of multiple files, enumeration of files in directories.
project and module management
- use tool
uvas package/project management tool - use
uv run <script>to run scripts - put code under
srcfile
Metadata
Release files for viper-ccm 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| viper_ccm-0.1.4.tar.gz | 9.7 kB | Without provenance | Details for viper_ccm-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| viper_ccm-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for viper_ccm-0.1.4-py3-none-any.whl |
Total release size: 26.5 kB
Release files / viper_ccm-0.1.4.tar.gz
| Download URL | viper_ccm-0.1.4.tar.gz |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6bc102af4bd40de3f3ac391226d52e94bfc3e9900836c8de9e6561325d910b4f
|
|
BLAKE2b-256 checksum How to use checksums |
3b95187903f6619f940c4667c1feeaff141d2a410fe4d0f8d58395e0d825e0c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / viper_ccm-0.1.4-py3-none-any.whl
| Download URL | viper_ccm-0.1.4-py3-none-any.whl |
|---|---|
| Size | 16.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
78fc498936ad50bafd69b944eae29210365e418ec084d8a62cc8f54362b9b282
|
|
BLAKE2b-256 checksum How to use checksums |
2af32f780b54c2df0ca42f74a1f7ace442b399cb86cce83fc27cf46264f3aea9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for viper-ccm 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.