File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ class PlatformStats:
1717 """Class to handle fetching statistics from different platforms."""
1818
1919 LAST_KNOWN_FILE = 'last_known_counts.json'
20+ MAX_REASONABLE_COUNT = 10000 # Maximum expected problem count for validation
2021
2122 def __init__ (self ):
2223 self .stats = {}
@@ -182,9 +183,6 @@ def get_atcoder(self):
182183
183184 def get_codechef (self ):
184185 """Fetch CodeChef statistics using web scraping."""
185- # Maximum reasonable problem count to detect parsing errors
186- MAX_REASONABLE_COUNT = 10000
187-
188186 try :
189187 url = "https://www.codechef.com/users/MishkatIT"
190188 html = self .fetch_url (url )
@@ -208,7 +206,7 @@ def get_codechef(self):
208206 if match :
209207 count = int (match .group (1 ))
210208 # Sanity check - CodeChef count should be reasonable
211- if 0 < count < MAX_REASONABLE_COUNT :
209+ if 0 < count < self . MAX_REASONABLE_COUNT :
212210 return count
213211
214212 # If no pattern matched, save HTML for debugging (in verbose mode)
You can’t perform that action at this time.
0 commit comments