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

Refine ScanCode.io d2d pipeline for JavaScript using symbol mapping #1622

Merged
merged 8 commits into from
Mar 21, 2025

Conversation

keshav-space
Copy link
Member

  • Map source and deployed javascript files based on Jensen–Shannon divergence

@keshav-space keshav-space marked this pull request as draft March 12, 2025 15:08
- Map source and deployed javascript files based on Jensen–Shannon divergence

Signed-off-by: Keshav Priyadarshi <[email protected]>
@keshav-space keshav-space force-pushed the 1405-javascript-symbol-map branch from 20ea1f3 to e800be8 Compare March 14, 2025 16:16
@tdruez
Copy link
Contributor

tdruez commented Mar 17, 2025

@keshav-space what's the status on this PR? Are we ready to merge? If not, what's left to do?

@keshav-space
Copy link
Member Author

@keshav-space what's the status on this PR? Are we ready to merge? If not, what's left to do?

@tdruez It's not ready for merge yet. I need to add string mapping for JavaScript, and I'm also testing and adding improvements to JavaScript symbol matching to reduce false positive matches.

@tdruez
Copy link
Contributor

tdruez commented Mar 19, 2025

@keshav-space Sounds good. Let me know when it's ready to go as we need this one merged in the back2source context ;)

Signed-off-by: Keshav Priyadarshi <[email protected]>
@keshav-space keshav-space marked this pull request as ready for review March 19, 2025 15:45
@keshav-space
Copy link
Member Author

@tdruez this is ready for review.

Copy link
Contributor

@tdruez tdruez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keshav-space Overall looks great.
I think we are missing a few unit test for some new simple functions, such as is_decomposed_javascript, get_symbols_probability_distribution, ...

Comment on lines 138 to 144
common_symbols_ratio > matching_ratio
or common_symbols_unique_ratio > matching_ratio
):
return True, stats
elif source_symbols_count > SMALL_FILE_SYMBOLS_THRESHOLD and (
common_symbols_ratio > MATCHING_RATIO_RUST_SMALL_FILE
or common_symbols_unique_ratio > MATCHING_RATIO_RUST_SMALL_FILE
elif source_symbols_count > small_file_threshold and (
common_symbols_ratio > matching_ratio_small_file
or common_symbols_unique_ratio > matching_ratio_small_file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we wrap those conditions in a explicit variable name?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should remove this. This change is no longer needed since we're not using match_source_symbols_to_binary for javascript symbol matching.

Signed-off-by: Keshav Priyadarshi <[email protected]>
@keshav-space keshav-space requested a review from tdruez March 20, 2025 18:34
@tdruez tdruez merged commit 6529a1e into main Mar 21, 2025
9 checks passed
@tdruez tdruez deleted the 1405-javascript-symbol-map branch March 21, 2025 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants