metripy 0.3.1__tar.gz → 0.3.3__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.

Files changed (103) hide show
  1. metripy-0.3.3/CHANGELOG.md +53 -0
  2. metripy-0.3.3/MANIFEST.in +7 -0
  3. {metripy-0.3.1 → metripy-0.3.3}/PKG-INFO +2 -1
  4. {metripy-0.3.1 → metripy-0.3.3}/metripy/Report/Html/Reporter.py +34 -7
  5. metripy-0.3.3/metripy/templates/html_report/css/styles.css +1386 -0
  6. metripy-0.3.3/metripy/templates/html_report/dependencies.html +441 -0
  7. metripy-0.3.3/metripy/templates/html_report/files.html +1080 -0
  8. metripy-0.3.3/metripy/templates/html_report/git_analysis.html +325 -0
  9. metripy-0.3.3/metripy/templates/html_report/images/logo.svg +31 -0
  10. metripy-0.3.3/metripy/templates/html_report/index.html +385 -0
  11. metripy-0.3.3/metripy/templates/html_report/js/charts.js +313 -0
  12. metripy-0.3.3/metripy/templates/html_report/js/dashboard.js +546 -0
  13. metripy-0.3.3/metripy/templates/html_report/js/git_analysis.js +383 -0
  14. metripy-0.3.3/metripy/templates/html_report/top_offenders.html +267 -0
  15. metripy-0.3.3/metripy/templates/html_report/trends.html +468 -0
  16. {metripy-0.3.1 → metripy-0.3.3}/metripy.egg-info/PKG-INFO +2 -1
  17. {metripy-0.3.1 → metripy-0.3.3}/metripy.egg-info/SOURCES.txt +14 -1
  18. {metripy-0.3.1 → metripy-0.3.3}/metripy.egg-info/requires.txt +1 -0
  19. {metripy-0.3.1 → metripy-0.3.3}/pyproject.toml +15 -2
  20. {metripy-0.3.1 → metripy-0.3.3}/LICENSE +0 -0
  21. {metripy-0.3.1 → metripy-0.3.3}/README.md +0 -0
  22. {metripy-0.3.1 → metripy-0.3.3}/metripy/Application/Analyzer.py +0 -0
  23. {metripy-0.3.1 → metripy-0.3.3}/metripy/Application/Application.py +0 -0
  24. {metripy-0.3.1 → metripy-0.3.3}/metripy/Application/Config/Config.py +0 -0
  25. {metripy-0.3.1 → metripy-0.3.3}/metripy/Application/Config/File/ConfigFileReaderFactory.py +0 -0
  26. {metripy-0.3.1 → metripy-0.3.3}/metripy/Application/Config/File/ConfigFileReaderInterface.py +0 -0
  27. {metripy-0.3.1 → metripy-0.3.3}/metripy/Application/Config/File/JsonConfigFileReader.py +0 -0
  28. {metripy-0.3.1 → metripy-0.3.3}/metripy/Application/Config/File/YamlConfigFileReader.py +0 -0
  29. {metripy-0.3.1 → metripy-0.3.3}/metripy/Application/Config/GitConfig.py +0 -0
  30. {metripy-0.3.1 → metripy-0.3.3}/metripy/Application/Config/Parser.py +0 -0
  31. {metripy-0.3.1 → metripy-0.3.3}/metripy/Application/Config/ProjectConfig.py +0 -0
  32. {metripy-0.3.1 → metripy-0.3.3}/metripy/Application/Config/ReportConfig.py +0 -0
  33. {metripy-0.3.1 → metripy-0.3.3}/metripy/Application/Info.py +0 -0
  34. {metripy-0.3.1 → metripy-0.3.3}/metripy/Application/__init__.py +0 -0
  35. {metripy-0.3.1 → metripy-0.3.3}/metripy/Component/Debug/Debugger.py +0 -0
  36. {metripy-0.3.1 → metripy-0.3.3}/metripy/Component/File/Finder.py +0 -0
  37. {metripy-0.3.1 → metripy-0.3.3}/metripy/Component/Output/CliOutput.py +0 -0
  38. {metripy-0.3.1 → metripy-0.3.3}/metripy/Component/Output/ProgressBar.py +0 -0
  39. {metripy-0.3.1 → metripy-0.3.3}/metripy/Dependency/Composer/Composer.py +0 -0
  40. {metripy-0.3.1 → metripy-0.3.3}/metripy/Dependency/Composer/Packegist.py +0 -0
  41. {metripy-0.3.1 → metripy-0.3.3}/metripy/Dependency/Dependency.py +0 -0
  42. {metripy-0.3.1 → metripy-0.3.3}/metripy/Dependency/Npm/Npm.py +0 -0
  43. {metripy-0.3.1 → metripy-0.3.3}/metripy/Dependency/Npm/NpmOrg.py +0 -0
  44. {metripy-0.3.1 → metripy-0.3.3}/metripy/Dependency/Pip/Pip.py +0 -0
  45. {metripy-0.3.1 → metripy-0.3.3}/metripy/Dependency/Pip/PyPi.py +0 -0
  46. {metripy-0.3.1 → metripy-0.3.3}/metripy/Git/GitAnalyzer.py +0 -0
  47. {metripy-0.3.1 → metripy-0.3.3}/metripy/Import/Json/JsonImporter.py +0 -0
  48. {metripy-0.3.1 → metripy-0.3.3}/metripy/LangAnalyzer/AbstractLangAnalyzer.py +0 -0
  49. {metripy-0.3.1 → metripy-0.3.3}/metripy/LangAnalyzer/Generic/HalSteadAnalyzer.py +0 -0
  50. {metripy-0.3.1 → metripy-0.3.3}/metripy/LangAnalyzer/Generic/__init__.py +0 -0
  51. {metripy-0.3.1 → metripy-0.3.3}/metripy/LangAnalyzer/Php/PhpAnalyzer.py +0 -0
  52. {metripy-0.3.1 → metripy-0.3.3}/metripy/LangAnalyzer/Php/PhpBasicAstParser.py +0 -0
  53. {metripy-0.3.1 → metripy-0.3.3}/metripy/LangAnalyzer/Php/PhpBasicLocAnalyzer.py +0 -0
  54. {metripy-0.3.1 → metripy-0.3.3}/metripy/LangAnalyzer/Php/PhpHalSteadAnalyzer.py +0 -0
  55. {metripy-0.3.1 → metripy-0.3.3}/metripy/LangAnalyzer/Python/PythonAnalyzer.py +0 -0
  56. {metripy-0.3.1 → metripy-0.3.3}/metripy/LangAnalyzer/Python/PythonHalSteadAnalyzer.py +0 -0
  57. {metripy-0.3.1 → metripy-0.3.3}/metripy/LangAnalyzer/Typescript/TypescriptAnalyzer.py +0 -0
  58. {metripy-0.3.1 → metripy-0.3.3}/metripy/LangAnalyzer/Typescript/TypescriptAstParser.py +0 -0
  59. {metripy-0.3.1 → metripy-0.3.3}/metripy/LangAnalyzer/Typescript/TypescriptBasicComplexityAnalyzer.py +0 -0
  60. {metripy-0.3.1 → metripy-0.3.3}/metripy/LangAnalyzer/Typescript/TypescriptBasicLocAnalyzer.py +0 -0
  61. {metripy-0.3.1 → metripy-0.3.3}/metripy/LangAnalyzer/Typescript/TypescriptHalSteadAnalyzer.py +0 -0
  62. {metripy-0.3.1 → metripy-0.3.3}/metripy/LangAnalyzer/__init__.py +0 -0
  63. {metripy-0.3.1 → metripy-0.3.3}/metripy/Metric/Code/AggregatedMetrics.py +0 -0
  64. {metripy-0.3.1 → metripy-0.3.3}/metripy/Metric/Code/FileMetrics.py +0 -0
  65. {metripy-0.3.1 → metripy-0.3.3}/metripy/Metric/Code/ModuleMetrics.py +0 -0
  66. {metripy-0.3.1 → metripy-0.3.3}/metripy/Metric/Code/SegmentedMetrics.py +0 -0
  67. {metripy-0.3.1 → metripy-0.3.3}/metripy/Metric/Code/Segmentor.py +0 -0
  68. {metripy-0.3.1 → metripy-0.3.3}/metripy/Metric/FileTree/FileTree.py +0 -0
  69. {metripy-0.3.1 → metripy-0.3.3}/metripy/Metric/FileTree/FileTreeParser.py +0 -0
  70. {metripy-0.3.1 → metripy-0.3.3}/metripy/Metric/Git/GitCodeHotspot.py +0 -0
  71. {metripy-0.3.1 → metripy-0.3.3}/metripy/Metric/Git/GitContributor.py +0 -0
  72. {metripy-0.3.1 → metripy-0.3.3}/metripy/Metric/Git/GitKnowledgeSilo.py +0 -0
  73. {metripy-0.3.1 → metripy-0.3.3}/metripy/Metric/Git/GitMetrics.py +0 -0
  74. {metripy-0.3.1 → metripy-0.3.3}/metripy/Metric/ProjectMetrics.py +0 -0
  75. {metripy-0.3.1 → metripy-0.3.3}/metripy/Metric/Trend/AggregatedTrendMetric.py +0 -0
  76. {metripy-0.3.1 → metripy-0.3.3}/metripy/Metric/Trend/ClassTrendMetric.py +0 -0
  77. {metripy-0.3.1 → metripy-0.3.3}/metripy/Metric/Trend/FileTrendMetric.py +0 -0
  78. {metripy-0.3.1 → metripy-0.3.3}/metripy/Metric/Trend/FunctionTrendMetric.py +0 -0
  79. {metripy-0.3.1 → metripy-0.3.3}/metripy/Metric/Trend/SegmentedTrendMetric.py +0 -0
  80. {metripy-0.3.1 → metripy-0.3.3}/metripy/Report/Csv/Reporter.py +0 -0
  81. {metripy-0.3.1 → metripy-0.3.3}/metripy/Report/Html/DependencyPageRenderer.py +0 -0
  82. {metripy-0.3.1 → metripy-0.3.3}/metripy/Report/Html/FilesPageRenderer.py +0 -0
  83. {metripy-0.3.1 → metripy-0.3.3}/metripy/Report/Html/GitAnalysisPageRenderer.py +0 -0
  84. {metripy-0.3.1 → metripy-0.3.3}/metripy/Report/Html/IndexPageRenderer.py +0 -0
  85. {metripy-0.3.1 → metripy-0.3.3}/metripy/Report/Html/PageRenderer.py +0 -0
  86. {metripy-0.3.1 → metripy-0.3.3}/metripy/Report/Html/PageRendererFactory.py +0 -0
  87. {metripy-0.3.1 → metripy-0.3.3}/metripy/Report/Html/TopOffendersPageRenderer.py +0 -0
  88. {metripy-0.3.1 → metripy-0.3.3}/metripy/Report/Html/TrendsPageRenderer.py +0 -0
  89. {metripy-0.3.1 → metripy-0.3.3}/metripy/Report/Json/AbstractJsonReporter.py +0 -0
  90. {metripy-0.3.1 → metripy-0.3.3}/metripy/Report/Json/GitJsonReporter.py +0 -0
  91. {metripy-0.3.1 → metripy-0.3.3}/metripy/Report/Json/JsonReporter.py +0 -0
  92. {metripy-0.3.1 → metripy-0.3.3}/metripy/Report/ReporterFactory.py +0 -0
  93. {metripy-0.3.1 → metripy-0.3.3}/metripy/Report/ReporterInterface.py +0 -0
  94. {metripy-0.3.1 → metripy-0.3.3}/metripy/Tree/ClassNode.py +0 -0
  95. {metripy-0.3.1 → metripy-0.3.3}/metripy/Tree/FunctionNode.py +0 -0
  96. {metripy-0.3.1 → metripy-0.3.3}/metripy/Tree/ModuleNode.py +0 -0
  97. {metripy-0.3.1 → metripy-0.3.3}/metripy/Trend/TrendAnalyzer.py +0 -0
  98. {metripy-0.3.1 → metripy-0.3.3}/metripy/__init__.py +0 -0
  99. {metripy-0.3.1 → metripy-0.3.3}/metripy/metripy.py +0 -0
  100. {metripy-0.3.1 → metripy-0.3.3}/metripy.egg-info/dependency_links.txt +0 -0
  101. {metripy-0.3.1 → metripy-0.3.3}/metripy.egg-info/entry_points.txt +0 -0
  102. {metripy-0.3.1 → metripy-0.3.3}/metripy.egg-info/top_level.txt +0 -0
  103. {metripy-0.3.1 → metripy-0.3.3}/setup.cfg +0 -0
