Skip to content

Code quality

ALN** occurrences by order of importance

NOQA Number of occurrences
ALN069: You can't import models from other components, see: https://www.notion.so/alaninsurance/Modular-monolith-a9d84f1318d34115bbd08b3648e5a587 ⧉", 18
ALN043: You can only import things from a Component public module, see: https://www.notion.so/alaninsurance/Modular-monolith-a9d84f1318d34115bbd08b3648e5a587 ⧉", 91
ALN039: The module public cannot import other components (or from apps/), it's meant to be the public interface of the component #{self.component_name}, see: https://www.notion.so/alaninsurance/Modular-monolith-a9d84f1318d34115bbd08b3648e5a587 ⧉", 9
ALN027: This class checks that no protected attribute access is used. 1
ALN059: Checks that all component dependencies are declared in the root of a component 94
ALN085: Enforces SQLAlchemy 2.0 query style by detecting deprecated patterns that will be removed in SQLAlchemy 2.0. This linter checks for: 1. Usage of session.query() which is deprecated in favor of session.scalar(), session.scalars(), or session.execute() Note: Other SQLAlchemy 2.0 deprecation warnings are already being turned into errors at runtime by the _turn_sql_alchemy_warning_into_errors function in backend/shared/models/orm/sqlalchemy.py. 166

Listing of files of the most critical ALN**

ALN069 occurs 18 times

