Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: npm-related bugs from refactor #63

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tool/static_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ def api_constructor(package_name, repository):
error_message = None

try:
package_name = package_name.replace("npm:", "")
parts = package_name.split("@")
package_full_name = None
name = None
Expand Down Expand Up @@ -295,7 +296,7 @@ def check_existence(package_name, repository, package_manager):
# As such, if the package manager is maven, we'll try to "work our way up", and perform the same check in the parent
parent_scm_result = check_parent_scm(package_name)

if not data and not parent_scm_result["data"]:
if not data and not parent_scm_result.get("data"):
# simplified_path = parent_scm_result.get("simplified_path", simplified_path)
# If we went up, and there's no still data, there really isn't a findable repository
logging.warning(f"No repo found for {package_name} in {repo_link}")
Expand Down Expand Up @@ -545,6 +546,7 @@ def analyze_package_data(package, repo_url, pm, check_match=False, enabled_check
package_info = {}
try:
package_name, package_version = package.rsplit("@", 1)
package_version = package_version.replace("npm:", "")

# Try to get from cache first
cached_analysis = cache_manager.package_cache.get_package_analysis(package_name, package_version, pm)
Expand Down
Loading