-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathAnalyze_pmll.py
24 lines (21 loc) · 838 Bytes
/
Analyze_pmll.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import os
import re
def analyze_repository(repo_path):
analysis_report = []
for root, _, files in os.walk(repo_path):
for file in files:
if file.endswith('.py'): # Adjust for other file types as needed
with open(os.path.join(root, file), 'r') as f:
content = f.read()
# Example: Find function definitions
functions = re.findall(r'def (\w+)', content)
analysis_report.append((file, functions))
# Add custom analysis patterns or checks here
return analysis_report
# Path to your repository
repo_path = '/path/to/your/repository'
report = analyze_repository(repo_path)
# Print or save the report
for file, functions in report:
print(f"File: {file}")
print("Functions:", functions)