| import os | |
| import re | |
| import json | |
| root_dir = "app/src/main/java/com/airmouse" | |
| results = {} | |
| for root, dirs, files in os.walk(root_dir): | |
| for file in files: | |
| if file.endswith(".kt"): | |
| full_path = os.path.join(root, file) | |
| rel_pkg = os.path.relpath(root, root_dir) | |
| with open(full_path, "r", encoding="utf-8", errors="ignore") as f: | |
| lines = f.readlines() | |
| line_count = len(lines) | |
| content = "".join(lines) | |
| has_todo = "TODO" in content or "FIXME" in content | |
| empty_funcs = len(re.findall(r'fun\s+\w+\s*\([^)]*\)\s*:\s*\w+\s*=\s*TODO\(', content)) + len(re.findall(r'fun\s+\w+\s*\([^)]*\)\s*\{\s*\}', content)) | |
| has_hilt = "@Inject" in content or "@AndroidEntryPoint" in content or "@Module" in content | |
| # Check for legacy port usages | |
| legacy_ports = [] | |
| if "8080" in content: legacy_ports.append("8080") | |
| if "8082" in content: legacy_ports.append("8082") | |
| is_stub = line_count < 25 or empty_funcs > 0 or "TODO(" in content | |
| results[full_path] = { | |
| "package": rel_pkg, | |
| "file": file, | |
| "lines": line_count, | |
| "is_stub": is_stub, | |
| "empty_funcs": empty_funcs, | |
| "has_todo": has_todo, | |
| "has_hilt": has_hilt, | |
| "legacy_ports": legacy_ports | |
| } | |
| summary_by_pkg = {} | |
| for path, info in results.items(): | |
| pkg = info["package"] | |
| if pkg not in summary_by_pkg: | |
| summary_by_pkg[pkg] = {"total": 0, "stubs": 0, "complete": 0, "lines": 0} | |
| summary_by_pkg[pkg]["total"] += 1 | |
| summary_by_pkg[pkg]["lines"] += info["lines"] | |
| if info["is_stub"]: | |
| summary_by_pkg[pkg]["stubs"] += 1 | |
| else: | |
| summary_by_pkg[pkg]["complete"] += 1 | |
| print(f"TOTAL KOTLIN FILES AUDITED: {len(results)}") | |
| print(json.dumps(summary_by_pkg, indent=2)) | |
Xet Storage Details
- Size:
- 2.01 kB
- Xet hash:
- 6896ea263873c04c65145d5d517b30db678f48bca4919a01751f1999e30faaf2
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.