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 ⧉", 7
ALN043: You can only import things from a Component public module, see: https://www.notion.so/alaninsurance/Modular-monolith-a9d84f1318d34115bbd08b3648e5a587 ⧉", 14
ALN009: Checks that models do not import business logic 1
ALN017: Do not use top of file imports for business_logic or services in controllers, admin_tools or models, unless for typing. See this Notion page : https://www.notion.so/alaninsurance/Imports-and-start-up-time-WIP-5495c8713847434986ef03ad09158bf1 ⧉ 1
ALN072: Functions decorated with @enqueueable should not use non-primitive type arguments. The function is used by RQ and the arguments must be serializable and robust for code moves/refactors. 1
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. 22

Listing of files of the most critical ALN**

ALN069 occurs 7 times

File:line Content
components/ca/internal/exemption/actions/tests/test_create_manual_exemption.py:33 ⧉ from components.onboarding.internal.models.tests.factories.factories import ( # noqa: ALN069
components/ca/internal/exemption/actions/tests/test_create_exemption_with_justification.py:19 ⧉ from components.onboarding.internal.models.tests.factories.factories import ( # noqa: ALN069
components/ca/internal/tests/factories/factories.py:101 ⧉ from components.gamification.internal.models.player import Player # noqa: ALN069
components/ca/internal/claim_management/claim_engine/steps/reimbursement_payment/business_logic/actions/tests/test_submit_reimbursement_payment.py:21 ⧉ from components.payment_gateway.subcomponents.accounts.models.tests.factories import ( # noqa: ALN069 for testing purposes
components/ca/internal/claim_management/claim_engine/steps/settlement/business_logic/actions/tests/test_reprocess_settlement_payments.py:22 ⧉ from components.payment_gateway.subcomponents.accounts.models.tests.factories import ( # noqa: ALN069 for testing purposes
components/ca/internal/user/controllers/tests/test_user_controller_smorest_migration.py:18 ⧉ from components.onboarding.internal.models.tests.factories.factories import ( # noqa: ALN069
components/ca/bootstrap/dependencies/gamification.py:174 ⧉ from components.gamification.internal.models.player import ( # noqa: ALN069

ALN043 occurs 14 times

File:line Content
components/ca/conftest.py:20 ⧉ from components.authentication.bootstrap.bootstrap import ( # noqa: ALN043 allowed in conftest
components/ca/conftest.py:24 ⧉ from components.customer_admin.bootstrap.bootstrap import ( # noqa: ALN043 allowed in conftest
components/ca/conftest.py:27 ⧉ from components.employment.bootstrap.bootstrap import ( # noqa: ALN043 allowed in conftest
components/ca/conftest.py:30 ⧉ from components.global_profile.bootstrap.bootstrap import ( # noqa: ALN043 allowed in conftest
components/ca/conftest.py:33 ⧉ from components.onboarding.bootstrap.bootstrap import ( # noqa: ALN043 allowed in conftest
components/ca/conftest.py:36 ⧉ from components.payment_gateway.bootstrap.bootstrap import ( # noqa: ALN043 allowed in conftest
components/ca/internal/customer_dashboard/controllers/tests/test_admin.py:18 ⧉ from components.global_customer_dashboard.external.queries.user import ( # noqa: ALN043
components/ca/internal/helpers/tests/base_test_app.py:21 ⧉ from components.onboarding.bootstrap.testing import ( # noqa: ALN043
components/ca/internal/tests/factories/factories.py:103 ⧉ from components.global_profile.internal.domain.tests.factories import ( # noqa: ALN043
components/ca/internal/tests/factories/factories.py:106 ⧉ from components.global_profile.internal.infrastructure.repository import ( # noqa: ALN043
components/ca/internal/user/profile/repository.py:5 ⧉ from components.global_profile.internal.domain.entities import ( # noqa: ALN043
components/ca/internal/user/profile/repository.py:8 ⧉ from components.global_profile.internal.infrastructure.repository import ( # noqa: ALN043
components/ca/internal/user/controllers/tests/test_user_controller_smorest_migration.py:15 ⧉ from components.global_profile.internal.domain.tests.factories import ( # noqa: ALN043
components/ca/bootstrap/dependencies/customer_admin.py:23 ⧉ from components.customer_admin.internal.business_logic.queries.customer_admin_repository import ( # noqa: ALN043