-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreport.py
More file actions
58 lines (38 loc) · 1.03 KB
/
Copy pathreport.py
File metadata and controls
58 lines (38 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from colorama import init
init()
def generate_report(data):
print("\n")
print("=" * 50)
print("PROJECT DNA REPORT")
print("=" * 50)
print(f"Files Analysed : {data['files']}")
print(f"Total Lines : {data['lines']}")
print(f"Health Score : {data['health']}%")
print("\nLanguages")
total = sum(
data["languages"].values()
)
for lang, count in data["languages"].items():
percentage = (
count / total
) * 100
print(
f"{lang:<12}"
f"{percentage:.1f}%"
)
print("\nLargest Files")
for item in data["largest_files"]:
print(
f"{item['lines']:>6} lines"
f" {item['path']}"
)
print("\nProject Status")
score = data["health"]
if score >= 90:
print("Excellent")
elif score >= 75:
print("Good")
elif score >= 50:
print("Needs Improvement")
else:
print("Critical")