Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Top Langs incorrect #270

Closed
maustinstar opened this issue Jul 30, 2020 · 42 comments
Closed

Top Langs incorrect #270

maustinstar opened this issue Jul 30, 2020 · 42 comments
Labels
lang-card Issues related to the language card. stale Issue is marked as stale.

Comments

@maustinstar
Copy link

Describe the bug
None of my repos contain HTML, yet is 10% in my profile's top langs card.

Expected behavior
I should have ~0% HTML

Screenshots / Live demo link (paste the github-readme-stats link as markdown image)
https://github.com/maustinstar

@bashbaugh
Copy link
Contributor

I'm not seeing any HTML on your top used languages image!

@maustinstar
Copy link
Author

It disappeared a few minutes after I opened the issue. Not sure what happened.

@hjlarry
Copy link

hjlarry commented Jul 31, 2020

my top langs is incorrect too.

I almost not write java, and not use jupyter notebook

@anuraghazra
Copy link
Owner

anuraghazra commented Aug 1, 2020

@hjlarry This is not about if you use java or jupyter notebook, it's about how much code (in bytes) you have in your github profile. and as far as i can see you do have java repo https://github.com/hjlarry/practise-java

@daniCh8
Copy link

daniCh8 commented Aug 1, 2020

I am experiencing a similar problem.

This is the language breakdown I get when hiding CSS and VHDL from the languages:

Python is not showing at all. However, you can see from this profile language breakdown here:

A considerable amount of code I have is written in python.

@hjlarry
Copy link

hjlarry commented Aug 1, 2020

@hjlarry This is not about if you use java or jupyter notebook, it's about how much code (in bytes) you have in your github profile. and as far as i can see you do have java repo https://github.com/hjlarry/practise-java

thanks, my only one java project has some vendor files, so it effect the whole result. now I think the top langs is correct

@axetroy
Copy link

axetroy commented Aug 2, 2020

I think the top language is incorrect

Because I have written a lot of Golang projects, at least more than Dart

But it hasn't been counted

Top Langs

@anuraghazra
Copy link
Owner

anuraghazra commented Aug 2, 2020

I think the top language is incorrect

Because I have written a lot of Golang projects, at least more than Dart

But it hasn't been counted

Top Langs

As far as i can see you have a lot of javascript code in your account, as i said it's now about how many repos you have, it's about how much code you have.

try this GQL query on the explorer
https://developer.github.com/v4/explorer/

{
  user(login: "axetroy") {
    repositories(ownerAffiliations: OWNER, isFork: false, first: 100) {
      nodes {
        name
        languages(first: 10, orderBy: {field: SIZE, direction: DESC}) {
          edges {
            size
            node {
              name
            }
          }
        }
      }
    }
  }
}

And there is soo much javascript dart is just excluded from the list

@axetroy
Copy link

axetroy commented Aug 2, 2020

@anuraghazra This is the problem because it only counts the first 100 items, not all of thems.

@alhassanv
Copy link

I have the same issue;
https://github-readme-stats.vercel.app/api/top-langs?username=alhassanv
Mine is empty..

@vn7n24fzkq
Copy link

@axetroy Because github api limit repository number is 100.
image

@axetroy
Copy link

axetroy commented Aug 5, 2020

@vn7n24fzkq I know this.

But we can request multiple times until get all repos.

@vn7n24fzkq
Copy link

@axetroy Sure.
Maybe use pageInfo and cursor like this?
Refresh cursor and get more repos until hasNextPage is false.

query userInfo($login: String!) {
  user(login: $login) {
    repositories(ownerAffiliations: OWNER, isFork: false, first: 100,after:"Y3Vyc29yOnYyOpHOD4zl4g==") {
      nodes {
        languages(first: 10, orderBy: {field: SIZE, direction: DESC}) {
          edges {
            size
            node {
              color
              name
            }
          }
        }
      }
      pageInfo {
        endCursor
        hasNextPage
      }
    }
  }
}

@anuraghazra
Copy link
Owner

Maybe use pageInfo and cursor like this?
Refresh cursor and get more repos until hasNextPage is false.

Yeah doing that isn't an issue but performance is an issue we have limited amount of time to do all operations in vercel serverless function.

#92 (comment)

@victorquanlam
Copy link

Can we count it from the private repos? I have noticed that it doesn't count the lang used from private repos

@anuraghazra
Copy link
Owner

Can we count it from the private repos? I have noticed that it doesn't count the lang used from private repos

#174

@bluelovers
Copy link

my is incorrect too

https://github-readme-stats.vercel.app/api/top-langs/?username=bluelovers&show_icons=true&theme=radical&layout=compact

lang

php should not is top one for me
because i have many js/ts


@daniCh8 where are this image from?

image

@anuraghazra
Copy link
Owner

my is incorrect too

It works as expected, please checkout #136 #136 (comment)

@anuraghazra
Copy link
Owner

@maustinstar

It disappeared a few minutes after I opened the issue. Not sure what happened.

Are you able to reproduce the issue again? or else i would close this issue in favour of #136

@sachinchaturvedi93
Copy link

Hey @anuraghazra how can I remove Jupyter Notebook from mine? It's showing ~ 99% in mine

Top Langs

@anuraghazra
Copy link
Owner

anuraghazra commented Aug 14, 2020

Hey @anuraghazra how can I remove Jupyter Notebook from mine? It's showing ~ 99% in mine

&hide=jupyter%20notebook

please read the docs. https://github.com/anuraghazra/github-readme-stats/#language-card-exclusive-options

@sachinchaturvedi93
Copy link

Hey @anuraghazra how can I remove Jupyter Notebook from mine? It's showing ~ 99% in mine