File:line Content
components/gamification/public/controllers/tests/test_reactions.py:17 ⧉ from components.fr.internal.models.tests.test_user import ( # noqa: ALN039, ALN059, ALN069
components/gamification/public/controllers/tests/test_reactions.py:83 ⧉ from components.fr.internal.models.tests.test_user import ( # noqa: ALN039, ALN059, ALN069
components/gamification/public/controllers/tests/test_reactions.py:114 ⧉ from components.fr.internal.models.tests.test_user import ( # noqa: ALN039, ALN059, ALN069
components/gamification/public/controllers/tests/test_duels.py:32 ⧉ from components.fr.internal.models.tests.test_user import ( # noqa: ALN039, ALN059, ALN069
components/gamification/public/controllers/tests/test_duels.py:70 ⧉ from components.fr.internal.models.tests.test_user import ( # noqa: ALN039, ALN059, ALN069
components/gamification/public/controllers/tests/test_duels.py:95 ⧉ from components.fr.internal.models.tests.test_user import ( # noqa: ALN039, ALN059, ALN069
components/gamification/public/controllers/tests/test_duels.py:123 ⧉ from components.fr.internal.models.tests.test_user import ( # noqa: ALN039, ALN059, ALN069
components/gamification/public/controllers/tests/test_duels.py:166 ⧉ from components.fr.internal.models.tests.test_user import ( # noqa: ALN039, ALN059, ALN069
components/gamification/public/controllers/tests/test_duels.py:267 ⧉ from components.fr.internal.models.tests.test_user import ( # noqa: ALN039, ALN059, ALN069
components/gamification/internal/business_logic/queries/tests/test_users.py:15 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043, ALN059, ALN069
components/gamification/internal/business_logic/queries/tests/test_users.py:18 ⧉ from components.fr.internal.tests.factories.contract import ( # noqa: ALN043, ALN059, ALN069
components/gamification/internal/business_logic/queries/tests/test_users.py:21 ⧉ from components.fr.internal.tests.factories.enrollment import ( # noqa: ALN043, ALN059, ALN069
components/gamification/internal/business_logic/queries/tests/test_users.py:24 ⧉ from components.fr.internal.tests.factories.insurance_profile import ( # noqa: ALN043, ALN059, ALN069
components/gamification/internal/business_logic/queries/tests/test_users.py:27 ⧉ from components.fr.internal.tests.factories.policy import ( # noqa: ALN043, ALN059, ALN069
components/gamification/internal/business_logic/queries/tests/test_users.py:30 ⧉ from components.fr.internal.tests.factories.user import ( # noqa: ALN043, ALN059, ALN069
components/gamification/internal/business_logic/queries/tests/test_walk_badges.py:11 ⧉ from components.eyewear.internal.models.tests.factories.eyewear_frame_order_factory import ( # noqa: ALN069 # ,
components/gamification/internal/business_logic/queries/tests/test_walk_badges.py:14 ⧉ from components.eyewear.internal.models.tests.factories.eyewear_user_factory import ( # noqa: ALN069 # ,
components/gamification/internal/helpers/tests/test_insurance.py:8 ⧉ from components.fr.internal.models.enums.employee_termination_type import ( # noqa: ALN059, ALN069

ALN043 occurs 91 times

File:line Content
components/gamification/internal/business_logic/actions/walk_leagues.py:331 ⧉ invalidate_account_leagues_metadata_cached, # noqa: ALN043
components/gamification/internal/business_logic/actions/tests/test_walk_history.py:26 ⧉ from components.fr.internal.tests.factories.user import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_walk_history.py:90 ⧉ from components.fr.internal.tests.factories.user import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_walk_history.py:135 ⧉ from components.fr.internal.tests.factories.user import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_walk_history.py:201 ⧉ from components.fr.bootstrap.dependencies.gamification import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_walk_history.py:204 ⧉ from components.fr.internal.tests.factories.user import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_walk_history.py:252 ⧉ from components.fr.bootstrap.dependencies.gamification import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_walk_history.py:255 ⧉ from components.fr.internal.tests.factories.user import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_walk_history.py:299 ⧉ from components.fr.bootstrap.dependencies.gamification import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_walk_history.py:302 ⧉ from components.fr.internal.tests.factories.user import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_walk_history.py:404 ⧉ from components.fr.internal.tests.factories.user import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_player.py:16 ⧉ from components.fr.internal.tests.factories.user import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_player.py:41 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_player.py:44 ⧉ from components.fr.internal.tests.factories.contract import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_player.py:47 ⧉ from components.fr.internal.tests.factories.enrollment import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_player.py:50 ⧉ from components.fr.internal.tests.factories.insurance_profile import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_player.py:53 ⧉ from components.fr.internal.tests.factories.policy import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_player.py:56 ⧉ from components.fr.internal.tests.factories.user import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_player.py:138 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_player.py:141 ⧉ from components.fr.internal.tests.factories.user import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_walk_progress.py:13 ⧉ from components.fr.bootstrap.dependencies.gamification import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_walk_progress.py:16 ⧉ from components.fr.internal.tests.factories.user import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_walk_progress.py:192 ⧉ from components.fr.internal.tests.factories.user import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_walk_progress.py:310 ⧉ from components.fr.bootstrap.dependencies.gamification import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_walk_progress.py:313 ⧉ from components.fr.internal.tests.factories.user import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_walk_progress.py:349 ⧉ from components.fr.internal.tests.factories.user import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_walk_leagues.py:49 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_walk_leagues.py:76 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_walk_leagues.py:120 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_walk_leagues.py:157 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_walk_leagues.py:283 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_walk_leagues.py:319 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_walk_leagues.py:357 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/actions/tests/test_walk_leaderboard.py:11 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/queries/tests/test_players.py:17 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/queries/tests/test_players.py:186 ⧉ from components.fr.internal.tests.factories.account import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/queries/tests/test_players.py:189 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/queries/tests/test_team_challenge_team.py:5 ⧉ from components.fr.bootstrap.dependencies.gamification import ( # noqa: ALN043
components/gamification/internal/business_logic/queries/tests/test_team_challenge_team.py:8 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043
components/gamification/internal/business_logic/queries/tests/test_records.py:131 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/queries/tests/test_users.py:12 ⧉ from components.fr.bootstrap.dependencies.gamification import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/queries/tests/test_users.py:15 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043, ALN059, ALN069
components/gamification/internal/business_logic/queries/tests/test_users.py:18 ⧉ from components.fr.internal.tests.factories.contract import ( # noqa: ALN043, ALN059, ALN069
components/gamification/internal/business_logic/queries/tests/test_users.py:21 ⧉ from components.fr.internal.tests.factories.enrollment import ( # noqa: ALN043, ALN059, ALN069
components/gamification/internal/business_logic/queries/tests/test_users.py:24 ⧉ from components.fr.internal.tests.factories.insurance_profile import ( # noqa: ALN043, ALN059, ALN069
components/gamification/internal/business_logic/queries/tests/test_users.py:27 ⧉ from components.fr.internal.tests.factories.policy import ( # noqa: ALN043, ALN059, ALN069
components/gamification/internal/business_logic/queries/tests/test_users.py:30 ⧉ from components.fr.internal.tests.factories.user import ( # noqa: ALN043, ALN059, ALN069
components/gamification/internal/business_logic/queries/tests/test_walk_eligibility.py:13 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/queries/tests/test_walk_eligibility.py:16 ⧉ from components.fr.internal.tests.factories.contract import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/queries/tests/test_walk_eligibility.py:19 ⧉ from components.fr.internal.tests.factories.enrollment import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/queries/tests/test_walk_eligibility.py:22 ⧉ from components.fr.internal.tests.factories.insurance_profile import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/queries/tests/test_walk_eligibility.py:25 ⧉ from components.fr.internal.tests.factories.policy import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/queries/tests/test_walk_eligibility.py:28 ⧉ from components.fr.internal.tests.factories.user import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/queries/tests/test_walk_badges.py:5 ⧉ from components.clinic.internal.tests.factories.clinic_user import ( # noqa: ALN043 # ,
components/gamification/internal/business_logic/queries/tests/test_walk_badges.py:8 ⧉ from components.clinic.internal.tests.factories.medical_conversation import ( # noqa: ALN043 # ,
components/gamification/internal/business_logic/queries/tests/test_streak.py:295 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/queries/tests/test_walk_leagues.py:35 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/queries/tests/test_walk_leagues.py:55 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/queries/tests/test_walk_leagues.py:100 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/queries/tests/test_walk_leagues.py:194 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/queries/tests/test_team_challenge_leaderboard.py:5 ⧉ from components.fr.bootstrap.dependencies.gamification import ( # noqa: ALN043
components/gamification/internal/business_logic/queries/tests/test_team_challenge_leaderboard.py:8 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043
components/gamification/internal/business_logic/queries/tests/test_walk_leaderboard.py:43 ⧉ from components.fr.bootstrap.dependencies.gamification import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/queries/tests/test_walk_leaderboard.py:46 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/queries/tests/test_walk_leaderboard.py:184 ⧉ from components.fr.bootstrap.dependencies.gamification import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/queries/tests/test_walk_leaderboard.py:187 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/queries/tests/test_walk_leaderboard.py:298 ⧉ from components.fr.bootstrap.dependencies.gamification import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/queries/tests/test_walk_leaderboard.py:301 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/queries/tests/test_walk_leaderboard.py:361 ⧉ from components.fr.bootstrap.dependencies.gamification import ( # noqa: ALN043, ALN059
components/gamification/internal/business_logic/queries/tests/test_walk_leaderboard.py:364 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043, ALN059
components/gamification/internal/helpers/tests/test_date.py:11 ⧉ from components.fr.bootstrap.dependencies.gamification import ( # noqa: ALN043, ALN059
components/gamification/internal/helpers/tests/test_date.py:50 ⧉ from components.fr.bootstrap.dependencies.gamification import ( # noqa: ALN043, ALN059
components/gamification/internal/helpers/tests/test_date.py:93 ⧉ from components.fr.bootstrap.dependencies.gamification import ( # noqa: ALN043, ALN059
components/gamification/internal/helpers/tests/test_insurance.py:11 ⧉ from components.fr.internal.tests.factories.contract import ( # noqa: ALN043, ALN059
components/gamification/internal/helpers/tests/test_insurance.py:14 ⧉ from components.fr.internal.tests.factories.enrollment import ( # noqa: ALN043, ALN059
components/gamification/internal/helpers/tests/test_insurance.py:17 ⧉ from components.fr.internal.tests.factories.insurance_profile import ( # noqa: ALN043, ALN059
components/gamification/internal/helpers/tests/test_insurance.py:20 ⧉ from components.fr.internal.tests.factories.policy import ( # noqa: ALN043, ALN059
components/gamification/internal/helpers/tests/test_insurance.py:23 ⧉ from components.fr.internal.tests.factories.policy_ani_contract import ( # noqa: ALN043, ALN059
components/gamification/internal/helpers/tests/test_insurance.py:26 ⧉ from components.fr.internal.tests.factories.user import ( # noqa: ALN043, ALN059
components/gamification/internal/helpers/tests/test_insurance.py:57 ⧉ from components.fr.bootstrap.dependencies.gamification import ( # noqa: ALN043, ALN059
components/gamification/internal/helpers/tests/test_insurance.py:60 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043, ALN059
components/gamification/internal/helpers/tests/test_insurance.py:87 ⧉ from components.fr.bootstrap.dependencies.gamification import ( # noqa: ALN043, ALN059
components/gamification/internal/helpers/tests/test_insurance.py:90 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043, ALN059
components/gamification/internal/helpers/tests/test_insurance.py:93 ⧉ from components.fr.internal.tests.factories.company_admin import ( # noqa: ALN043, ALN059
components/gamification/internal/helpers/tests/test_insurance.py:136 ⧉ from components.fr.internal.tests.factories.company import ( # noqa: ALN043, ALN059
components/gamification/internal/helpers/tests/test_insurance.py:139 ⧉ from components.fr.internal.tests.factories.company_admin import ( # noqa: ALN043, ALN059
components/gamification/internal/models/tests/factories.py:5 ⧉ from components.fr.internal.tests.factories.contract import ( # noqa: ALN043, ALN059
components/gamification/internal/models/tests/factories.py:8 ⧉ from components.fr.internal.tests.factories.enrollment import ( # noqa: ALN043, ALN059
components/gamification/internal/models/tests/factories.py:11 ⧉ from components.fr.internal.tests.factories.insurance_profile import ( # noqa: ALN043, ALN059
components/gamification/internal/models/tests/factories.py:14 ⧉ from components.fr.internal.tests.factories.policy import ( # noqa: ALN043, ALN059
components/gamification/internal/models/tests/factories.py:17 ⧉ from components.fr.internal.tests.factories.user import ( # noqa: ALN043, ALN059

ALN039 occurs 9 times

File:line Content
components/gamification/public/controllers/tests/test_reactions.py:17 ⧉ from components.fr.internal.models.tests.test_user import ( # noqa: ALN039, ALN059, ALN069
components/gamification/public/controllers/tests/test_reactions.py:83 ⧉ from components.fr.internal.models.tests.test_user import ( # noqa: ALN039, ALN059, ALN069
components/gamification/public/controllers/tests/test_reactions.py:114 ⧉ from components.fr.internal.models.tests.test_user import ( # noqa: ALN039, ALN059, ALN069
components/gamification/public/controllers/tests/test_duels.py:32 ⧉ from components.fr.internal.models.tests.test_user import ( # noqa: ALN039, ALN059, ALN069
components/gamification/public/controllers/tests/test_duels.py:70 ⧉ from components.fr.internal.models.tests.test_user import ( # noqa: ALN039, ALN059, ALN069
components/gamification/public/controllers/tests/test_duels.py:95 ⧉ from components.fr.internal.models.tests.test_user import ( # noqa: ALN039, ALN059, ALN069
components/gamification/public/controllers/tests/test_duels.py:123 ⧉ from components.fr.internal.models.tests.test_user import ( # noqa: ALN039, ALN059, ALN069
components/gamification/public/controllers/tests/test_duels.py:166 ⧉ from components.fr.internal.models.tests.test_user import ( # noqa: ALN039, ALN059, ALN069
components/gamification/public/controllers/tests/test_duels.py:267 ⧉ from components.fr.internal.models.tests.test_user import ( # noqa: ALN039, ALN059, ALN069