Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
January 1, 2022 07:47 pm GMT

How should I build a duplicate detection system?

I'm working on a linter right now, and one of the requested features for it was code duplication detection. I made an issue for it already, but I need to start working on it. And, that's where my question lies.

I can either build the system to detect the duplications based on plain text. This is how most systems work because it is the simpler of the two options. But, it is also the most failure prone. For instance, this system would fail if there was the same exact code in two places, but there was a comment in the middle of one of them- it would not register as a duplicate.

Alternatively, I can use an abstract syntax tree to detect the duplications. But, theres another problem there- what is the most-lightweight and all-around-best javascript parser out there? I'm planning on using the babel parser but I'm already running into a problem because it doesn't parse the comments in a way I would like.

So, if you have an opinion on what I should do, please leave a comment below. Also, please star the project and contribute if you have time. If you can, that would be amazing, and I thank you so much!


Original Link: https://dev.to/williammcgonagle/how-should-i-build-a-duplicate-detection-system-22le

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To