Skip to content

Commit

Permalink
refactor: remove dead code
Browse files Browse the repository at this point in the history
Signed-off-by: Bryce Thuilot <[email protected]>
  • Loading branch information
bthuilot committed Nov 4, 2024
1 parent 657d4ad commit 9f7af5b
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions guarddog/analyzer/metadata/go/typosquatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ class GoTyposquatDetector(TyposquatDetector):
"""

def _get_top_packages(self) -> set:

# popular_packages_url = (
# ""
# )

top_packages_filename = "top_go_packages.json"

resources_dir = TOP_PACKAGES_CACHE_LOCATION
Expand All @@ -34,18 +29,9 @@ def _get_top_packages(self) -> set:
top_packages_information = None

if top_packages_filename in os.listdir(resources_dir):
# update_time = datetime.fromtimestamp(os.path.getmtime(top_packages_path))
#
# if datetime.now() - update_time <= timedelta(days=30):
with open(top_packages_path, "r") as top_packages_file:
top_packages_information = json.load(top_packages_file)

# if top_packages_information is None:
# response = requests.get(popular_packages_url).json()
# top_packages_information = list([i["name"] for i in response[0:8000]])
# with open(top_packages_path, "w+") as f:
# json.dump(top_packages_information, f, ensure_ascii=False, indent=4)

if top_packages_information is None:
raise Exception(
f"Could not retrieve top Go packages from {top_packages_path}")
Expand Down

0 comments on commit 9f7af5b

Please sign in to comment.