# NOTE: This is an edited version of multimetric, that allows you use this module in a programmatically way, it's not intended to replace the original CLI module, and I won't update more this package. For more info, see the original package
### Usage
```
from multimetricprog import calculator
calculator.calculate('''
print("your python code")
''')
```
returns
```
{
"files": {
"fp.py": {
"comment_ratio": 0.0,
"cyclomatic_complexity": 2,
"fanout_external": 0,
"fanout_internal": 0,
"halstead_bugprop": 0.004643856189774725,
"halstead_difficulty": 1.3333333333333333,
"halstead_effort": 18.575424759098897,
"halstead_timerequired": 1.0319680421721609,
"halstead_volume": 13.931568569324174,
"lang": [
"Python"
],
"loc": 1,
"operands_sum": 4,
"operands_uniq": 3,
"operators_sum": 2,
"operators_uniq": 2
}
},
"overall": {
"comment_ratio": 0.0,
"cyclomatic_complexity": 2,
"fanout_external": 0,
"fanout_internal": 0,
"halstead_bugprop": 0.004643856189774725,
"halstead_difficulty": 1.3333333333333333,
"halstead_effort": 18.575424759098897,
"halstead_timerequired": 1.0319680421721609,
"halstead_volume": 13.931568569324174,
"loc": 1,
"maintainability_index": 100,
"operands_sum": 4,
"operands_uniq": 3,
"operators_sum": 2,
"operators_uniq": 2,
"pylint": 100.0,
"tiobe": 99.32835820895522,
"tiobe_compiler": 100.0,
"tiobe_complexity": 95.5223880597015,
"tiobe_coverage": 100.0,
"tiobe_duplication": 100.0,
"tiobe_fanout": 100.0,
"tiobe_functional": 100.0,
"tiobe_security": 100.0,
"tiobe_standard": 100.0
},
"stats": {
"max": {
"comment_ratio": 0.0,
"cyclomatic_complexity": 2,
"fanout_external": 0,
"fanout_internal": 0,
"halstead_bugprop": 0.004643856189774725,
"halstead_difficulty": 1.3333333333333333,
"halstead_effort": 18.575424759098897,
"halstead_timerequired": 1.0319680421721609,
"halstead_volume": 13.931568569324174,
"loc": 1,
"operands_sum": 4,
"operands_uniq": 3,
"operators_sum": 2,
"operators_uniq": 2
},
"mean": {
"comment_ratio": 0.0,
"cyclomatic_complexity": 2,
"fanout_external": 0,
"fanout_internal": 0,
"halstead_bugprop": 0.004643856189774725,
"halstead_difficulty": 1.3333333333333333,
"halstead_effort": 18.575424759098897,
"halstead_timerequired": 1.0319680421721609,
"halstead_volume": 13.931568569324174,
"loc": 1,
"operands_sum": 4,
"operands_uniq": 3,
"operators_sum": 2,
"operators_uniq": 2
},
"median": {
"comment_ratio": 0.0,
"cyclomatic_complexity": 2,
"fanout_external": 0,
"fanout_internal": 0,
"halstead_bugprop": 0.004643856189774725,
"halstead_difficulty": 1.3333333333333333,
"halstead_effort": 18.575424759098897,
"halstead_timerequired": 1.0319680421721609,
"halstead_volume": 13.931568569324174,
"loc": 1,
"operands_sum": 4,
"operands_uniq": 3,
"operators_sum": 2,
"operators_uniq": 2
},
"min": {
"comment_ratio": 0.0,
"cyclomatic_complexity": 2,
"fanout_external": 0,
"fanout_internal": 0,
"halstead_bugprop": 0.004643856189774725,
"halstead_difficulty": 1.3333333333333333,
"halstead_effort": 18.575424759098897,
"halstead_timerequired": 1.0319680421721609,
"halstead_volume": 13.931568569324174,
"loc": 1,
"operands_sum": 4,
"operands_uniq": 3,
"operators_sum": 2,
"operators_uniq": 2
}
}
}
```
### Notes
By default, the filename "fp.py" is hardcoded in order to make the module work, if you're interested, you can fork this and make a better version for this module (also, a better README.md).
#### Item structure
| item | description | range | recommendation |
| --------------------- | ---------------------------------------------- | -------- | -------------- |
| comment_ratio | Comment to Code percentage | 0..100 | > 30.0 |
| cyclomatic_complexity | Cyclomatic complexity according to McCabe | 0..(inf) | < 10 |
| fanout_external | Number imports from out of tree modules | 0..(inf) | |
| fanout_internal | Number imports from same source tree modules | 0..(inf) | |
| halstead_bugprop | Number of delivered bugs according to Halstead | 0..(inf) | < 0.05 |
| halstead_difficulty | Difficulty according to Halstead | 0..(inf) | |
| halstead_effort | Effort according to Halstead | 0..(inf) | |
| halstead_timerequired | Time required to program according to Halstead | 0..(inf) | |
| halstead_volume | Volume according to Halstead | 0..(inf) | |
| lang | list of identified programming languages | list | |
| loc | Lines of code | 1..(inf) | |
| maintainability_index | Maintainability index | 0..100 | > 80.0 |
| operands_sum | Number of used operands | 1..(inf) | |
| operands_uniq | Number of unique used operands | 1..(inf) | |
| operators_sum | Number of used operators | 1..(inf) | |
| operators_uniq | Number of unique used operators | 1..(inf) | |
| pylint | General quality score according to pylint | 0..100 | > 80.0 |
| tiobe_compiler | Compiler warnings score according to TIOBE | 0..100 | > 90.0 |
| tiobe_complexity | Complexity according to TIOBE | 0..100 | > 80.0 |
| tiobe_coverage | Coverage according to TIOBE | 0..100 | > 80.0 |
| tiobe_duplication | Code duplications score according to TIOBE | 0..100 | > 80.0 |
| tiobe_fanout | Fan-Out score according to TIOBE | 0..100 | > 80.0 |
| tiobe_functional | Functional defect score according to TIOBE | 0..100 | > 90.0 |
| tiobe_security | Security score according to TIOBE | 0..100 | > 90.0 |
| tiobe_standard | Language standard score according to TIOBE | 0..100 | > 80.0 |
| tiobe | General quality score according to TIOBE | 0..100 | > 80.0 |
#### Statistics
The item `stats` contains in addition to the above mentioned the following items, which by themselves contain all the items mentioned at [Item structure](#item-structure)
* `max` = the maximum value of all items of the metric
* `mean` = statistical mean over all items of the metric
* `median` = statistical median over all items of the metric
* `min` = the minimum value of all items of the metric
* `sd` = standard deviation over all items of the metric
## Further reading
* [Pygments](http://pygments.org/)
## Bugs & Contribution
Feel free to create issues or pull requests
Raw data
{
"_id": null,
"home_page": "https://github.com/priv-kweihmann/multimetricprog",
"name": "multimetricprog-VadokDev",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "",
"author": "Konrad Weihmann",
"author_email": "Gonzalo Fern\u00e1ndez <gonzalo.fdez06@gmail.com>, Konrad Weihmann <kweihmann@outlook.com>",
"download_url": "https://files.pythonhosted.org/packages/90/64/f35e4fd148bf01e4ae55742a080f0caa98d368e26eb733e136596a125640/multimetricprog_VadokDev-0.0.1.tar.gz",
"platform": null,
"description": "\r\n# NOTE: This is an edited version of multimetric, that allows you use this module in a programmatically way, it's not intended to replace the original CLI module, and I won't update more this package. For more info, see the original package\r\n\r\n### Usage\r\n\r\n```\r\nfrom multimetricprog import calculator\r\n\r\ncalculator.calculate('''\r\nprint(\"your python code\")\r\n''')\r\n\r\n```\r\n\r\nreturns\r\n\r\n```\r\n{\r\n \"files\": {\r\n \"fp.py\": {\r\n \"comment_ratio\": 0.0,\r\n \"cyclomatic_complexity\": 2,\r\n \"fanout_external\": 0,\r\n \"fanout_internal\": 0,\r\n \"halstead_bugprop\": 0.004643856189774725,\r\n \"halstead_difficulty\": 1.3333333333333333,\r\n \"halstead_effort\": 18.575424759098897,\r\n \"halstead_timerequired\": 1.0319680421721609,\r\n \"halstead_volume\": 13.931568569324174,\r\n \"lang\": [\r\n \"Python\"\r\n ],\r\n \"loc\": 1,\r\n \"operands_sum\": 4,\r\n \"operands_uniq\": 3,\r\n \"operators_sum\": 2,\r\n \"operators_uniq\": 2\r\n }\r\n },\r\n \"overall\": {\r\n \"comment_ratio\": 0.0,\r\n \"cyclomatic_complexity\": 2,\r\n \"fanout_external\": 0,\r\n \"fanout_internal\": 0,\r\n \"halstead_bugprop\": 0.004643856189774725,\r\n \"halstead_difficulty\": 1.3333333333333333,\r\n \"halstead_effort\": 18.575424759098897,\r\n \"halstead_timerequired\": 1.0319680421721609,\r\n \"halstead_volume\": 13.931568569324174,\r\n \"loc\": 1,\r\n \"maintainability_index\": 100,\r\n \"operands_sum\": 4,\r\n \"operands_uniq\": 3,\r\n \"operators_sum\": 2,\r\n \"operators_uniq\": 2,\r\n \"pylint\": 100.0,\r\n \"tiobe\": 99.32835820895522,\r\n \"tiobe_compiler\": 100.0,\r\n \"tiobe_complexity\": 95.5223880597015,\r\n \"tiobe_coverage\": 100.0,\r\n \"tiobe_duplication\": 100.0,\r\n \"tiobe_fanout\": 100.0,\r\n \"tiobe_functional\": 100.0,\r\n \"tiobe_security\": 100.0,\r\n \"tiobe_standard\": 100.0\r\n },\r\n \"stats\": {\r\n \"max\": {\r\n \"comment_ratio\": 0.0,\r\n \"cyclomatic_complexity\": 2,\r\n \"fanout_external\": 0,\r\n \"fanout_internal\": 0,\r\n \"halstead_bugprop\": 0.004643856189774725,\r\n \"halstead_difficulty\": 1.3333333333333333,\r\n \"halstead_effort\": 18.575424759098897,\r\n \"halstead_timerequired\": 1.0319680421721609,\r\n \"halstead_volume\": 13.931568569324174,\r\n \"loc\": 1,\r\n \"operands_sum\": 4,\r\n \"operands_uniq\": 3,\r\n \"operators_sum\": 2,\r\n \"operators_uniq\": 2\r\n },\r\n \"mean\": {\r\n \"comment_ratio\": 0.0,\r\n \"cyclomatic_complexity\": 2,\r\n \"fanout_external\": 0,\r\n \"fanout_internal\": 0,\r\n \"halstead_bugprop\": 0.004643856189774725,\r\n \"halstead_difficulty\": 1.3333333333333333,\r\n \"halstead_effort\": 18.575424759098897,\r\n \"halstead_timerequired\": 1.0319680421721609,\r\n \"halstead_volume\": 13.931568569324174,\r\n \"loc\": 1,\r\n \"operands_sum\": 4,\r\n \"operands_uniq\": 3,\r\n \"operators_sum\": 2,\r\n \"operators_uniq\": 2\r\n },\r\n \"median\": {\r\n \"comment_ratio\": 0.0,\r\n \"cyclomatic_complexity\": 2,\r\n \"fanout_external\": 0,\r\n \"fanout_internal\": 0,\r\n \"halstead_bugprop\": 0.004643856189774725,\r\n \"halstead_difficulty\": 1.3333333333333333,\r\n \"halstead_effort\": 18.575424759098897,\r\n \"halstead_timerequired\": 1.0319680421721609,\r\n \"halstead_volume\": 13.931568569324174,\r\n \"loc\": 1,\r\n \"operands_sum\": 4,\r\n \"operands_uniq\": 3,\r\n \"operators_sum\": 2,\r\n \"operators_uniq\": 2\r\n },\r\n \"min\": {\r\n \"comment_ratio\": 0.0,\r\n \"cyclomatic_complexity\": 2,\r\n \"fanout_external\": 0,\r\n \"fanout_internal\": 0,\r\n \"halstead_bugprop\": 0.004643856189774725,\r\n \"halstead_difficulty\": 1.3333333333333333,\r\n \"halstead_effort\": 18.575424759098897,\r\n \"halstead_timerequired\": 1.0319680421721609,\r\n \"halstead_volume\": 13.931568569324174,\r\n \"loc\": 1,\r\n \"operands_sum\": 4,\r\n \"operands_uniq\": 3,\r\n \"operators_sum\": 2,\r\n \"operators_uniq\": 2\r\n }\r\n }\r\n}\r\n```\r\n\r\n### Notes\r\n\r\nBy default, the filename \"fp.py\" is hardcoded in order to make the module work, if you're interested, you can fork this and make a better version for this module (also, a better README.md).\r\n\r\n#### Item structure\r\n\r\n| item | description | range | recommendation |\r\n| --------------------- | ---------------------------------------------- | -------- | -------------- |\r\n| comment_ratio | Comment to Code percentage | 0..100 | > 30.0 |\r\n| cyclomatic_complexity | Cyclomatic complexity according to McCabe | 0..(inf) | < 10 |\r\n| fanout_external | Number imports from out of tree modules | 0..(inf) | |\r\n| fanout_internal | Number imports from same source tree modules | 0..(inf) | |\r\n| halstead_bugprop | Number of delivered bugs according to Halstead | 0..(inf) | < 0.05 |\r\n| halstead_difficulty | Difficulty according to Halstead | 0..(inf) | |\r\n| halstead_effort | Effort according to Halstead | 0..(inf) | |\r\n| halstead_timerequired | Time required to program according to Halstead | 0..(inf) | |\r\n| halstead_volume | Volume according to Halstead | 0..(inf) | |\r\n| lang | list of identified programming languages | list | |\r\n| loc | Lines of code | 1..(inf) | |\r\n| maintainability_index | Maintainability index | 0..100 | > 80.0 |\r\n| operands_sum | Number of used operands | 1..(inf) | |\r\n| operands_uniq | Number of unique used operands | 1..(inf) | |\r\n| operators_sum | Number of used operators | 1..(inf) | |\r\n| operators_uniq | Number of unique used operators | 1..(inf) | |\r\n| pylint | General quality score according to pylint | 0..100 | > 80.0 |\r\n| tiobe_compiler | Compiler warnings score according to TIOBE | 0..100 | > 90.0 |\r\n| tiobe_complexity | Complexity according to TIOBE | 0..100 | > 80.0 |\r\n| tiobe_coverage | Coverage according to TIOBE | 0..100 | > 80.0 |\r\n| tiobe_duplication | Code duplications score according to TIOBE | 0..100 | > 80.0 |\r\n| tiobe_fanout | Fan-Out score according to TIOBE | 0..100 | > 80.0 |\r\n| tiobe_functional | Functional defect score according to TIOBE | 0..100 | > 90.0 |\r\n| tiobe_security | Security score according to TIOBE | 0..100 | > 90.0 |\r\n| tiobe_standard | Language standard score according to TIOBE | 0..100 | > 80.0 |\r\n| tiobe | General quality score according to TIOBE | 0..100 | > 80.0 |\r\n\r\n#### Statistics\r\n\r\nThe item `stats` contains in addition to the above mentioned the following items, which by themselves contain all the items mentioned at [Item structure](#item-structure)\r\n\r\n* `max` = the maximum value of all items of the metric\r\n* `mean` = statistical mean over all items of the metric\r\n* `median` = statistical median over all items of the metric\r\n* `min` = the minimum value of all items of the metric\r\n* `sd` = standard deviation over all items of the metric\r\n\r\n## Further reading\r\n\r\n* [Pygments](http://pygments.org/)\r\n\r\n## Bugs & Contribution\r\n\r\nFeel free to create issues or pull requests\r\n",
"bugtrack_url": null,
"license": "",
"summary": "Calculate code metrics in various languages",
"version": "0.0.1",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "52760e8fed628e82630327b2cbf26a79",
"sha256": "d4855992b40a96a4f62816dc94b6722da3fcaa86fcea0ce50bcc042a2ebd426a"
},
"downloads": -1,
"filename": "multimetricprog_VadokDev-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "52760e8fed628e82630327b2cbf26a79",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 23214,
"upload_time": "2022-12-10T17:44:50",
"upload_time_iso_8601": "2022-12-10T17:44:50.369570Z",
"url": "https://files.pythonhosted.org/packages/9b/7c/ca6e7eac89a93162ad921ef662f5b237d350aa73bc8d5188ca6a51fc11a1/multimetricprog_VadokDev-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "fd60b8019eeaf97fc47a23f7f21238d8",
"sha256": "cced88265621439526362e474cf4d85333ae1fe8a0183e3c32f0173617367555"
},
"downloads": -1,
"filename": "multimetricprog_VadokDev-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "fd60b8019eeaf97fc47a23f7f21238d8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 16287,
"upload_time": "2022-12-10T17:44:54",
"upload_time_iso_8601": "2022-12-10T17:44:54.469638Z",
"url": "https://files.pythonhosted.org/packages/90/64/f35e4fd148bf01e4ae55742a080f0caa98d368e26eb733e136596a125640/multimetricprog_VadokDev-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-10 17:44:54",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "priv-kweihmann",
"github_project": "multimetricprog",
"lcname": "multimetricprog-vadokdev"
}