Theoretically this could be addressed by looking for the earliest occurence of said code in github and check its license. Sure, there are some edge cases where original copyrighted code has been removed and only unlicensed repo remains but it would be better than nothing