anuraghazra / github-readme-stats

:zap: Dynamically generated stats for your github readmes
https://github-readme-stats.vercel.app
MIT License
69.05k stars 22.77k forks source link

Top Langs incorrect #270

Closed maustinstar closed 3 years ago

maustinstar commented 4 years ago

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 commented 4 years ago

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

maustinstar commented 4 years ago

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

hjlarry commented 4 years ago

my top langs is incorrect too. I almost not write java, and not use jupyter notebook

anuraghazra commented 4 years ago

@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 commented 4 years ago

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 commented 4 years ago

@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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

alhassanv commented 4 years ago

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

vn7n24fzkq commented 4 years ago

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

axetroy commented 4 years ago

@vn7n24fzkq I know this.

But we can request multiple times until get all repos.

vn7n24fzkq commented 4 years ago

@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 commented 4 years ago

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.

https://github.com/anuraghazra/github-readme-stats/issues/92#issuecomment-660691915

victorquanlam commented 4 years ago

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

anuraghazra commented 4 years ago

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

174

bluelovers commented 4 years ago

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 commented 4 years ago

my is incorrect too

It works as expected, please checkout #136 https://github.com/anuraghazra/github-readme-stats/issues/136#issuecomment-665172181

anuraghazra commented 4 years ago

@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 commented 4 years ago

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

Top Langs

anuraghazra commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

alhassanv commented 4 years ago

why is mine wrong? my contributions are private repos

alik604 commented 4 years ago

@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.

Lucretia commented 3 years ago

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

stale[bot] commented 3 years ago

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.

RichardsonWTR commented 3 years ago

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[bot] commented 3 years ago

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.

Lucretia commented 3 years ago

Ping, this really needs fixing.

vn7n24fzkq commented 3 years ago

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 commented 3 years ago

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

MasterGrant137 commented 3 years ago

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 commented 2 years ago

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 commented 1 year ago

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 commented 1 year ago

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 https://github.com/anuraghazra/github-readme-stats/discussions/3083#discussioncomment-6859091

Lucretia commented 1 year ago

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 commented 1 year ago

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 https://github.com/anuraghazra/github-readme-stats/issues/3109 for more information.

Lucretia commented 1 year ago

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.