Repository Analysis

ankitects/anki

Anki is a smart spaced repetition flashcard program

5.1 Low AI signal View on GitHub
5.1
Adjusted Score
5.1
Raw Score
100%
Time Factor
2026-05-30
Last Push
28,263
Stars
Rust
Language
181,213
Lines of Code
1368
Files
869
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 1HIGH 4MEDIUM 20LOW 844

Pattern Findings

869 matches across 13 categories. Click a row to expand file-level details.

Unused Imports405 hits · 390 pts
SeverityFileLineSnippet
LOWpylib/hatch_build.py5
LOWpylib/hatch_build.py6
LOWpylib/tools/hookslib.py8
LOWpylib/tests/test_stats.py7
LOWpylib/tests/test_exporting.py4
LOWpylib/tests/test_exporting.py10
LOWpylib/tests/test_schedv3.py5
LOWpylib/tests/test_schedv3.py7
LOWpylib/tests/test_schedv3.py8
LOWpylib/tests/test_schedv3.py10
LOWpylib/tests/test_schedv3.py12
LOWpylib/tests/test_schedv3.py13
LOWpylib/tests/test_collection.py8
LOWpylib/tests/test_collection.py12
LOWpylib/tests/shared.py4
LOWpylib/tests/test_importing.py9
LOWpylib/tests/test_importing.py11
LOWpylib/tests/test_find.py8
LOWpylib/tests/test_models.py6
LOWpylib/tests/test_models.py11
LOWpylib/tests/test_httpclient.py4
LOWpylib/anki/tags.py12
LOWpylib/anki/lang.py4
LOWpylib/anki/sound.py10
LOWpylib/anki/db.py12
LOWpylib/anki/hooks.py14
LOWpylib/anki/hooks.py22
LOWpylib/anki/media.py4
LOWpylib/anki/media.py15
LOWpylib/anki/config.py20
LOWpylib/anki/httpclient.py8
LOWpylib/anki/models.py4
LOWpylib/anki/models.py19
LOWpylib/anki/_backend.py4
LOWpylib/anki/_backend.py14
LOWpylib/anki/stdmodels.py4
LOWpylib/anki/cards.py4
LOWpylib/anki/cards.py17
LOWpylib/anki/notes.py4
LOWpylib/anki/consts.py4
LOWpylib/anki/exporting.py5
LOWpylib/anki/utils.py4
LOWpylib/anki/dbproxy.py4
LOWpylib/anki/dbproxy.py13
LOWpylib/anki/stats.py5
LOWpylib/anki/stats.py15
LOWpylib/anki/collection.py4
LOWpylib/anki/collection.py76
LOWpylib/anki/template.py29
LOWpylib/anki/find.py5
LOWpylib/anki/errors.py4
LOWpylib/anki/rsbackend.py9
LOWpylib/anki/rsbackend.py10
LOWpylib/anki/rsbackend.py10
LOWpylib/anki/rsbackend.py11
LOWpylib/anki/rsbackend.py12
LOWpylib/anki/rsbackend.py13
LOWpylib/anki/rsbackend.py13
LOWpylib/anki/decks.py4
LOWpylib/anki/decks.py18
345 more matches not shown…
Hyper-Verbose Identifiers253 hits · 264 pts
SeverityFileLineSnippet
LOWpylib/tests/test_utils.py52def test_int_version_rejects_garbage():
LOWpylib/tests/test_schedv3.py627def test_filt_reviewing_early_normal():
LOWpylib/tests/test_importing.py244def test_tsv_tag_multiple_tags():
LOWpylib/tests/test_importing.py278def test_csv_tag_only_if_modified():
LOWpylib/tests/test_httpclient.py14def test_http_client_mounts_system_store_adapter() -> None:
LOWpylib/tests/test_httpclient.py23def test_system_store_adapter_does_not_use_certifi_for_default_verification(
LOWpylib/tests/test_httpclient.py26 def fail_if_parent_verification_is_used(*_args, **_kwargs) -> None:
LOWpylib/tests/test_httpclient.py45def test_noverifyssl_disables_ssl_verification(
LOWpylib/anki/lang.py245def without_unicode_isolation(string: str) -> str:
LOWpylib/anki/lang.py249def with_collapsed_whitespace(string: str) -> str:
LOWpylib/anki/media.py23def media_paths_from_col_path(col_path: str) -> tuple[str, str]:
LOWpylib/anki/media.py103 def add_extension_based_on_mime(self, fname: str, content_type: str) -> str:
LOWpylib/anki/media.py152 def extract_static_media_files(self, mid: NotetypeId) -> Sequence[str]:
LOWpylib/anki/models.py380 def get_single_notetype_of_notes(
LOWpylib/anki/models.py410 def restore_notetype_to_stock(
LOWpylib/anki/_backend.py153 def compute_params_from_items(self, items: Iterable[FsrsItem]) -> Sequence[float]:
LOWpylib/anki/_backend.py203def backend_exception_to_pylib(err: backend_pb2.BackendError) -> Exception:
LOWpylib/anki/stdmodels.py74def _legacy_add_basic_typing_model(
LOWpylib/anki/stdmodels.py82def _legacy_add_forward_reverse(
LOWpylib/anki/stdmodels.py90def _legacy_add_forward_optional_reverse(
LOWpylib/anki/cards.py206 def replay_question_audio_on_answer_side(self) -> bool:
LOWpylib/anki/collection.py140 def initialize_backend_logging() -> None:
LOWpylib/anki/collection.py354 def export_collection_package(
LOWpylib/anki/collection.py425 def export_dataset_for_research(
LOWpylib/anki/collection.py436 def add_image_occlusion_notetype(self) -> None:
LOWpylib/anki/collection.py463 def update_image_occlusion_note(
LOWpylib/anki/collection.py585 def default_deck_for_notetype(self, notetype_id: NotetypeId) -> DeckId | None:
LOWpylib/anki/collection.py612 def remove_cards_and_orphaned_notes(
LOWpylib/anki/collection.py884 def load_browser_card_columns(self) -> list[str]:
LOWpylib/anki/collection.py896 def load_browser_note_columns(self) -> list[str]:
LOWpylib/anki/collection.py986 def _get_load_balancer_enabled(self) -> bool:
LOWpylib/anki/collection.py989 def _set_load_balancer_enabled(self, value: bool) -> None:
LOWpylib/anki/collection.py996 def _get_enable_fsrs_short_term_with_steps(self) -> bool:
LOWpylib/anki/collection.py999 def _set_enable_fsrs_short_term_with_steps(self, value: bool) -> None:
LOWpylib/anki/collection.py1081 def _check_backend_undo_status(self) -> UndoStatus | None:
LOWpylib/anki/decks.py104 def add_normal_deck_with_name(self, name: str) -> OpChangesWithId:
LOWpylib/anki/decks.py295 def get_deck_configs_for_update(self, deck_id: DeckId) -> DeckConfigsForUpdate:
LOWpylib/anki/decks.py361 def set_config_id_for_deck_dict(self, deck: DeckDict, id: DeckConfigId) -> None:
LOWpylib/anki/_legacy.py35def print_deprecation_warning(msg: str, frame: int = 1) -> None:
LOWpylib/anki/_legacy.py48def _print_replacement_warning(old: str, new: str, frame: int = 1) -> None:
LOWpylib/anki/_legacy.py53def _get_remapped_and_replacement(
LOWpylib/anki/_legacy.py89 def register_deprecated_aliases(cls, **kwargs: DeprecatedAliasTarget) -> None:
LOWpylib/anki/_legacy.py99 def register_deprecated_attributes(
LOWpylib/anki/_legacy.py156 def register_deprecated_aliases(self, **kwargs: DeprecatedAliasTarget) -> None:
LOWpylib/anki/_legacy.py159 def register_deprecated_attributes(
LOWpylib/anki/latex.py87def render_latex_returning_errors(
LOWpylib/anki/scheduler/legacy.py119 def total_rev_for_current_deck(self) -> int:
LOWpylib/anki/scheduler/v3.py188 def _interval_for_normal_state(
LOWpylib/anki/scheduler/v3.py204 def _interval_for_filtered_state(
LOWpylib/anki/scheduler/base.py126 def get_or_create_filtered_deck(self, deck_id: DeckId) -> FilteredDeckForUpdate:
LOWpylib/anki/scheduler/base.py129 def add_or_update_filtered_deck(
LOWpylib/anki/scheduler/base.py134 def filtered_deck_order_labels(self) -> Sequence[str]:
LOWpylib/anki/scheduler/base.py200 def schedule_cards_as_new_defaults(
LOWqt/tools/genhooks_gui.py65 def on_overview_will_render_content(overview, content):
LOWqt/tools/genhooks_gui.py348 def on_deck_browser_will_render_content(deck_browser, content):
LOWqt/tools/genhooks_gui.py531 def on_browser_will_build_tree(handled, root, stage, browser):
LOWqt/tools/genhooks_gui.py758 def on_webview_will_set_content(web_content: WebContent, context):
LOWqt/tools/genhooks_gui.py880 def on_top_toolbar_did_init_links(links, toolbar):
LOWqt/tools/build_installer.py49def get_briefcase_template_path() -> Path:
LOWqt/tools/build_installer.py58def get_briefcase_output_format() -> list[str]:
193 more matches not shown…
Excessive Try-Catch Wrapping101 hits · 109 pts
SeverityFileLineSnippet
MEDIUMtools/reload_webviews.py20 print(f"Error: {message}", file=sys.stderr)
LOWtools/reload_webviews.py42except Exception as e:
LOWpylib/tools/hookslib.py129 except Exception:
LOWpylib/tools/hookslib.py165 except Exception:
LOWpylib/tests/test_importing.py28 except Exception:
LOWpylib/anki/lang.py212 except Exception:
LOWpylib/anki/hooks.py37 except Exception:
LOWpylib/anki/hooks.py48 except Exception:
LOWpylib/anki/syncserver.py15 except Exception as exc:
LOWpylib/anki/_backend.py120 except Exception as error:
LOWpylib/anki/_backend.py163 except Exception as error:
LOWpylib/anki/notes.py163 except Exception as exc:
LOWpylib/anki/utils.py31except Exception:
LOWpylib/anki/utils.py217 except Exception:
LOWpylib/anki/utils.py291 except Exception:
LOWpylib/anki/stats.py725 except Exception:
LOWpylib/anki/latex.py173 except Exception:
LOWpylib/anki/importing/apkg.py42 except Exception as exc:
LOWpylib/anki/importing/csvfile.py101 except Exception:
LOWpylib/anki/importing/csvfile.py104 except Exception:
LOWpylib/anki/importing/csvfile.py109 except Exception:
LOWpylib/anki/importing/csvfile.py128 except Exception:
LOWqt/launcher/versions.py38 except Exception as e:
MEDIUMqt/launcher/versions.py39 print(f"Error fetching versions: {e}", file=sys.stderr)
LOWqt/launcher/addon/__init__.py80 except Exception as e:
LOWqt/aqt/package.py138 except Exception as e:
LOWqt/aqt/sync.py52 except Exception as e:
LOWqt/aqt/sync.py112 except Exception as err:
LOWqt/aqt/sync.py261 except Exception as err:
LOWqt/aqt/sync.py293 except Exception as err:
LOWqt/aqt/sync.py323 except Exception as err:
LOWqt/aqt/deckconf.py270 except Exception:
LOWqt/aqt/sound.py377 except Exception as e:
LOWqt/aqt/sound.py390 except Exception as e:
LOWqt/aqt/sound.py570 except Exception as e:
LOWqt/aqt/sound.py870 except Exception as e:
LOWqt/aqt/theme.py357 except Exception:
LOWqt/aqt/importing.py213 except Exception as e:
LOWqt/aqt/importing.py365 except Exception as e:
LOWqt/aqt/importing.py404 except Exception as e:
LOWqt/aqt/ankihub.py42 except Exception as exc:
LOWqt/aqt/addons.py250 except Exception:
LOWqt/aqt/addons.py343 except Exception:
LOWqt/aqt/addons.py501 except Exception:
LOWqt/aqt/addons.py655 except Exception:
LOWqt/aqt/addons.py1134 except Exception as e:
LOWqt/aqt/addons.py1607 except Exception as exc:
LOWqt/aqt/addons.py1719 except Exception as e:
LOWqt/aqt/preferences.py438 except Exception:
LOWqt/aqt/mpv.py399 except Exception:
LOWqt/aqt/tts.py499 except Exception as exc:
LOWqt/aqt/tts.py515 except Exception:
LOWqt/aqt/tts.py521 except Exception:
LOWqt/aqt/__init__.py240 except Exception:
LOWqt/aqt/__init__.py586 except Exception:
LOWqt/aqt/__init__.py660 except Exception:
LOWqt/aqt/__init__.py744 except Exception:
LOWqt/aqt/debug_console.py351 except Exception:
LOWqt/aqt/changenotetype.py91 except Exception as e:
LOWqt/aqt/exporting.py194 except Exception as exc:
41 more matches not shown…
Deep Nesting63 hits · 62 pts
SeverityFileLineSnippet
LOWpylib/anki/_backend.py203
LOWpylib/anki/exporting.py199
LOWpylib/anki/utils.py272
LOWpylib/anki/stats.py211
LOWpylib/anki/stats.py959
LOWpylib/anki/collection.py211
LOWpylib/anki/foreign_data/mnemosyne.py175
LOWpylib/anki/scheduler/v3.py66
LOWpylib/anki/scheduler/v3.py152
LOWpylib/anki/scheduler/v3.py188
LOWpylib/anki/scheduler/v3.py216
LOWpylib/anki/importing/noteimp.py116
LOWpylib/anki/importing/anki2.py92
LOWpylib/anki/importing/csvfile.py29
LOWpylib/anki/importing/csvfile.py92
LOWpylib/anki/importing/mnemo.py19
LOWqt/launcher/versions.py13
LOWqt/aqt/sync.py138
LOWqt/aqt/sound.py364
LOWqt/aqt/customstudy.py90
LOWqt/aqt/customstudy.py158
LOWqt/aqt/customstudy.py177
LOWqt/aqt/theme.py211
LOWqt/aqt/importing.py338
LOWqt/aqt/importing.py165
LOWqt/aqt/importing.py389
LOWqt/aqt/preferences.py464
LOWqt/aqt/mpv.py174
LOWqt/aqt/mpv.py250
LOWqt/aqt/__init__.py482
LOWqt/aqt/__init__.py411
LOWqt/aqt/__init__.py494
LOWqt/aqt/studydeck.py104
LOWqt/aqt/overview.py96
LOWqt/aqt/overview.py152
LOWqt/aqt/utils.py290
LOWqt/aqt/utils.py940
LOWqt/aqt/utils.py127
LOWqt/aqt/reviewer.py203
LOWqt/aqt/reviewer.py221
LOWqt/aqt/reviewer.py502
LOWqt/aqt/reviewer.py675
LOWqt/aqt/editor.py438
LOWqt/aqt/editor.py990
LOWqt/aqt/editor.py1042
LOWqt/aqt/editor.py1702
LOWqt/aqt/webview.py627
LOWqt/aqt/main.py863
LOWqt/aqt/addcards.py218
LOWqt/aqt/addcards.py314
LOWqt/aqt/deckbrowser.py105
LOWqt/aqt/mediasrv.py223
LOWqt/aqt/mediasrv.py328
LOWqt/aqt/mediasrv.py369
LOWqt/aqt/browser/browser.py183
LOWqt/aqt/browser/browser.py220
LOWqt/aqt/browser/previewer.py206
LOWqt/aqt/browser/sidebar/tree.py273
LOWqt/aqt/browser/sidebar/tree.py455
LOWqt/aqt/browser/sidebar/tree.py519
3 more matches not shown…
Over-Commented Block23 hits · 23 pts
SeverityFileLineSnippet
LOWftl/copy-core-string.sh1#!/bin/bash
LOWftl/remove-unused.sh1#!/bin/bash
LOWftl/src/main.rs21
LOWpylib/tests/test_schedv3.py61 # t = mm.new_template("Reverse")
LOWqt/aqt/addons.py181 "properties": {
LOWqt/aqt/mpv.py1# ------------------------------------------------------------------------------
LOWqt/aqt/__init__.py101profiler: cProfile.Profile | None = None
LOW…ux-template/{{ cookiecutter.format }}/bootstrap/main.c1//
LOWrslib/linkchecker/src/lib.rs1// Copyright: Ankitects Pty Ltd and contributors
LOWrslib/proto_gen/src/lib.rs21use prost_reflect::MessageDescriptor;
LOWrslib/src/import_export/text/csv/metadata.rs201 }
LOWrslib/src/sync/version.rs21///
LOWrslib/src/revlog/mod.rs41 /// - 0 represents manual rescheduling.
LOWts/lib/domlib/surround/surround.test.ts281 });
LOWts/lib/domlib/surround/surround.test.ts301// expect(removedNodes).toHaveLength(0);
LOWts/lib/domlib/surround/surround.test.ts321// });
LOWts/lib/domlib/surround/surround.test.ts341
LOWts/lib/domlib/surround/unsurround.test.ts21 unsurround(range, body, easyBold);
LOWts/lib/domlib/surround/unsurround.test.ts61 });
LOWts/lib/domlib/surround/unsurround.test.ts81// });
LOWts/lib/domlib/surround/unsurround.test.ts121 unsurround(range, body, easyBold);
LOWts/routes/graphs/graph-styles.ts1// Copyright: Ankitects Pty Ltd and contributors
LOWts/routes/tmp/_page.ts1// Copyright: Ankitects Pty Ltd and contributors
Self-Referential Comments8 hits · 22 pts
SeverityFileLineSnippet
MEDIUMpylib/tools/genhooks.py133# This file is automatically generated; edit tools/genhooks.py instead.
MEDIUMqt/tools/genhooks_gui.py18# This file is automatically generated; edit tools/genhooks_gui.py instead.
MEDIUMqt/aqt/sound.py651 # Create the audio source with the chosen format
MEDIUMqt/aqt/log.py42 # Create a new add-on logger
MEDIUMqt/aqt/webview.py155 # Create a new profile if not cached
MEDIUMqt/mac/build.sh15# Create the wheel using uv
MEDIUMrslib/i18n/python.rs67# This file is automatically generated from the *.ftl files.
MEDIUM.github/scripts/setup_apple_signing.sh9# Create a temporary keychain
Cross-Language Confusion4 hits · 18 pts
SeverityFileLineSnippet
HIGHqt/aqt/url_schemes.py57 tr.preferences_url_scheme_warning(link=url.toString(), scheme=url.scheme())
HIGHqt/aqt/editor.py1694 url = qurl.toString()
HIGHqt/aqt/profiles.py415(name text primary key collate nocase, data blob not null);"""
HIGHqt/tests/launch_anki_for_e2e.py69 "create table profiles (name text primary key collate nocase, data blob not null)"
Hallucination Indicators1 hit · 10 pts
SeverityFileLineSnippet
CRITICALqt/aqt/editor.py1779 path = os.path.join(self.editor.mw.col.media.dir(), file_name)
AI Slop Vocabulary3 hits · 6 pts
SeverityFileLineSnippet
LOWqt/hatch_build.py56 # For editable installs, just add anki without version constraint
MEDIUMqt/tests/launch_anki_for_e2e.py102 # Headless Qt: the e2e harness only needs mediasrv's HTTP stack,
MEDIUMts/licenses.json789 "repository": "https://github.com/mourner/robust-predicates",
Redundant / Tautological Comments4 hits · 6 pts
SeverityFileLineSnippet
LOWqt/aqt/sound.py705 # Check if we need to convert float samples to int16
LOWqt/aqt/importing.py142 # Check if the entered value is valid and if not fallback to default
LOWdocs/syncserver/entrypoint.sh15# Check if group exists, create if not
LOWdocs/syncserver/entrypoint.sh20# Check if user exists, create if not
Decorative Section Separators2 hits · 6 pts
SeverityFileLineSnippet
MEDIUMqt/aqt/mpv.py1# ------------------------------------------------------------------------------
MEDIUMqt/aqt/mpv.py25# ------------------------------------------------------------------------------
Dead Code1 hit · 2 pts
SeverityFileLineSnippet
MEDIUMqt/aqt/importing.py446
Overly Generic Function Names1 hit · 1 pts
SeverityFileLineSnippet
LOWqt/aqt/mediasrv.py328def handle_request(pathin: str) -> Response: