question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Innaccuracies with language plugins stats

See original GitHub issue

While investigating on #513 I noticed some flaws in the languages plugin.

It is actually not very well defined whether it should count your effective language stats (meaning stats from the current state of each repo) or cumulative language stats (meaning stats should include previous state of each repo, including code that has been refactored, moved or deleted).

Currently, the languages indepth analyzers is doing the following:

  1. Clone locally repository
  2. Call linguist on it
  3. git log --patch on each user commit to find which lines were added by user and update bytes count using detected language by linguist
  4. Remove locally cloned repository

For now, it leans more toward cumulative stats rather effective stats. Since tracking deleted files is currently impossible because they don’t exist when linguist analyze the repository (so detected language for a deleted file is always null), deleted/moved files are never taken into account so some lines are actually lost

Also renamed file may be counted multiple times, need to check whether an option exists to detect them (maybe --follow?)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lowlightercommented, Feb 8, 2022

Superseded by #857

0reactions
Napolitaincommented, Sep 28, 2021

Ok so I removed “indepth” and it seems better representative of the repositories.

I think that’s linked to what you describe in this issue, as it shows only current state. And I think it reads the last commit of each file (or something like that) so only few lines are registered (and not the whole file). A typo fix would then count as 1 line for a whole file.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problems With Second Languages in WordPress
Having a website that is not English or multi-language is not so easy in WordPress. We have plugins that can help us solve...
Read more >
gitattributes not working - wrong language statistics #3681
My repository shows wrong language statistics, as in the image: The percentages ... in the repository a directory contaning third-party plugins.
Read more >
Plugins – Code::Stats
The plugins work by listening to your editor's text changes and detecting the syntax used. If you are having problems with XP registering...
Read more >
These 15 stats prove you must support every customer language
English, Chinese, Arab, Russian, Spanish, Portuguese, German… the list of languages with over a hundred million speakers is not small.
Read more >
Spelling and Grammar Checks | DataSpell Documentation
DataSpell helps you check that all text written in natural languages is correct. This works similar to coding assistance, but instead of ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found