T08 · Insecure Dependencies
- Location
SKILL.md:66- Finding
Unpinned Third-Party Dependency Is Entrusted with KenPom Account Credentials
- Content
View full analysis
list[dict]: """ Fetch team ratings from KenPom (requires subscription). Credentials can be passed directly or set as env vars: KENPOM_EMAIL, KENPOM_PASSWORD """ email = email or os.environ.get("KENPOM_EMAIL") password = password or os.environ.get("KENPOM_PASSWORD") if not email or not password: print("[kenpom] No credentials. Use Torvik (free) or set KENPOM_EMAIL/KENPOM_PASSWORD.") return [] cache_file = DATA_DIR / f"kenpom_{year}.json" if cache_file.exists() and not force: age_hours = (datetime.now().timestamp() - cache_file.stat().st_mtime) / 3600 if age_hours < 12: with open(cache_file) as f: return json.load(f) try: from kenpompy.utils import login import kenpompy.summary as kp browser = login(email, password) df = kp.get_efficiency(browser, season=str(year)) teams = df.to_dict("records") with open(cache_file, "w") as f: json.dump(teams, f, indent=2, default=str) return teams except ImportError: print("[kenpom] kenpompy not installed. Run: pip install kenpompy") return [] except Exception as e: print(f"[ke ...[truncated 2614 chars]- Remediation
View remediation
