Is a large portion of the code still 'original' bytecoin code, or has, over the years, with the edition various new features, most of Monero become original code and the remaining Bytecoin code (<20%?) been changed? More to the point, how much remaining Bytecoin code is left still?
2 Answers
This is of course a coarse method, but we can do the following:
Get git to work out who authored a given line for all the lines in src:
$ find src/ -name \*.cpp -o -name \*.c -o -name \*.inl -o -name \*.h | while read f; do git blame -CC "$f";done > full-files
Then check how many of those lines were authored by the pre-Monero authors (anjuarez for the Cryptonote team, and thankful_for_today for the original fork):
$ grep -iE juarez\|thankful full-files | wc -l
22332
And do the same for those lines not authored by them:
$ grep -ivE juarez\|thankful full-files | wc -l
83706
So most of the code was rewritten or modified.
Note that git sees a modification of the line as rewritten, so this may be an overestimate.
You can redo the selection to include other authors, in case there's a significant amount of code written (as reported by git) by another person than amjuarez.
If we include the epee support library:
$ find contrib/epee/ src/ -name \*.cpp -o -name \*.c -o -name \*.inl -o -name \*.h | while read f; do git blame -CC "$f";done > full-files
$ grep -iE juarez\|thankful full-files | wc -l
44115
$ grep -ivE juarez\|thankful full-files | wc -l
87377
Since 2014, and at the time of this writing, Monero had 3107 commits on Github so it's hard to point a finger at some specific difference or give a % as there have been thousands of lines of code edited and decades of man-years spent working on it since the inception.