INNER CODE UNIT · Python
activity_score
LiuMengxuan04/shushu-internship-tool · skills/shushu-internship-tool/scripts/shushu_internship_tool/candidate_score.py:111
def activity_score(raw: Any, today: date) -> tuple[int, str]:
commit_date = parse_commit_date(raw)
if commit_date is None:
return 0, "last_commit missing or unparsable"
days = max((today - commit_date).days, 0)
if days <= 180:
return 10, "active within 180 days"
if days <= 365:
return 7, "active within 1 year"
if days <= 730:
return 4, "active within 2 years"
return 1, "inactive for more than 2 years"
def stars_score(raw: Any) -> tuple[int, str]:
stars = safe_int(raw)
if stars >= 1000:
return 10, "strong community signal"