A Python tool to generate multi project, multi language code metric reports
Project description
Metripy
A multilanguage, multi project code metrics analysis tool.
Languages
Supported languages
- Python
- Php
- Typescript (experimental)
- TBD
Analysis types
Code analysis
Analyses code with cyclomatic complexity, maintainability index, halstead metrics.
Git analysis
Analyses git stats of the past months
Dependeny analysis
Analyzses composer, npm or pip dependencies
More dependencies TBD
Report formats
Html
Generates an easy to read dashboard
TODO: as this application generates multi project reports, add central dashboard to have project specific insights at first glance
Csv
Exports simple csv
Json
Dumps full result into json
Cli
Prints overview to cli, contains colorcoded tables and charts
Metrics
Lines of code
The total number of lines in your source code, including comments and blank lines.
Cyclomatic Complexity
A measure of the number of independent paths through your code.
Cognitive Complexity
A measure of how difficult code is to understand based on its control flow and nesting.
Maintainability Index
A composite metric that estimates how easy it is to maintain code, based on LOC, complexity, and comments.
Average Method Size
The average number of lines per method or function in your codebase.
Instability
A metric that measures how likely a module is to change based on its dependencies (ratio of efferent to afferent couplings).
LCOM4
A metric that measures how well the methods of a class are related to each other. It checks if methods share common attributes, indicating cohesion.
Configuration
Configuration is for the moment only possible with the --config=<file>.json option. More TBD
Sample configuraiton:
{
"configs": {
"metripy": {
"base_path": "./", // base path to look at
"includes": [
"metripy/" // paths to include from the base path on
],
"excludes": [
"__pycache__" // exclude patterns of paths / files
],
"extensions": [
"py" // file extensions to look at
],
"git": { // if git is set, analyzes git history
"branch": "main" // git branch to look at
},
"composer": true, // looks for base_path/composer.json and analyzes dependencies - for php projects
"npm": true, // looks for base_path/package.json and analyzes dependencies - for ts/js projects
"pip": true,
// looks for base_path/requirements.txt or base_path/pyproject.toml and analyzes dependencies - for python projects
"reports": {
"html": "./build/report/metripy", // report should be put into this directory
"json-git": "./build/json-report/metripy-git.json" // file where to put git json report
// more types of reports TBA
}
},
// next project name: { next config... }
}
}
Configuration for only git stats
{
"configs": {
"metripy-git": {
"base_path": "./",
"git": {
"branch": "main"
},
"reports": {
"json-git": "./build/json-report/metripy-git.json"
}
}
}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file metripy-0.9.0.tar.gz.
File metadata
- Download URL: metripy-0.9.0.tar.gz
- Upload date:
- Size: 113.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe37ca43722cfb276d4cc37cac5e8485f723b940c1454524784dd7a05a8efd2a
|
|
| MD5 |
e53ebe9b471b332105530ebe5aa61429
|
|
| BLAKE2b-256 |
5363b031624933c1fa255ae49c56eff7b161078e0e66d15aea320ffe0c245e79
|
File details
Details for the file metripy-0.9.0-py3-none-any.whl.
File metadata
- Download URL: metripy-0.9.0-py3-none-any.whl
- Upload date:
- Size: 167.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dbc39716c038cd7e23f325a84cf84b2a2ebca1d9ed3de9a15542e7ebc5864bba
|
|
| MD5 |
3a8598e574fd8f32975751eac854052c
|
|
| BLAKE2b-256 |
366d4abe5e1a6bd5af88c184a2cfcc00f600e85dccbf4039fcc82b75fbaea7ae
|