Code reuse



  • The solution I'm currently working on is a subset of a folder, so I'm not sure how many lines of code are in it but the entire folder has 129662 lines of code (according to wc -l).

    I just ran Visual Studio's command "Analyze Solution for Code Clones". Its final report:

    257 Clone Groups  |  571 Cloned Snippets  |  14468 Lines of Cloned Code.
    That's 11% code reuse. Only 89% to go!


  • They should really code VS to respond, "you really don't wanna know" in situations like this.



  • @configurator said:

    The solution I'm currently working on is a subset of a folder, so I'm not sure how many lines of code are in it but the entire folder has 129662 lines of code (according to wc -l).

    I just ran Visual Studio's command "Analyze Solution for Code Clones". Its final report:

    257 Clone Groups  |  571 Cloned Snippets  |  14468 Lines of Cloned Code.

    That's 11% code reuse. Only 89% to go!

    No, that is 11% (i didnt double check the exact match) of DUPLICATION and 89% unique code....given that tools for finding this type of duplication (semantic rather than lexical) are fairly new, these results are actually fairly good [based just on the counts, without being provided with sames]



  • @TheCPUWizard said:

    No, that is 11% (i didnt double check the exact match) of DUPLICATION and 89% unique code...

    Way to miss the joke. (I haven't actually used this feature, but given that the documentation says it only matches nearly-duplicated sections of 10 or more statements, a sanely-written program should have a reported duplicate code rate of approximately zero.)



  • @configurator said:

    That's 11% code reuse. Only 89% to go!
    What's perhaps more worrying is that apparently you still have around 115,000 unique lines of code left.

     



  • @Severity One said:

    What's perhaps more worrying is that apparently you still have around 115,000 "unique" lines of code left.

    FTFY. Most of the code is only unique enough to not be found by automatic analysis tools. I estimate this code base, if written correctly, would be around 30KLOC.



  • @configurator said:

    30KLOC.

    Assuming we'd keep the same silly architecture and coding style, that is. If written actually correctly I think it could fit in 10-20KLOC.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.