&hide=jupyter%20notebook

please read the docs. https://github.com/anuraghazra/github-readme-stats/#language-card-exclusive-options

Thank you

@flaviostutz
Copy link

Mine is incorrect too. Jupyter is 97%. I think this is because you are looking at storage size and Jupyter notebooks has the image results embedded to it.
I think it should count lines of code and in the case of Jupyter, ignore all embedded results.

@sachinchaturvedi93
Copy link

Mine is incorrect too. Jupyter is 97%. I think this is because you are looking at storage size and Jupyter notebooks has the image results embedded to it.
I think it should count lines of code and in the case of Jupyter, ignore all embedded results.

As @anuraghazra stated above, add &hide=jupyter%20notebook to remove Jupyter

@anuraghazra
Copy link
Owner

anuraghazra commented Aug 19, 2020

Mine is incorrect too. Jupyter is 97%. I think this is because you are looking at storage size and Jupyter notebooks has the image results embedded to it.
I think it should count lines of code and in the case of Jupyter, ignore all embedded results.

@flaviostutz
There is literally no way to do this. It's all coming from GraphQL API.

@flaviostutz
Copy link

Thanks, guys! I wish I could show my Jupyter experience too :)
Maybe a future improvement!

@alhassanv
Copy link

why is mine wrong? my contributions are private repos

@alik604
Copy link

alik604 commented Sep 2, 2020

@anuraghazra, thank you for making this project

Would it be possible for a normalizing constant to be used on the number of lines of Jupyter Notebook code, or users to hard code the percentage as a URL pram?

Hiding isn't really an option for me, as 90% of my active work-time is in it. but showing it downplays all my past work.. and looks weird (92% code is jupyter). I suspect all the XML lines for cell formatting and text cells are causing this.

@anuraghazra anuraghazra added the lang-card Issues related to the language card. label Sep 20, 2020
@Lucretia
Copy link

Lucretia commented Dec 2, 2020

Yes, this includes all languages used in forks, there needs to be an exclude_forks option to set.

@stale
Copy link

stale bot commented Jan 1, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added stale Issue is marked as stale. and removed stale Issue is marked as stale. labels Jan 1, 2021
@RichardsonWTR
Copy link

Is there something do to about this issue @anuraghazra?

If not, I think you could mark this with a wont fix label or something.

@stale
Copy link

stale bot commented Feb 4, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issue is marked as stale. label Feb 4, 2021
@stale stale bot closed this as completed Feb 11, 2021
@Lucretia
Copy link

Ping, this really needs fixing.

@vn7n24fzkq
Copy link

vn7n24fzkq commented Mar 25, 2021

Hi @Lucretia .
I was not sure would @anuraghazra fix this, so I made a repo that provide similar feature after my PR #307 was ignored.
I hope this helps.
https://github.com/vn7n24fzkq/github-profile-summary-cards

@Krishnapro
Copy link

In my overview readme top language card is not updating what is the issue i don't know.

@MasterGrant137
Copy link

I discovered that if top languages in the url is greater than the amount of languages recognized on my Github account, some languages won't show. For example, I was specifying langs_count = 8 and it wouldn't show Python but once I dropped it to 6, the top langs card showed Python.

@russelljjarvis
Copy link

russelljjarvis commented Nov 13, 2021

I got a useful and balanced result (one that reflects code I have hand written or hacked, but not autogenerated code), by just excluding all autogenerated code using the documentation.

Ie:
&hide=jupyter%20notebook,HTML,XSLT,OpenEdge%20ABL,AGS%20Script,AMPL,GAP,Roff,C,Lua)](https://github.com/russelljjarvis/github-readme-stats)

@Riyakumari57
Copy link

Why do these two differ
https://github-readme-stats.vercel.app/api/top-langs/?username=Riyakumari57&langs_count=10&theme=radical
http://ionicabizau.github.io/github-profile-languages/?user=Riyakumari57

the first link which i am using for my gitHub profile shows 42% c++ which is on the top but in the second link javascript section area covers the major part (44.44%) and c++ is 11.11%

@qwerty541
Copy link
Collaborator

Why do these two differ https://github-readme-stats.vercel.app/api/top-langs/?username=Riyakumari57&langs_count=10&theme=radical http://ionicabizau.github.io/github-profile-languages/?user=Riyakumari57

the first link which i am using for my gitHub profile shows 42% c++ which is on the top but in the second link javascript section area covers the major part (44.44%) and c++ is 11.11%

Answered in #3083 (comment)

@Lucretia
Copy link

Hi @Lucretia . I was not sure would @anuraghazra fix this, so I made a repo that provide similar feature after my PR #307 was ignored. I hope this helps. https://github.com/vn7n24fzkq/github-profile-summary-cards

Hi, I would rather the script just didn't include forks I have not pushed to, or separated out the forks into another card as well as having a forks I have pushed to card as well.

@rickstaa
Copy link
Collaborator

Hi @Lucretia . I was not sure would @anuraghazra fix this, so I made a repo that provide similar feature after my PR #307 was ignored. I hope this helps. https://github.com/vn7n24fzkq/github-profile-summary-cards

Hi, I would rather the script just didn't include forks I have not pushed to, or separated out the forks into another card as well as having a forks I have pushed to card as well.

Including forks is currently not possible due to GraphQL limitations. Please see #3109 for more information.

@Lucretia
Copy link

Lucretia commented Oct 6, 2023

Including forks is currently not possible due to GraphQL limitations. Please see #3109 for more information.

I want the script to EXCLUDE forks, not include them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang-card Issues related to the language card. stale Issue is marked as stale.
Projects
None yet
Development

No branches or pull requests