github-linguist / linguist

Language Savant. If your repository's language is being reported incorrectly, send us a pull request!
MIT License
12.29k stars 4.25k forks source link

How are these numbers calculated? #1434

Closed sylvia43 closed 10 years ago

sylvia43 commented 10 years ago

For the project I'm working on, I'm getting some strange language percentages.

image

It says 68.5% C and 31.5% Shell. However, I have only have 3 batch files with 9 lines. On the other hand, I have a handful of C files.

How is Linguist computing these numbers?

pchaigno commented 10 years ago

I always thought it was by counting the number of lines for each language but it appears to be counting the total size of the files for each language...

In your case, https://github.com/anubiann00b/Quadcopter/blob/master/src/compile.bat is pretty big, thus making Shell 31.5%.

sylvia43 commented 10 years ago

Hmm ok...

4,323 compile.bat 1,065 i2chelper.c 2,618 imu.c 2,210 motor.c 488 quadcopter.c 1,994 quadcopter.h 406 range.c 43 run.bat 41 run_t.bat