@@ -0,0 +1,53 @@
1
+ # v0.3.3
2
+ - Fix missing templates after install
3
+
4
+ # v0.3.2
5
+ - Add missing dependency
6
+
7
+ # v0.3.1
8
+ - Add yaml config support
9
+ - Clean up html page rendering
10
+
11
+ # v0.3.0
12
+ - Add trends
13
+
14
+ # v0.2.8
15
+ - Fix version status in pip analysis
16
+ - Add json report
17
+
18
+ # v0.2.7
19
+ - fix files
20
+
21
+ # v0.2.6
22
+ - Fully move namespace, fix script
23
+
24
+ # v0.2.5
25
+ - Change name of project to metripy
26
+
27
+ # v0.2.4
28
+ - Change name of project to py_codemetrics
29
+
30
+ # v0.2.3
31
+ - Fix test action by dropping 3.9, 3.10 support
32
+
33
+ # v0.2.2
34
+ - Fix test action
35
+
36
+ # v0.2.1
37
+ - Added git metrics json reporting
38
+ - Added some first tests
39
+ - Added github actions
40
+
41
+ # v0.2.0
42
+ - Added code analysis of typescript
43
+ - Added npm dependencies analysis
44
+
45
+ # v0.1.0
46
+ - Added main structure
47
+ - Added config loading and parsing
48
+ - Added code analysis of python
49
+ - Added code analysis of php
50
+ - Added git analysis
51
+ - Added composer dependencies analysis
52
+ - Added pip dependencies analysis
53
+ - Added html report dashboard, file insights, git insights, dependency insights
@@ -0,0 +1,7 @@
1
+ recursive-include metripy/templates *
2
+ include metripy/logo.svg
3
+ include logo.svg
4
+ include README.md
5
+ include LICENSE
6
+ include CHANGELOG.md
7
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metripy
3
- Version: 0.3.1
3
+ Version: 0.3.3
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
@@ -26,6 +26,7 @@ Requires-Dist: packaging==25.0
26
26
  Requires-Dist: toml==0.10.2
