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 ⧉", 19
ALN043: You can only import things from a Component public module, see: https://www.notion.so/alaninsurance/Modular-monolith-a9d84f1318d34115bbd08b3648e5a587 ⧉", 77
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 ⧉", 1
ALN009: Checks that models do not import business logic 1
ALN037: @property are not serialized by dataclass_json. If not a problem for your use case, please ignore (# noqa: ALN037). "See this Notion page: https://www.notion.so/alaninsurance/Dataclass-the-good-parts-8f387ec2a8e24a55af294237b97dc210#a611a9154af448a38e552c61415169df ⧉ 3
ALN047: ForeignKey columns must be indexed. Please add index=True to the Column definition and make sure the migration is created 3
ALN089: pytest fixtures with autouse=True in conftest.py files can have unwanted side-effects as they will be used in any tests in the subfolders and can inadvertently use other fixtures that add functionality. Instead, mark tests that need the fixture explicitly with @pytest.mark.usefixtures("fixture_name") or use the fixture as a parameter. 1

Listing of files of the most critical ALN**

ALN069 occurs 19 times

File:line Content
components/insurance_plan_catalog/internal/product_custom_data/es_health/models/mappers/es_health_insurance_plan_mapper.py:4 ⧉ from components.contracting.subcomponents.subscription.internal.es.models.health_contract_version import ( # noqa: ALN069
components/insurance_plan_catalog/internal/product_custom_data/es_health/models/mappers/converters/convert_contract_to_insurance_plan.py:4 ⧉ from components.contracting.subcomponents.subscription.internal.es.models.contract_option import ( # noqa: ALN069
components/insurance_plan_catalog/internal/product_custom_data/es_health/models/mappers/converters/convert_contract_to_insurance_plan.py:7 ⧉ from components.contracting.subcomponents.subscription.internal.es.models.enums.option_type import ( # noqa: ALN069
components/insurance_plan_catalog/internal/product_custom_data/es_health/models/mappers/converters/post_process_coverages.py:4 ⧉ from components.contracting.subcomponents.subscription.internal.es.models.contract_option import ( # noqa: ALN069
components/insurance_plan_catalog/internal/product_custom_data/es_health/models/mappers/converters/post_process_coverages.py:7 ⧉ from components.contracting.subcomponents.subscription.internal.es.models.enums.option_type import ( # noqa: ALN069
components/insurance_plan_catalog/internal/product_custom_data/es_health/models/mappers/converters/convert_contract_option_to_coverage_rules.py:5 ⧉ from components.contracting.subcomponents.subscription.internal.es.models.contract_option import ( # noqa: ALN069
components/insurance_plan_catalog/internal/product_custom_data/es_health/models/mappers/converters/tests/test_convert_contract_to_insurance_plan.py:8 ⧉ from components.es.internal.models.tests.factories import ( # noqa: ALN069
components/insurance_plan_catalog/internal/product_custom_data/es_health/models/mappers/converters/tests/test_post_process_coverages.py:6 ⧉ from components.contracting.subcomponents.subscription.internal.es.models.contract_option import ( # noqa: ALN069
components/insurance_plan_catalog/internal/product_custom_data/es_health/models/mappers/converters/tests/test_post_process_coverages.py:10 ⧉ from components.es.internal.models.tests.factories import ( # noqa: ALN069
components/insurance_plan_catalog/internal/product_custom_data/es_health/models/mappers/tests/test_es_health_insurance_plan_mapper.py:7 ⧉ from components.es.internal.models.tests.factories import ( # noqa: ALN069
components/insurance_plan_catalog/internal/product_custom_data/es_health/repositories/es_health_insurance_plan_repository.py:6 ⧉ from components.contracting.subcomponents.subscription.internal.es.models.health_contract import ( # noqa: ALN069
components/insurance_plan_catalog/internal/product_custom_data/es_health/repositories/es_health_insurance_plan_repository.py:9 ⧉ from components.contracting.subcomponents.subscription.internal.es.models.health_contract_version import ( # noqa: ALN069
components/insurance_plan_catalog/internal/product_custom_data/es_health/repositories/tests/test_es_health_insurance_plan_repository.py:7 ⧉ from components.es.internal.models.tests.factories import ( # noqa: ALN069
components/insurance_plan_catalog/internal/product_custom_data/ca_health_life_and_disability/repositories/ca_health_life_and_disability_insurance_plan_repository.py:9 ⧉ from components.ca.internal.offer.models.ca_health_plan import ( # noqa: ALN069
components/insurance_plan_catalog/internal/product_custom_data/ca_health_life_and_disability/repositories/tests/test_ca_health_life_and_disability_insurance_plan_repository.py:5 ⧉ from components.ca.internal.offer.models.health_plan import ( # noqa: ALN069
components/insurance_plan_catalog/internal/cli/backfill_legacy_source_mappings.py:50 ⧉ from components.contracting.subcomponents.subscription.internal.es.models.contract_option import ( # noqa: ALN069
components/insurance_plan_catalog/internal/cli/backfill_legacy_source_mappings.py:53 ⧉ from components.contracting.subcomponents.subscription.internal.es.models.health_contract_version import ( # noqa: ALN069
components/insurance_plan_catalog/internal/cli/tests/test_backfill_legacy_source_mappings.py:7 ⧉ from components.contracting.subcomponents.subscription.internal.es.models.health_contract_version import ( # noqa: ALN069
components/insurance_plan_catalog/internal/cli/tests/test_backfill_legacy_source_mappings.py:11 ⧉ from components.es.internal.models.tests.factories import ( # noqa: ALN069

ALN043 occurs 77 times

File:line Content
components/insurance_plan_catalog/public/builder_translation.py:17 ⧉ from components.offer_builder.internal.entities.builder_product import ( # noqa: ALN043, ALN039
components/insurance_plan_catalog/internal/builder_product_translation_dependency.py:43 ⧉ from components.offer_builder.internal.entities.builder_coverage import ( # noqa: ALN043
components/insurance_plan_catalog/internal/builder_product_translation_dependency.py:47 ⧉ from components.offer_builder.internal.entities.builder_product import ( # noqa: ALN043
components/insurance_plan_catalog/internal/builder_product_translation_dependency.py:50 ⧉ from components.offer_builder.internal.entities.builder_pure_premium import ( # noqa: ALN043
components/insurance_plan_catalog/internal/builder_product_translation_dependency.py:53 ⧉ from components.offer_builder.internal.entities.builder_target import ( # noqa: ALN043
components/insurance_plan_catalog/internal/builder_product_translation_dependency.py:56 ⧉ from components.offer_builder.internal.entities.computed_demographics import ( # noqa: ALN043
components/insurance_plan_catalog/internal/entities/builder_product_mapping.py:10 ⧉ from components.offer_builder.internal.entities.input_metrics import ( # noqa: ALN043
components/insurance_plan_catalog/internal/entities/builder_product_mapping.py:13 ⧉ from components.offer_builder.internal.entities.output_metrics import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/tests/utils.py:55 ⧉ from components.offer_builder.internal.entities.builder_coverage import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/tests/utils.py:58 ⧉ from components.offer_builder.internal.entities.builder_target import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/tests/utils.py:61 ⧉ from components.offer_builder.internal.entities.computed_demographics import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/es_health_builder_product_translation_dependency.py:64 ⧉ from components.offer_builder.internal.country_specific.es.enums.es_premiumness import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/es_health_builder_product_translation_dependency.py:67 ⧉ from components.offer_builder.internal.country_specific.es.enums.es_pricer_version import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/es_health_builder_product_translation_dependency.py:70 ⧉ from components.offer_builder.internal.entities.builder_coverage import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/es_health_builder_product_translation_dependency.py:74 ⧉ from components.offer_builder.internal.entities.builder_product import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/es_health_builder_product_translation_dependency.py:77 ⧉ from components.offer_builder.internal.entities.builder_pure_premium import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/es_health_builder_product_translation_dependency.py:80 ⧉ from components.offer_builder.internal.entities.builder_target import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/es_health_builder_product_translation_dependency.py:83 ⧉ from components.offer_builder.internal.entities.computed_demographics import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/es_health_builder_product_translation_dependency.py:94 ⧉ from components.offer_builder.subcomponents.pricer.internal.entities.premiums import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/conftest.py:12 ⧉ from components.global_account.internal.country_specifics.es.dependencies import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/conftest.py:27 ⧉ from components.es.internal.helpers.tests.base_test_app import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/conftest.py:36 ⧉ from components.es.bootstrap.guarantee_catalog import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/conftest.py:52 ⧉ from components.es.bootstrap.guarantee_catalog import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/conftest.py:55 ⧉ from components.guarantee_catalog.internal.business_logic.actions.guarantee_definitions_import.sync_guarantee_catalog import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/models/mappers/converters/tests/test_convert_contract_to_insurance_plan.py:7 ⧉ from components.es.external.contracting.enums import OptionType # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/models/mappers/converters/tests/test_post_process_coverages.py:9 ⧉ from components.es.external.contracting.enums import OptionType # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/models/mappers/tests/test_es_health_insurance_plan_mapper.py:6 ⧉ from components.es.external.contracting.enums import OptionType # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/repositories/es_health_insurance_plan_repository.py:12 ⧉ from components.global_account.internal.repositories.account_repository import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/repositories/tests/test_es_health_insurance_plan_repository.py:6 ⧉ from components.es.external.contracting.enums import OptionType # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/tests/test_es_health_builder_product_translation.py:53 ⧉ from components.offer_builder.internal.country_specific.es.enums.es_premiumness import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/tests/test_es_health_builder_product_translation.py:56 ⧉ from components.offer_builder.internal.entities.builder_coverage import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/tests/test_es_health_builder_product_translation.py:61 ⧉ from components.offer_builder.internal.entities.builder_price import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/tests/test_es_health_builder_product_translation.py:64 ⧉ from components.offer_builder.internal.entities.builder_pricing import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/tests/test_es_health_builder_product_translation.py:67 ⧉ from components.offer_builder.internal.entities.builder_product import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/tests/test_es_health_builder_product_translation.py:71 ⧉ from components.offer_builder.internal.entities.builder_pure_premium import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/tests/test_es_health_builder_product_translation.py:74 ⧉ from components.offer_builder.internal.entities.builder_target import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/tests/test_es_health_builder_product_translation.py:77 ⧉ from components.offer_builder.internal.entities.computed_demographics import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/tests/test_es_health_builder_product_translation.py:91 ⧉ from components.offer_builder.shared.constants.builder_constants import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/tests/test_es_health_builder_product_translation.py:94 ⧉ from components.offer_builder.subcomponents.pricer.internal.entities.premiums import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/es_health/tests/test_es_health_builder_product_translation.py:97 ⧉ from components.offer_builder.subcomponents.pricer_v1.protected.entities.price_structure import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/ca_health_life_and_disability/conftest.py:20 ⧉ from components.ca.internal.helpers.tests.base_test_app import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/ca_health_life_and_disability/conftest.py:29 ⧉ from components.ca.bootstrap.guarantee_catalog import ( # noqa: ALN043
components/insurance_plan_catalog/internal/product_custom_data/ca_health_life_and_disability/repositories/tests/test_ca_health_life_and_disability_insurance_plan_repository.py:8 ⧉ from components.ca.internal.tests.factories.factories import ( # noqa: ALN043
components/insurance_plan_catalog/internal/repositories/models/builder_product_mapping.py:18 ⧉ from components.offer_builder.internal.entities.input_metrics import ( # noqa: ALN043
components/insurance_plan_catalog/internal/repositories/models/builder_product_mapping.py:21 ⧉ from components.offer_builder.internal.entities.output_metrics import ( # noqa: ALN043
components/insurance_plan_catalog/internal/repositories/mappers/tests/test_builder_product_mapping_mapper.py:14 ⧉ from components.offer_builder.internal.entities.input_metrics import ( # noqa: ALN043
components/insurance_plan_catalog/internal/repositories/mappers/tests/test_builder_product_mapping_mapper.py:17 ⧉ from components.offer_builder.internal.entities.output_metrics import ( # noqa: ALN043
components/insurance_plan_catalog/internal/repositories/tests/test_builder_product_mapping_repository.py:17 ⧉ from components.offer_builder.internal.entities.input_metrics import ( # noqa: ALN043
components/insurance_plan_catalog/internal/repositories/tests/test_builder_product_mapping_repository.py:20 ⧉ from components.offer_builder.internal.entities.output_metrics import ( # noqa: ALN043
components/insurance_plan_catalog/internal/cli/tests/test_backfill_legacy_source_mappings.py:10 ⧉ from components.es.external.contracting.enums import OptionType # noqa: ALN043
components/insurance_plan_catalog/internal/business_logic/builder_product_translation.py:191 ⧉ from components.offer_builder.internal.entities.builder_coverage import ( # noqa: ALN043
components/insurance_plan_catalog/internal/business_logic/builder_product_translation.py:195 ⧉ from components.offer_builder.internal.entities.builder_price import ( # noqa: ALN043
components/insurance_plan_catalog/internal/business_logic/builder_product_translation.py:198 ⧉ from components.offer_builder.internal.entities.builder_pricing import ( # noqa: ALN043
components/insurance_plan_catalog/internal/business_logic/builder_product_translation.py:201 ⧉ from components.offer_builder.internal.entities.builder_product import ( # noqa: ALN043
components/insurance_plan_catalog/internal/business_logic/builder_product_translation.py:205 ⧉ from components.offer_builder.internal.entities.builder_pure_premium import ( # noqa: ALN043
components/insurance_plan_catalog/internal/business_logic/builder_product_translation.py:208 ⧉ from components.offer_builder.internal.entities.output_metrics import ( # noqa: ALN043
components/insurance_plan_catalog/internal/business_logic/builder_product_translation.py:211 ⧉ from components.offer_builder.internal.entities.pricing_custom_settings import ( # noqa: ALN043
components/insurance_plan_catalog/internal/business_logic/builder_product_translation.py:214 ⧉ from components.offer_builder.internal.repositories.builder_product_repository import ( # noqa: ALN043
components/insurance_plan_catalog/internal/business_logic/builder_product_translation.py:229 ⧉ from components.offer_builder.shared.constants.builder_constants import ( # noqa: ALN043
components/insurance_plan_catalog/internal/business_logic/builder_product_translation.py:232 ⧉ from components.offer_builder.subcomponents.pricer_v1.protected.entities.price_structure import ( # noqa: ALN043
components/insurance_plan_catalog/internal/business_logic/tests/test_builder_product_translation.py:94 ⧉ from components.offer_builder.internal.entities.builder_coverage import ( # noqa: ALN043
components/insurance_plan_catalog/internal/business_logic/tests/test_builder_product_translation.py:98 ⧉ from components.offer_builder.internal.entities.builder_price import ( # noqa: ALN043
components/insurance_plan_catalog/internal/business_logic/tests/test_builder_product_translation.py:101 ⧉ from components.offer_builder.internal.entities.builder_pricing import ( # noqa: ALN043
components/insurance_plan_catalog/internal/business_logic/tests/test_builder_product_translation.py:104 ⧉ from components.offer_builder.internal.entities.builder_product import ( # noqa: ALN043
components/insurance_plan_catalog/internal/business_logic/tests/test_builder_product_translation.py:108 ⧉ from components.offer_builder.internal.entities.builder_target import ( # noqa: ALN043
components/insurance_plan_catalog/internal/business_logic/tests/test_builder_product_translation.py:111 ⧉ from components.offer_builder.internal.entities.computed_demographics import ( # noqa: ALN043
components/insurance_plan_catalog/internal/business_logic/tests/test_builder_product_translation.py:114 ⧉ from components.offer_builder.internal.entities.input_metrics import ( # noqa: ALN043
components/insurance_plan_catalog/internal/business_logic/tests/test_builder_product_translation.py:117 ⧉ from components.offer_builder.internal.entities.output_metrics import ( # noqa: ALN043
components/insurance_plan_catalog/internal/business_logic/tests/test_builder_product_translation.py:120 ⧉ from components.offer_builder.internal.entities.pricing_custom_settings import ( # noqa: ALN043
components/insurance_plan_catalog/internal/business_logic/tests/test_builder_product_translation.py:134 ⧉ from components.offer_builder.shared.enums.price_structure_type import ( # noqa: ALN043
components/insurance_plan_catalog/internal/business_logic/tests/test_builder_product_translation.py:137 ⧉ from components.offer_builder.subcomponents.pricer_v1.protected.entities.price_structure import ( # noqa: ALN043
components/insurance_plan_catalog/internal/business_logic/tests/test_plan_validations.py:12 ⧉ from components.global_account.internal.entities.factories.company_prospect import ( # noqa: ALN043
components/insurance_plan_catalog/subcomponents/builder/internal/command_handlers/create_draft_insurance_plan_from_product_change.py:15 ⧉ from components.offer_builder.internal.repositories.turing_product_change_repository import ( # noqa: ALN043
components/insurance_plan_catalog/subcomponents/builder/internal/command_handlers/tests/test_create_draft_insurance_plan_from_product_change.py:36 ⧉ from components.offer_builder.internal.entities.factories.turing_product_change import ( # noqa: ALN043
components/insurance_plan_catalog/subcomponents/builder/internal/command_handlers/tests/test_create_draft_insurance_plan_from_product_change.py:39 ⧉ from components.offer_builder.internal.repositories.turing_product_change_repository import ( # noqa: ALN043
components/insurance_plan_catalog/subcomponents/builder/internal/business_logic/create_draft_insurance_plan_from_product_change.py:42 ⧉ from components.offer_builder.internal.entities.turing_product_change import ( # noqa: ALN043
components/insurance_plan_catalog/subcomponents/builder/internal/business_logic/tests/test_create_draft_insurance_plan_from_product_change.py:45 ⧉ from components.offer_builder.internal.entities.factories.turing_product_change import ( # noqa: ALN043

ALN039 occurs 1 times

File:line Content
components/insurance_plan_catalog/public/builder_translation.py:17 ⧉ from components.offer_builder.internal.entities.builder_product import ( # noqa: ALN043, ALN039