How many lines of code and how many files are there in the Anki Python and Java apps?

I am just curious and wondering if anyone has ever attempted to find out these numbers. Also how do those change every year? Would be really interesting to track over the years.

You could use scc to get an overview of the source code.

here is a sample output (in branch master, last update of the repo was at Wed Jan 6 10:11:38 2021)

git checkout master
git pull
scc
───────────────────────────────────────────────────────────────────────────────
Language                 Files     Lines   Blanks  Comments     Code Complexity
───────────────────────────────────────────────────────────────────────────────
Python                     146     38466     2634      2139    33693       1675
Rust                        89     23840     2402      1132    20306       1297
SQL                         60       907        8        10      889         36
Bazel                       50      5691      585        93     5013         36
Freemarker Template         35      1477       64         0     1413          0
TypeScript                  30      3497      391       240     2866        424
Markdown                    16       848      261         0      587          0
Sass                        13       901      157        32      712          0
Shell                        9       143       29        29       85         10
SVG                          7       133        0         0      133          0
BASH                         6       110       27        13       70          8
JSON                         6      3155        1         0     3154          0
Plain Text                   6       178        2         0      176          0
Batch                        5        61       12         4       45          2
gitignore                    5        25        0         0       25          0
JavaScript                   4        97        4        18       75         33
HTML                         3        83        2         0       81          0
TOML                         3       136        7         3      126          0
Autoconf                     2        44        6         4       34          9
TypeScript Typings           2         5        0         0        5          0
XML                          2       108       37         0       71          0
CSS                          1         7        0         0        7          0
Cargo Lock                   1      2731      283         2     2446          0
LaTeX                        1         7        0         0        7          0
License                      1        48        9         0       39          0
Patch                        1        41        5         0       36          0
Protocol Buffers             1      1092      194        48      850          0
───────────────────────────────────────────────────────────────────────────────
Total                      505     83831     7120      3767    72944       3530
───────────────────────────────────────────────────────────────────────────────
Estimated Cost to Develop $2,441,936
Estimated Schedule Effort 19.308704 months
Estimated People Required 11.235623
───────────────────────────────────────────────────────────────────────────────
Processed 2690755 bytes, 2.691 megabytes (SI)
───────────────────────────────────────────────────────────────────────────────
1 Like

GitHub has some built-in analytics: Code frequency Β· ankitects/anki Β· GitHub

1 Like

hi @cardosaum Thanks for this. May I know how did you extract these data through ssc? I’m checking on it but can’t seem to find these exact data.

I just cloned the Anki repo at github, then ran scc

git clone git@github.com:ankitects/anki.git
# you could use the HTTPS version instead
# git clone https://github.com/ankitects/anki.git
# change your directory to the repo:
cd anki
# then, run scc on that repo
scc