jscpd icon indicating copy to clipboard operation
jscpd copied to clipboard

Duplicates "tokens" field always set to zero.

Open lolgab opened this issue 3 years ago • 2 comments

I noticed that the tokens section in the duplicates section of the json report is hard-coded to 0. It should describe the number of tokens that make the duplicated code.

I would like to contribute on this feature, where can I find the information? I didn't understand what the range field is about. Is it related?

lolgab avatar Oct 19 '20 15:10 lolgab

Thank you for the bug report! Numbers in range are first symbol position and last symbol position.

I've added tokens parameters few versions ago and miss some calculations. Will investigate and fix it

kucherenko avatar Oct 19 '20 15:10 kucherenko

I would like to contribute on this feature, where can I find the information?

It would be nice, you can find how to get tokens from statistic here - https://github.com/kucherenko/jscpd/blob/aec15511efe5fffda10960e26a140acb4f704731/packages/finder/src/utils/reports.ts#L62

kucherenko avatar Oct 19 '20 16:10 kucherenko