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

Java Code gets displayed as Kotlin and vice versa #47

Closed
suobset opened this issue Aug 23, 2021 · 3 comments
Closed

Java Code gets displayed as Kotlin and vice versa #47

suobset opened this issue Aug 23, 2021 · 3 comments

Comments

@suobset
Copy link

suobset commented Aug 23, 2021

As the title says, the extension counts all my Java code as Kotlin and vice versa. Initially, it did not create this issue (especially when I was coding on Java exclusively), but I started to do some Android Development stuff on Kotlin which messed it up.

Here's a screenshot from right now:

Here's a screenshot from an earlier commit:

I only have one repository in Kotlin, so the latter seems more correct (plus most of my code is still on Java).

@jstrieb
Copy link
Owner

jstrieb commented Aug 24, 2021

Hi @suobset! Thanks for taking the time to open this issue!

This is interesting, unexpected behavior. I looked at your profile for examples of repositories that could contributing to this, but I couldn't find any so I assume they're private.

My initial guess is that GitHub internally changed how github/linguist determines whether a code file is Java or Kotlin, and this change is reflected in altered results from the API.

Can you see if the "languages" section for each repo is showing Java or Kotlin in the expected proportions? The solution may be adding a .gitattributes file to your Android repos if my suspicion proves correct

@jstrieb
Copy link
Owner

jstrieb commented Jan 12, 2022

I have found that when I had a lot of projects in one repository, only so many of the most used languages in this repository were showing in the generated image. Now that I have separated the projects so that they are each in a different repository, all the languages are showing in the generated image.

Thanks for documenting this. If this is the root of the problem @suobset is having, then this is likely an issue on GitHub's side. Either way, I'll need a little more info from them to debug.

@suobset
Copy link
Author

suobset commented Jan 24, 2022

Apologies for the super late response.

I think that is the same problem that I am facing as well. I had a couple of big repositories which were probably causing the issue. When I tried to exclude them from the count, the stats displayed were fine. Similarly, I believe splitting up the repository might have helped in the same way as well.

Thanks a lot for all your help. I believe that this is a problem from GitHub's side, and thus I'll just close this issue here.

To anyone else having the issue:

  1. Check for big repositories which have a lot of code and/or more than 3-4 recognized languages.
  2. Either split those repositories into smaller segments, or exclude them.

@suobset suobset closed this as completed Jan 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants