kucherenko / jscpd

Copy/paste detector for programming source code.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Readable report with code extract

mathias22osterhagen22 opened this issue · comments

Is your feature request related to a problem? Please describe.
The actual script is giving a report with columns/lines and a summary at the end.
If you want to check the matches, you are forced to go open each file, one by one, looking per columns and lines etc...

Describe the solution you'd like
What would be perfect would be an extract of the duplicated code to show up in the output report.
This make you see directly from the console what it is about instead of having to open every files manually.
Could be a an optional parameter as well like --show-code or something like that.

Describe alternatives you've considered
None

Additional context

I got a result like this:

┌────────────┬────────────────┬─────────────┬──────────────┬──────────────┬──────────────────┬───────────────────┐
 Format      Files analyzed  Total lines  Total tokens  Clones found  Duplicated lines  Duplicated tokens 
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
 typescript  273             38972        334267        254           4730 (12.14%)     44375 (13.28%)    
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
 Total:      273             38972        334267        254           4730 (12.14%)     44375 (13.28%)    
└────────────┴────────────────┴─────────────┴──────────────┴──────────────┴──────────────────┴───────────────────┘

I have to go check all cones one by one, (every 254 of them), it's too long and not exploitable...