[FEA] Improve score_document (NumberOfLinesOfCodeFilter) and _line_statistics (PerExtensionFilter)
Update:

Apologies. I opened it in the wrong repository. My bad.
Hi!

I have noticed a couple of small changes in the code that can improve its performance:

By refactoring `score_document` as suggested, it will run between 2x and 3x faster, and will reduce by half the memory footprint.

By refactoring '_line_statistics' as suggested, it can run about 21% faster.

I will submit a PR in a few minutes with the changes.

Regards,
Miguel