OreosLab / SSRSpeedN

global statement detected PYL-W0603
Anti-pattern
Major
2 years ago2 years old
Using the global statement
 86    workers = file_download.get("workers", 4)
 87    buffer_ = file_download.get("buffer", 4096)
 88    avg_st_speed: float = 0
 89    global EXIT_FLAG, MAX_TIME, TOTAL_RECEIVED, MAX_FILE_SIZE 90
 91    dlrm = DownloadRuleMatch(file_download)
 92    res = dlrm.get_url(await ip_loc(port))
Using the global statement
 22
 23
 24def speed_test_thread(link, buffer):
 25    global TOTAL_RECEIVED, MAX_TIME 26    logger.debug(f"Thread {threading.current_thread().ident} started.")
 27    link = link.replace("https://", "").replace("http://", "")
 28    host = link[: link.find("/")]