27
27
  Requires-Dist: tree-sitter==0.21.3
28
28
  Requires-Dist: tree-sitter-languages==1.10.2
29
+ Requires-Dist: PyYAML==6.0.3
29
30
  Provides-Extra: dev
30
31
  Requires-Dist: pytest>=7.0.0; extra == "dev"
31
32
  Requires-Dist: pytest-cov==7.0.0; extra == "dev"
@@ -1,6 +1,8 @@
1
1
  import os
2
2
  import shutil
3
+ import sys
3
4
  from datetime import datetime
5
+ from pathlib import Path
4
6
 
5
7
 
6
8
  from metripy.Application.Config.ReportConfig import ReportConfig
@@ -16,7 +18,16 @@ class Reporter(ReporterInterface):
16
18
  ):
17
19
  self.config: ReportConfig = config
18
20
  self.output = output
19
- self.template_dir = os.path.join(os.getcwd(), "templates/html_report")
21
+
22
+ # Find templates directory - works both in development and when installed
23
+ template_dir = self._find_template_dir()
24
+ if not template_dir.exists():
25
+ raise FileNotFoundError(
26
+ f"Could not find templates directory. Searched in: "
27
+ f"{template_dir}"
28
+ )
29
+
30
+ self.template_dir = str(template_dir)
20
31
  self.project_name = project_name
