badges / shields

Concise, consistent, and legible badges in SVG and raster format
https://shields.io
Creative Commons Zero v1.0 Universal
23.01k stars 5.47k forks source link

Lines of code is showing `0` for several repositories that used to count lines OK #7569

Open sgbaird opened 2 years ago

sgbaird commented 2 years ago

Are you experiencing an issue with...

shields.io

🐞 Description

See https://github.com/sparks-baird/mat_discover and https://github.com/sgbaird-5DOF/interp for example. If it's not showing "lines 0" when you open this, then I'll assume this was fixed. Not sure if the issue is on the shields.io side or the tokei side.

🔗 Link to the badge

https://img.shields.io/tokei/lines/github/sparks-baird/mat_discover

💡 Possible Solution

No response

PyvesB commented 2 years ago

Hello @sgbaird ! :wave:

Thanks for reporting this! Our Tokei tests have started failing as well.

It does seem like a problem on the Tokei side, hitting the API for the sparks-baird/mat_discover repository, I get the following response:

{"blanks":0,"code":0,"comments":0,"lines":0,"stats":[],"inaccurate":false}

Other users have also reported this problematic behaviour here: https://github.com/XAMPPRocky/tokei/issues/881

calebcartwright commented 2 years ago

Things appear to have been sorted upstream so going to close. If there's any recurrence in the near term please feel free to post here and we can reopen.

If anyone significantly in the future sees similar symptoms, it's probably better to open a new issue

calebcartwright commented 2 years ago

Reopening as the upstream issue has recurred

librity commented 2 years ago

I'm having the same problem. Examples: Lines of code Lines of code Lines of code Lines of code

calebcartwright commented 2 years ago

Folks, please refrain from posting the "me too" types of comments as they just add unhelpful noise. The above thread already contains relevant information explaining that the issue is upstream.

Shields.io is not a system of record. It doesn't provide CI/pipeline capabilities, and it doesn't count lines of code either. We have to get the data from the relevant upstream endpoint, and we then display whatever data the upstream system of record provides. The upstream system in this case is Tokei, and they've been having this recurring issue for quite some time, as indicated above in the linked tokei issues. Tokei is the service responsible for counting lines of code, and for whatever reason it intermittently claims the count is 0, and thus 0 is displayed on the badges.

There's absolutely nothing we can do about this, so I'd encourage you to subscribe to those issues in the tokei repository if you're interested in receiving updates.

librity commented 2 years ago

Folks, please refrain from posting the "me too" types of comments as they just add unhelpful noise. The above thread already contains relevant information explaining that the issue is upstream.

Shields.io is not a system of record. It doesn't provide CI/pipeline capabilities, and it doesn't count lines of code either. We have to get the data from the relevant upstream endpoint, and we then display whatever data the upstream system of record provides. The upstream system in this case is Tokei, and they've been having this recurring issue for quite some time, as indicated above in the linked tokei issues. Tokei is the service responsible for counting lines of code, and for whatever reason it intermittently claims the count is 0, and thus 0 is displayed on the badges.

There's absolutely nothing we can do about this, so I'd encourage you to subscribe to those issues in the tokei repository if you're interested in receiving updates.

I will, thanks.

hongbo-miao commented 1 year ago

Maybe a new shields badge using this service https://github.com/boyter/scc might help 😃

AleixMT commented 11 months ago

Hello. I wanted to say that I have a similar issue with the lines of code badge too. The badge always say "Invalid response data". I tried with many repositories and I also tried giving shields.io more permissions, but the message is still shown.

Here is the badge that I want to show: Lines of code

The shield has the following URL: https://img.shields.io/tokei/lines/github/AleixMT/eChempad

Thank you for your response and for this wonderful project.

chris48s commented 11 months ago

I think this is a duplicate of https://github.com/badges/shields/issues/9389 and the upstream issue is https://github.com/XAMPPRocky/tokei_rs/issues/233

ghost commented 11 months ago

I think this is a duplicate of #9389 and the upstream issue is XAMPPRocky/tokei_rs#233

9389 was created much later?

chris48s commented 11 months ago

OK well https://github.com/badges/shields/issues/9389 is a duplicate of this.

The main point was I wanted to link to the upstream issue with tokei as this issue was bumped recently.

Jonius7 commented 1 month ago

Lines of code works if you don't use tokei and use ghloc.vercel.app, here's an example of mine:

https://img.shields.io/endpoint?url=https://ghloc.vercel.app/api/Jonius7/SteamUI-OldGlory/badge?filter=.py$,.scss$,.rs$&style=flat&logoColor=white&label=Lines%20of%20Code

AleixMT commented 1 month ago

@Jonius7 Finally a valid solution!