metripy 0.2.7__tar.gz → 0.2.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of metripy might be problematic. Click here for more details.
- {metripy-0.2.7 → metripy-0.2.8}/LICENSE +1 -1
- {metripy-0.2.7 → metripy-0.2.8}/PKG-INFO +25 -8
- {metripy-0.2.7 → metripy-0.2.8}/README.md +20 -3
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Application/Config/Parser.py +2 -2
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Dependency/Dependency.py +16 -1
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Dependency/Pip/Pip.py +22 -31
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Metric/ProjectMetrics.py +14 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Report/Html/Reporter.py +7 -12
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Report/Json/GitJsonReporter.py +1 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Report/Json/JsonReporter.py +4 -3
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Report/ReporterFactory.py +2 -1
- {metripy-0.2.7 → metripy-0.2.8}/metripy.egg-info/PKG-INFO +25 -8
- {metripy-0.2.7 → metripy-0.2.8}/pyproject.toml +5 -5
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Application/Analyzer.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Application/Application.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Application/Config/Config.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Application/Config/File/ConfigFileReaderFactory.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Application/Config/File/ConfigFileReaderInterface.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Application/Config/File/JsonConfigFileReader.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Application/Config/GitConfig.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Application/Config/ProjectConfig.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Application/Config/ReportConfig.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Application/__init__.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Component/Debug/Debugger.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Component/File/Finder.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Component/Output/CliOutput.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Component/Output/ProgressBar.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Dependency/Composer/Composer.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Dependency/Composer/Packegist.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Dependency/Npm/Npm.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Dependency/Npm/NpmOrg.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Dependency/Pip/PyPi.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Git/GitAnalyzer.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/LangAnalyzer/AbstractLangAnalyzer.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/LangAnalyzer/Generic/HalSteadAnalyzer.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/LangAnalyzer/Generic/__init__.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/LangAnalyzer/Php/PhpAnalyzer.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/LangAnalyzer/Php/PhpBasicAstParser.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/LangAnalyzer/Php/PhpBasicLocAnalyzer.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/LangAnalyzer/Php/PhpHalSteadAnalyzer.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/LangAnalyzer/Python/PythonAnalyzer.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/LangAnalyzer/Typescript/TypescriptAnalyzer.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/LangAnalyzer/Typescript/TypescriptAstParser.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/LangAnalyzer/Typescript/TypescriptBasicComplexityAnalyzer.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/LangAnalyzer/Typescript/TypescriptBasicLocAnalyzer.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/LangAnalyzer/Typescript/TypescriptHalSteadAnalyzer.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/LangAnalyzer/__init__.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Metric/Code/AggregatedMetrics.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Metric/Code/FileMetrics.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Metric/Code/ModuleMetrics.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Metric/Code/SegmentedMetrics.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Metric/FileTree/FileTree.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Metric/FileTree/FileTreeParser.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Metric/Git/GitCodeHotspot.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Metric/Git/GitContributor.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Metric/Git/GitKnowledgeSilo.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Metric/Git/GitMetrics.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Report/Csv/Reporter.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Report/Json/AbstractJsonReporter.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Report/ReporterInterface.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Tree/ClassNode.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Tree/FunctionNode.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/Tree/ModuleNode.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/__init__.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy/metripy.py +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy.egg-info/SOURCES.txt +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy.egg-info/dependency_links.txt +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy.egg-info/entry_points.txt +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy.egg-info/requires.txt +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/metripy.egg-info/top_level.txt +0 -0
- {metripy-0.2.7 → metripy-0.2.8}/setup.cfg +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: metripy
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.8
|
|
4
4
|
Summary: A Python tool to generate multi project, multi language code metric reports
|
|
5
5
|
Author-email: Yannick Zimmermann <yannick.zimmermann@proton.me>
|
|
6
6
|
License: MIT
|
|
7
|
-
Project-URL: Homepage, https://github.com/zimmer-yan/
|
|
8
|
-
Project-URL: Repository, https://github.com/zimmer-yan/
|
|
9
|
-
Project-URL: Documentation, https://github.com/zimmer-yan/
|
|
10
|
-
Project-URL: Bug Tracker, https://github.com/zimmer-yan/
|
|
7
|
+
Project-URL: Homepage, https://github.com/zimmer-yan/metripy
|
|
8
|
+
Project-URL: Repository, https://github.com/zimmer-yan/metripy
|
|
9
|
+
Project-URL: Documentation, https://github.com/zimmer-yan/metripy#readme
|
|
10
|
+
Project-URL: Bug Tracker, https://github.com/zimmer-yan/metripy/issues
|
|
11
11
|
Keywords: code metrics,multi-language,code analysis,git metrics,code visualization,software quality,static analysis,repository insights,developer productivity,codebase health,technical debt,language-agnostic
|
|
12
12
|
Classifier: Development Status :: 3 - Alpha
|
|
13
13
|
Classifier: Intended Audience :: Developers
|
|
@@ -37,7 +37,7 @@ Requires-Dist: poethepoet==0.37.0; extra == "dev"
|
|
|
37
37
|
Requires-Dist: isort==7.0.0; extra == "dev"
|
|
38
38
|
Dynamic: license-file
|
|
39
39
|
|
|
40
|
-
#
|
|
40
|
+
# Metripy
|
|
41
41
|
A multilanguage, multi project code metrics analysis tool.
|
|
42
42
|
|
|
43
43
|
# Languages
|
|
@@ -102,8 +102,8 @@ Sample configuraiton:
|
|
|
102
102
|
"pip": true,
|
|
103
103
|
// looks for base_path/requirements.txt or base_path/pyproject.toml and analyzes dependencies - for python projects
|
|
104
104
|
"reports": {
|
|
105
|
-
"html": "./build/report/
|
|
106
|
-
"json-git": "./build/json-report/
|
|
105
|
+
"html": "./build/report/metripy", // report should be put into this directory
|
|
106
|
+
"json-git": "./build/json-report/metripy-git.json" // file where to put git json report
|
|
107
107
|
// more types of reports TBA
|
|
108
108
|
}
|
|
109
109
|
},
|
|
@@ -111,3 +111,20 @@ Sample configuraiton:
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
```
|
|
114
|
+
|
|
115
|
+
## Configuration for only git stats
|
|
116
|
+
```json
|
|
117
|
+
{
|
|
118
|
+
"configs": {
|
|
119
|
+
"metripy-git": {
|
|
120
|
+
"base_path": "./",
|
|
121
|
+
"git": {
|
|
122
|
+
"branch": "main"
|
|
123
|
+
},
|
|
124
|
+
"reports": {
|
|
125
|
+
"json-git": "./build/json-report/metripy-git.json"
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
```
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Metripy
|
|
2
2
|
A multilanguage, multi project code metrics analysis tool.
|
|
3
3
|
|
|
4
4
|
# Languages
|
|
@@ -63,8 +63,8 @@ Sample configuraiton:
|
|
|
63
63
|
"pip": true,
|
|
64
64
|
// looks for base_path/requirements.txt or base_path/pyproject.toml and analyzes dependencies - for python projects
|
|
65
65
|
"reports": {
|
|
66
|
-
"html": "./build/report/
|
|
67
|
-
"json-git": "./build/json-report/
|
|
66
|
+
"html": "./build/report/metripy", // report should be put into this directory
|
|
67
|
+
"json-git": "./build/json-report/metripy-git.json" // file where to put git json report
|
|
68
68
|
// more types of reports TBA
|
|
69
69
|
}
|
|
70
70
|
},
|
|
@@ -72,3 +72,20 @@ Sample configuraiton:
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
```
|
|
75
|
+
|
|
76
|
+
## Configuration for only git stats
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"configs": {
|
|
80
|
+
"metripy-git": {
|
|
81
|
+
"base_path": "./",
|
|
82
|
+
"git": {
|
|
83
|
+
"branch": "main"
|
|
84
|
+
},
|
|
85
|
+
"reports": {
|
|
86
|
+
"json-git": "./build/json-report/metripy-git.json"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
```
|
|
@@ -9,8 +9,8 @@ class Parser:
|
|
|
9
9
|
def parse(self, argv: list[str]) -> Config:
|
|
10
10
|
config = Config()
|
|
11
11
|
|
|
12
|
-
if argv[0] == "
|
|
13
|
-
# TODO, fix when path ends with
|
|
12
|
+
if argv[0] == "metripy.py" or argv[0] == "metripy":
|
|
13
|
+
# TODO, fix when path ends with metripy.py
|
|
14
14
|
pass
|
|
15
15
|
argv.pop(0)
|
|
16
16
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
from typing import Self
|
|
2
|
+
|
|
1
3
|
class Dependency:
|
|
2
|
-
def __init__(self, name: str, version: str):
|
|
4
|
+
def __init__(self, name: str, version: str|None):
|
|
3
5
|
self.name = name
|
|
4
6
|
self.version = version
|
|
5
7
|
self.latest: str = ""
|
|
@@ -28,3 +30,16 @@ class Dependency:
|
|
|
28
30
|
"downloads_monthly": self.downloads_monthly,
|
|
29
31
|
"licenses": ",".join(self.license),
|
|
30
32
|
}
|
|
33
|
+
|
|
34
|
+
@staticmethod
|
|
35
|
+
def get_lisence_distribution(dependencies: list[Self]) -> dict[str, int]:
|
|
36
|
+
license_by_type = {}
|
|
37
|
+
|
|
38
|
+
dependency: Dependency
|
|
39
|
+
for dependency in dependencies:
|
|
40
|
+
for license_name in dependency.license:
|
|
41
|
+
if license_name not in license_by_type.keys():
|
|
42
|
+
license_by_type[license_name] = 0
|
|
43
|
+
license_by_type[license_name] += 1
|
|
44
|
+
|
|
45
|
+
return license_by_type
|
|
@@ -23,47 +23,38 @@ class Pip:
|
|
|
23
23
|
return [item for item in packages if item is not None]
|
|
24
24
|
|
|
25
25
|
def get_from_requirements_txt(self, path: str) -> list[Dependency]:
|
|
26
|
-
requirements = []
|
|
27
|
-
|
|
28
|
-
pattern = re.compile(r"([a-zA-Z0-9_\-]+)([<>=!~]+[^\s]+)?")
|
|
29
26
|
with open(os.path.join(path, "requirements.txt"), "r") as file:
|
|
30
27
|
lines = file.readlines()
|
|
31
|
-
|
|
28
|
+
return self._parse_dependencies(lines)
|
|
32
29
|
|
|
33
|
-
|
|
34
|
-
if line and not line.startswith("#"):
|
|
35
|
-
match = pattern.match(line)
|
|
36
|
-
if match:
|
|
37
|
-
name = match.group(1)
|
|
38
|
-
version = match.group(2) if match.group(2) else None
|
|
39
|
-
requirements.append(Dependency(name, version))
|
|
40
|
-
return requirements
|
|
30
|
+
return []
|
|
41
31
|
|
|
42
32
|
def get_from_pyproject_toml(self, path: str) -> list[Dependency]:
|
|
43
|
-
dependencies = []
|
|
44
|
-
|
|
45
33
|
with open(os.path.join(path, "pyproject.toml"), "r") as f:
|
|
46
34
|
data = toml.load(f)
|
|
47
35
|
|
|
48
36
|
# For PEP 621 / setuptools projects
|
|
49
37
|
if "project" in data:
|
|
50
38
|
deps = data["project"].get("dependencies", [])
|
|
51
|
-
|
|
52
|
-
# dep is a string like "requests>=2.32.5"
|
|
53
|
-
# You can split it if needed
|
|
54
|
-
if "==" in dep:
|
|
55
|
-
name, version = dep.split("==")
|
|
56
|
-
elif ">=" in dep:
|
|
57
|
-
name, version = dep.split(">=")
|
|
58
|
-
else:
|
|
59
|
-
name, version = dep, None
|
|
60
|
-
dependencies.append(
|
|
61
|
-
Dependency(name.strip(), version.strip() if version else None)
|
|
62
|
-
)
|
|
63
|
-
|
|
64
|
-
return dependencies
|
|
39
|
+
return self._parse_dependencies(deps)
|
|
65
40
|
|
|
41
|
+
return []
|
|
42
|
+
|
|
43
|
+
def _parse_dependencies(self, lines: list[str]) -> list[Dependency]:
|
|
44
|
+
dependencies = []
|
|
45
|
+
for dep in lines:
|
|
46
|
+
dep = dep.strip()
|
|
47
|
+
if not dep or dep.startswith("#"):
|
|
48
|
+
continue
|
|
49
|
+
# dep is a string like "requests>=2.32.5"
|
|
50
|
+
if "==" in dep:
|
|
51
|
+
name, version = dep.split("==")
|
|
52
|
+
elif ">=" in dep:
|
|
53
|
+
name, version = dep.split(">=")
|
|
54
|
+
else:
|
|
55
|
+
name, version = dep, None
|
|
56
|
+
dependencies.append(
|
|
57
|
+
Dependency(name.strip(), version.strip() if version else None)
|
|
58
|
+
)
|
|
66
59
|
|
|
67
|
-
|
|
68
|
-
pip = Pip()
|
|
69
|
-
pip.get_dependencies("./")
|
|
60
|
+
return dependencies
|
|
@@ -3,6 +3,7 @@ from metripy.Metric.Code.AggregatedMetrics import AggregatedMetrics
|
|
|
3
3
|
from metripy.Metric.Code.FileMetrics import FileMetrics
|
|
4
4
|
from metripy.Metric.Code.SegmentedMetrics import SegmentedMetrics
|
|
5
5
|
from metripy.Metric.Git.GitMetrics import GitMetrics
|
|
6
|
+
from metripy.Dependency.Dependency import Dependency
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
class ProjectMetrics:
|
|
@@ -53,3 +54,16 @@ class ProjectMetrics:
|
|
|
53
54
|
|
|
54
55
|
def _avg(self, items: list[float | int]) -> float:
|
|
55
56
|
return sum(items) / len(items)
|
|
57
|
+
|
|
58
|
+
def to_dict(self) -> dict:
|
|
59
|
+
data = {
|
|
60
|
+
"file_metrics": [m.to_dict() for m in self.file_metrics],
|
|
61
|
+
"aggregated": self.total_code_metrics.to_dict(),
|
|
62
|
+
"aggregated_segmented": self.total_code_metrics.to_dict_segmentation(),
|
|
63
|
+
}
|
|
64
|
+
if self.git_metrics:
|
|
65
|
+
data["git_metrics"] = self.git_metrics.to_dict()
|
|
66
|
+
if self.dependencies:
|
|
67
|
+
data["dependencies"] = [d.to_dict() for d in self.dependencies]
|
|
68
|
+
data["license_distribution"] = Dependency.get_lisence_distribution(self.dependencies)
|
|
69
|
+
return data
|
|
@@ -10,6 +10,7 @@ from metripy.Component.Output.CliOutput import CliOutput
|
|
|
10
10
|
from metripy.Metric.FileTree.FileTreeParser import FileTreeParser
|
|
11
11
|
from metripy.Metric.ProjectMetrics import ProjectMetrics
|
|
12
12
|
from metripy.Report.ReporterInterface import ReporterInterface
|
|
13
|
+
from metripy.Dependency.Dependency import Dependency
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
class Reporter(ReporterInterface):
|
|
@@ -71,10 +72,10 @@ class Reporter(ReporterInterface):
|
|
|
71
72
|
"segmentation_data": json.dumps(
|
|
72
73
|
metrics.total_code_metrics.to_dict_segmentation(), indent=4
|
|
73
74
|
),
|
|
74
|
-
"project_name": "
|
|
75
|
+
"project_name": "Metripy",
|
|
75
76
|
"last_updated": datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
|
|
76
77
|
"date": datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
|
|
77
|
-
"author": "
|
|
78
|
+
"author": "Metripy",
|
|
78
79
|
"version": "1.0.0",
|
|
79
80
|
},
|
|
80
81
|
)
|
|
@@ -107,14 +108,8 @@ class Reporter(ReporterInterface):
|
|
|
107
108
|
|
|
108
109
|
dependencies = metrics.dependencies if metrics.dependencies is not None else []
|
|
109
110
|
|
|
110
|
-
license_by_type = {}
|
|
111
|
-
|
|
112
111
|
# TODO render a pie chart
|
|
113
|
-
|
|
114
|
-
for license_name in dependency.license:
|
|
115
|
-
if license_name not in license_by_type.keys():
|
|
116
|
-
license_by_type[license_name] = 0
|
|
117
|
-
license_by_type[license_name] += 1
|
|
112
|
+
license_by_type = Dependency.get_lisence_distribution(dependencies)
|
|
118
113
|
|
|
119
114
|
print(json.dumps(license_by_type, indent=2))
|
|
120
115
|
|
|
@@ -122,7 +117,7 @@ class Reporter(ReporterInterface):
|
|
|
122
117
|
"dependencies.html",
|
|
123
118
|
{
|
|
124
119
|
"dependencies": [d.to_dict() for d in dependencies],
|
|
125
|
-
"project_name": "
|
|
120
|
+
"project_name": "Metripy",
|
|
126
121
|
"last_updated": datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
|
|
127
122
|
},
|
|
128
123
|
)
|
|
@@ -148,7 +143,7 @@ class Reporter(ReporterInterface):
|
|
|
148
143
|
{
|
|
149
144
|
"filetree": json.dumps(filetree.to_dict()),
|
|
150
145
|
"file_details": json.dumps(file_details),
|
|
151
|
-
"project_name": "
|
|
146
|
+
"project_name": "Metripy",
|
|
152
147
|
"last_updated": datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
|
|
153
148
|
},
|
|
154
149
|
)
|
|
@@ -194,7 +189,7 @@ class Reporter(ReporterInterface):
|
|
|
194
189
|
"git_hotspots_data": metrics.git_metrics.get_hotspots_list()[
|
|
195
190
|
:10
|
|
196
191
|
], # hotspots list
|
|
197
|
-
"project_name": "
|
|
192
|
+
"project_name": "Metripy",
|
|
198
193
|
"last_updated": metrics.git_metrics.get_analysis_start_date(),
|
|
199
194
|
}
|
|
200
195
|
),
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
from metripy.Application.Config.Config import Config
|
|
2
2
|
from metripy.Component.Output.CliOutput import CliOutput
|
|
3
3
|
from metripy.Metric.ProjectMetrics import ProjectMetrics
|
|
4
|
+
from metripy.Report.Json.AbstractJsonReporter import AbstractJsonReporter
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
class JsonReporter:
|
|
6
|
+
class JsonReporter(AbstractJsonReporter):
|
|
7
7
|
def __init__(self, config: Config, output: CliOutput):
|
|
8
8
|
self.config = config
|
|
9
9
|
self.output = output
|
|
10
10
|
|
|
11
11
|
def generate(self, metrics: ProjectMetrics):
|
|
12
|
-
|
|
12
|
+
self.put_data(metrics.to_dict())
|
|
13
|
+
self.output.writeln(f"<success>Create json report in {self.config.path}</success>")
|
|
@@ -3,6 +3,7 @@ from metripy.Component.Output.CliOutput import CliOutput
|
|
|
3
3
|
from metripy.Report import ReporterInterface
|
|
4
4
|
from metripy.Report.Html.Reporter import Reporter as HtmlReporter
|
|
5
5
|
from metripy.Report.Json.GitJsonReporter import GitJsonReporter
|
|
6
|
+
from metripy.Report.Json.JsonReporter import JsonReporter
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
class ReporterFactory:
|
|
@@ -11,7 +12,7 @@ class ReporterFactory:
|
|
|
11
12
|
if config.type == "html":
|
|
12
13
|
return HtmlReporter(config, output)
|
|
13
14
|
elif config.type == "json":
|
|
14
|
-
|
|
15
|
+
return JsonReporter(config, output)
|
|
15
16
|
elif config.type == "csv":
|
|
16
17
|
raise NotImplementedError
|
|
17
18
|
elif config.type == "cli":
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: metripy
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.8
|
|
4
4
|
Summary: A Python tool to generate multi project, multi language code metric reports
|
|
5
5
|
Author-email: Yannick Zimmermann <yannick.zimmermann@proton.me>
|
|
6
6
|
License: MIT
|
|
7
|
-
Project-URL: Homepage, https://github.com/zimmer-yan/
|
|
8
|
-
Project-URL: Repository, https://github.com/zimmer-yan/
|
|
9
|
-
Project-URL: Documentation, https://github.com/zimmer-yan/
|
|
10
|
-
Project-URL: Bug Tracker, https://github.com/zimmer-yan/
|
|
7
|
+
Project-URL: Homepage, https://github.com/zimmer-yan/metripy
|
|
8
|
+
Project-URL: Repository, https://github.com/zimmer-yan/metripy
|
|
9
|
+
Project-URL: Documentation, https://github.com/zimmer-yan/metripy#readme
|
|
10
|
+
Project-URL: Bug Tracker, https://github.com/zimmer-yan/metripy/issues
|
|
11
11
|
Keywords: code metrics,multi-language,code analysis,git metrics,code visualization,software quality,static analysis,repository insights,developer productivity,codebase health,technical debt,language-agnostic
|
|
12
12
|
Classifier: Development Status :: 3 - Alpha
|
|
13
13
|
Classifier: Intended Audience :: Developers
|
|
@@ -37,7 +37,7 @@ Requires-Dist: poethepoet==0.37.0; extra == "dev"
|
|
|
37
37
|
Requires-Dist: isort==7.0.0; extra == "dev"
|
|
38
38
|
Dynamic: license-file
|
|
39
39
|
|
|
40
|
-
#
|
|
40
|
+
# Metripy
|
|
41
41
|
A multilanguage, multi project code metrics analysis tool.
|
|
42
42
|
|
|
43
43
|
# Languages
|
|
@@ -102,8 +102,8 @@ Sample configuraiton:
|
|
|
102
102
|
"pip": true,
|
|
103
103
|
// looks for base_path/requirements.txt or base_path/pyproject.toml and analyzes dependencies - for python projects
|
|
104
104
|
"reports": {
|
|
105
|
-
"html": "./build/report/
|
|
106
|
-
"json-git": "./build/json-report/
|
|
105
|
+
"html": "./build/report/metripy", // report should be put into this directory
|
|
106
|
+
"json-git": "./build/json-report/metripy-git.json" // file where to put git json report
|
|
107
107
|
// more types of reports TBA
|
|
108
108
|
}
|
|
109
109
|
},
|
|
@@ -111,3 +111,20 @@ Sample configuraiton:
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
```
|
|
114
|
+
|
|
115
|
+
## Configuration for only git stats
|
|
116
|
+
```json
|
|
117
|
+
{
|
|
118
|
+
"configs": {
|
|
119
|
+
"metripy-git": {
|
|
120
|
+
"base_path": "./",
|
|
121
|
+
"git": {
|
|
122
|
+
"branch": "main"
|
|
123
|
+
},
|
|
124
|
+
"reports": {
|
|
125
|
+
"json-git": "./build/json-report/metripy-git.json"
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
```
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "metripy"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.8"
|
|
8
8
|
description = "A Python tool to generate multi project, multi language code metric reports"
|
|
9
9
|
authors = [
|
|
10
10
|
{name = "Yannick Zimmermann", email = "yannick.zimmermann@proton.me"}
|
|
@@ -59,10 +59,10 @@ dev = [
|
|
|
59
59
|
]
|
|
60
60
|
|
|
61
61
|
[project.urls]
|
|
62
|
-
Homepage = "https://github.com/zimmer-yan/
|
|
63
|
-
Repository = "https://github.com/zimmer-yan/
|
|
64
|
-
Documentation = "https://github.com/zimmer-yan/
|
|
65
|
-
"Bug Tracker" = "https://github.com/zimmer-yan/
|
|
62
|
+
Homepage = "https://github.com/zimmer-yan/metripy"
|
|
63
|
+
Repository = "https://github.com/zimmer-yan/metripy"
|
|
64
|
+
Documentation = "https://github.com/zimmer-yan/metripy#readme"
|
|
65
|
+
"Bug Tracker" = "https://github.com/zimmer-yan/metripy/issues"
|
|
66
66
|
|
|
67
67
|
[project.scripts]
|
|
68
68
|
metripy="metripy.metripy:main"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{metripy-0.2.7 → metripy-0.2.8}/metripy/Application/Config/File/ConfigFileReaderInterface.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{metripy-0.2.7 → metripy-0.2.8}/metripy/LangAnalyzer/Typescript/TypescriptBasicComplexityAnalyzer.py
RENAMED
|
File without changes
|
{metripy-0.2.7 → metripy-0.2.8}/metripy/LangAnalyzer/Typescript/TypescriptBasicLocAnalyzer.py
RENAMED
|
File without changes
|
{metripy-0.2.7 → metripy-0.2.8}/metripy/LangAnalyzer/Typescript/TypescriptHalSteadAnalyzer.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|