21
32
 
22
33
  self.page_renderer_factory = PageRendererFactory(
@@ -27,6 +38,28 @@ class Reporter(ReporterInterface):
27
38
  "project_name": project_name,
28
39
  "last_updated": datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
29
40
  }
41
+
42
+ def _find_template_dir(self) -> Path:
43
+ """Find the templates directory, checking multiple possible locations"""
44
+ package_dir = Path(__file__).parent.parent.parent # metripy package root
45
+
46
+ # List of possible locations to check
47
+ possible_locations = [
48
+ # Development: templates at project root
49
+ package_dir.parent / "templates" / "html_report",
50
+ # Alternative: templates inside metripy package
51
+ package_dir / "templates" / "html_report",
52
+ # System install location
53
+ Path(sys.prefix) / "share" / "metripy" / "templates" / "html_report",
54
+ # Fallback to cwd (for development)
55
+ Path.cwd() / "metripy" / "templates" / "html_report",
56
+ ]
57
+
58
+ for location in possible_locations:
59
+ if location.exists() and (location / "index.html").exists():
60
+ return location
61
+
62
+ return possible_locations[0]
30
63
 
31
64
  def generate(self, metrics: ProjectMetrics):
32
65
 
@@ -63,12 +96,6 @@ class Reporter(ReporterInterface):
63
96
  )
64
97
  # shutil.copytree(os.path.join(self.template_dir, "fonts"), os.path.join(self.config.path, "fonts"), dirs_exist_ok=True)
65
98
 
66
- # copy logo, lies 2 down from the templates directory
67
- shutil.copy(
68
- os.path.join(self.template_dir, "../..", "logo.svg"),
69
- os.path.join(self.config.path, "images", "logo.svg"),
70
- )
71
-
72
99
  # Render main pages
73
100
  self.render_index_page(metrics)
74
101
  self.render_files_page(metrics)