Skip to content

Commit f292d72

Browse files
authored
Add intelligence functions for scoring and recommendations
1 parent ae73a19 commit f292d72

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

app/intelligence.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
def calculate_technical_score(repo_data):
2+
language_score = min(repo_data["num_languages"] * 10, 30)
3+
complexity_score = max(0, 30 - repo_data["avg_function_length"])
4+
repo_score = min(repo_data["num_repos"] * 5, 20)
5+
consistency_score = min(repo_data["commit_frequency"] * 2, 20)
6+
7+
total = language_score + complexity_score + repo_score + consistency_score
8+
return min(total, 100)
9+
10+
11+
def calculate_cognitive_profile(test):
12+
analytical = (test["debugging"] + test["optimization"]) / 2
13+
architectural = (test["system_design"] + test["abstraction"]) / 2
14+
overall = (analytical + architectural) / 2 * 10
15+
16+
return {
17+
"analytical_strength": analytical,
18+
"architectural_thinking": architectural,
19+
"overall_cognitive_score": overall
20+
}
21+
22+
23+
def generate_recommendation(tech_score, cognitive_score):
24+
if tech_score > 75 and cognitive_score > 75:
25+
return "AI/ML Engineer or Systems Architect"
26+
elif tech_score > 70:
27+
return "Backend Engineer"
28+
elif cognitive_score > 70:
29+
return "Product Engineer"
30+
return "Strengthen fundamentals before specialization"

0 commit comments

Comments
 (0)