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

**URL:** <https://forums.ankiweb.net/t/how-many-lines-of-code-and-how-many-files-are-there-in-the-anki-python-and-java-apps/6303>\
**Category:** Development\
**Created:** [January 6, 2021, 7:50am UTC](https://forums.ankiweb.net/t/how-many-lines-of-code-and-how-many-files-are-there-in-the-anki-python-and-java-apps/6303 "2021-01-06T07:50:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![theankilearner](https://avatars.discourse-cdn.com/v4/letter/t/74df32/32.png) [@theankilearner](https://forums.ankiweb.net/u/theankilearner)\
**Post date:** [January 6, 2021, 7:50am UTC](https://forums.ankiweb.net/t/how-many-lines-of-code-and-how-many-files-are-there-in-the-anki-python-and-java-apps/6303/1 "2021-01-06T07:50:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![cardosaum](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/cardosaum/32/2384_2.png) [@cardosaum](https://forums.ankiweb.net/u/cardosaum)\
**Post date:** [January 6, 2021, 1:13pm UTC](https://forums.ankiweb.net/t/how-many-lines-of-code-and-how-many-files-are-there-in-the-anki-python-and-java-apps/6303/2 "2021-01-06T13:13:27Z")

</div>

You could use [scc](https://github.com/boyter/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)

```bash
git checkout master
git pull
scc

```

```nohighlight
───────────────────────────────────────────────────────────────────────────────
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)
───────────────────────────────────────────────────────────────────────────────

```

---

<div class="post-metadata">

**Author:** ![andrewsanchez](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/andrewsanchez/32/10294_2.png) [@andrewsanchez](https://forums.ankiweb.net/u/andrewsanchez)\
**Post date:** [January 6, 2021, 3:46pm UTC](https://forums.ankiweb.net/t/how-many-lines-of-code-and-how-many-files-are-there-in-the-anki-python-and-java-apps/6303/3 "2021-01-06T15:46:39Z")

</div>

GitHub has some built-in analytics: [Code frequency · ankitects/anki · GitHub](https://github.com/ankitects/anki/graphs/code-frequency)

---

<div class="post-metadata">

**Author:** ![theankilearner](https://avatars.discourse-cdn.com/v4/letter/t/74df32/32.png) [@theankilearner](https://forums.ankiweb.net/u/theankilearner)\
**Post date:** [January 7, 2021, 8:19am UTC](https://forums.ankiweb.net/t/how-many-lines-of-code-and-how-many-files-are-there-in-the-anki-python-and-java-apps/6303/4 "2021-01-07T08:19:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![cardosaum](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/cardosaum/32/2384_2.png) [@cardosaum](https://forums.ankiweb.net/u/cardosaum)\
**Post date:** [January 7, 2021, 11:17am UTC](https://forums.ankiweb.net/t/how-many-lines-of-code-and-how-many-files-are-there-in-the-anki-python-and-java-apps/6303/5 "2021-01-07T11:17:31Z")

</div>

I just cloned the [Anki repo at github](https://github.com/ankitects/anki), then ran `scc`

```auto
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
```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [May 1, 2023, 3:19am UTC](https://forums.ankiweb.net/t/how-many-lines-of-code-and-how-many-files-are-there-in-the-anki-python-and-java-apps/6303/6 "2023-05-01T03:19:57Z")

</div>

Closed on May 1, 2023, 3:19am UTC


