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 ⧉", | 27 |
ALN043: You can only import things from a Component public module, see: https://www.notion.so/alaninsurance/Modular-monolith-a9d84f1318d34115bbd08b3648e5a587 ⧉", |
35 |
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 |
| 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. | 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 27 times¶
| File:line | Content |
|---|---|
| components/offer_catalog/external/offer.py:20 ⧉ | from components.fr.internal.offer.health.models.plan import Plan # noqa: ALN069 |
| components/offer_catalog/external/prevoyance_offer_version.py:10 ⧉ | from components.fr.internal.models.ccn import ( # noqa: ALN069 |
| components/offer_catalog/external/prevoyance_offer_version.py:14 ⧉ | from components.fr.internal.models.contract_population import ( # noqa: ALN069 |
| components/offer_catalog/external/prevoyance_offer_version.py:17 ⧉ | from components.fr.internal.models.employment import ( # noqa: ALN069 |
| components/offer_catalog/external/prevoyance_offer_version.py:20 ⧉ | from components.fr.internal.models.employment_detail import ( # noqa: ALN069 |
| components/offer_catalog/external/prevoyance_offer_version.py:23 ⧉ | from components.fr.internal.models.enums.professional_category import ( # noqa: ALN069 |
| components/offer_catalog/external/prevoyance_offer_version.py:26 ⧉ | from components.fr.internal.models.prevoyance_contract import ( # noqa: ALN069 |
| components/offer_catalog/external/prevoyance_offer_version.py:29 ⧉ | from components.fr.internal.models.signed_document import ( # noqa: ALN069 |
| components/offer_catalog/external/prevoyance_offer_version.py:36 ⧉ | from components.fr.internal.offer.prevoyance.models.prevoyance_plan import ( # noqa: ALN069 |
| components/offer_catalog/external/related_health_offers.py:6 ⧉ | from components.fr.internal.models.account import ( # noqa: ALN069 |
| components/offer_catalog/external/related_health_offers.py:9 ⧉ | from components.fr.internal.offer.health.models.plan import Plan # noqa: ALN069 |
| components/offer_catalog/external/related_health_offers.py:10 ⧉ | from components.offer_builder.internal.models.builder_product_version import ( # noqa: ALN069 |
| components/offer_catalog/external/health_offer_version.py:9 ⧉ | from components.fr.internal.models.contract import ( # noqa: ALN069 |
| components/offer_catalog/external/health_offer_version.py:12 ⧉ | from components.fr.internal.models.enums.professional_category import ( # noqa: ALN069 |
| components/offer_catalog/external/health_offer_version.py:15 ⧉ | from components.fr.internal.models.health_contract_version import ( # noqa: ALN069 |
| components/offer_catalog/external/health_offer_version.py:18 ⧉ | from components.fr.internal.models.policy import ( # noqa: ALN069 |
| components/offer_catalog/external/health_offer_version.py:21 ⧉ | from components.fr.internal.models.signed_document import ( # noqa: ALN069 |
| components/offer_catalog/external/health_offer_version.py:28 ⧉ | from components.fr.internal.offer.health.models.health_coverage_module import ( # noqa: ALN069 |
| components/offer_catalog/external/health_offer_version.py:31 ⧉ | from components.fr.internal.offer.health.models.plan import Plan # noqa: ALN069 |
| components/offer_catalog/external/health_offer_version.py:48 ⧉ | from components.offer_builder.internal.models.builder_product import ( # noqa: ALN069 |
| components/offer_catalog/external/health_offer_version.py:51 ⧉ | from components.offer_builder.internal.models.builder_product_version import ( # noqa: ALN069 |
| components/offer_catalog/external/health_offer_version.py:315 ⧉ | from components.fr.internal.offer.health.models.price_grid import ( # noqa: ALN069 |
| components/offer_catalog/external/ccn.py:15 ⧉ | from components.fr.internal.models.ccn import ( # noqa: ALN069 |
| components/offer_catalog/external/tests/test_coverage.py:8 ⧉ | from components.fr.internal.models.internal_health_coverage_rule import ( # noqa: ALN069 |
| components/offer_catalog/external/tests/test_coverage.py:11 ⧉ | from components.fr.internal.offer.health.models.plan import ( # noqa: ALN069 |
| components/offer_catalog/public/entities/for_display.py:8 ⧉ | from components.fr.internal.models.enums.professional_category import ( # noqa: ALN039,ALN069 |
| components/offer_catalog/internal/views/show_offer_version_overview.py:5 ⧉ | from components.fr.internal.models.enums.professional_category import ( # noqa: ALN069 |
ALN043 occurs 35 times¶
| File:line | Content |
|---|---|
| components/offer_catalog/conftest.py:10 ⧉ | from components.contracting.subcomponents.bugsquash.protected.blueprint import ( # noqa: ALN043 |
| components/offer_catalog/conftest.py:38 ⧉ | from components.contracting.subcomponents.cancellation.blueprint import ( # noqa: ALN043 |
| components/offer_catalog/conftest.py:41 ⧉ | from components.contracting.subcomponents.proposal.blueprint import ( # noqa: ALN043 |
| components/offer_catalog/conftest.py:44 ⧉ | from components.contracting.subcomponents.renewal.internal.blueprint import ( # noqa: ALN043 |
| components/offer_catalog/conftest.py:47 ⧉ | from components.fr.internal.admin_tools.blueprint import ( # noqa: ALN043 |
| components/offer_catalog/conftest.py:50 ⧉ | from components.fr.internal.tests.factories.fr_alan_employee_factory import ( # noqa: ALN043 |
| components/offer_catalog/external/subscription.py:4 ⧉ | from components.contracting.external.subscription.api.entities.subscription_type import ( # noqa: ALN043 |
| components/offer_catalog/external/subscription.py:10 ⧉ | from components.contracting.external.subscription.api.entities.subscription import ( # noqa: ALN043 |
| components/offer_catalog/external/subscription.py:18 ⧉ | from components.contracting.external.subscription.fr.health_insurance import ( # noqa: ALN043 |
| components/offer_catalog/external/subscription.py:35 ⧉ | from components.contracting.external.subscription.fr.health_insurance import ( # noqa: ALN043 |
| components/offer_catalog/external/offer.py:9 ⧉ | from components.fr.internal.offer.health.enums.plan import ( # noqa: ALN043 |
| components/offer_catalog/external/eligibility.py:6 ⧉ | from components.fr.internal.offer.health.queries.plans_for_pre_onboarding import ( # noqa: ALN043 |
| components/offer_catalog/external/coverage_compliance.py:3 ⧉ | from components.fr.subcomponents.ccn_compliance.internal.business_logic.ccn_compliance_api import ( # noqa: ALN043 |
| components/offer_catalog/external/prevoyance_offer_version.py:32 ⧉ | from components.fr.internal.offer.health.enums.plan import ( # noqa: ALN043 |
| components/offer_catalog/external/coverage.py:10 ⧉ | from components.fr.internal.offer.health.queries.compare_plans import ( # noqa: ALN043 |
| components/offer_catalog/external/health_offer_version.py:24 ⧉ | from components.fr.internal.offer.health.enums.plan import ( # noqa: ALN043 |
| components/offer_catalog/external/health_offer_version.py:279 ⧉ | from components.contracting.external.price.fr.health_insurance import ( # noqa: ALN043 |
| components/offer_catalog/external/tests/test_coverage.py:4 ⧉ | from components.fr.internal.claim_management.entities.internal_health_coverage import ( # noqa: ALN043 |
| components/offer_catalog/external/tests/test_coverage.py:14 ⧉ | from components.fr.internal.tests.factories.health_coverage import ( # noqa: ALN043 |
| components/offer_catalog/external/tests/test_coverage.py:17 ⧉ | from components.fr.internal.tests.factories.health_coverage_module import ( # noqa: ALN043 |
| components/offer_catalog/external/tests/test_coverage.py:22 ⧉ | from components.fr.internal.tests.factories.internal_health_coverage import ( # noqa: ALN043 |
| components/offer_catalog/external/tests/test_coverage.py:25 ⧉ | from components.fr.internal.tests.factories.plan import ( # noqa: ALN043 |
| components/offer_catalog/external/tests/test_coverage.py:28 ⧉ | from components.fr.internal.tests.factories.price_grid import ( # noqa: ALN043 |
| components/offer_catalog/public/blueprint.py:52 ⧉ | from components.contracting.utils.templating import ( # noqa: ALN039,ALN043 # We want to display the contracting nav bar on the offer catalog pages |
| components/offer_catalog/public/cost.py:4 ⧉ | from components.contracting.external.subscription.api.entities.subscription import ( # noqa: ALN039,ALN043 |
| components/offer_catalog/public/cost.py:7 ⧉ | from components.offer_builder.shared.enums.price_structure_type import ( # noqa: ALN039,ALN043 |
| components/offer_catalog/public/cost.py:26 ⧉ | from components.contracting.external.price.fr.health_insurance import ( # noqa: ALN039,ALN043 |
| components/offer_catalog/public/entities/for_display.py:5 ⧉ | from components.contracting.external.price.fr.health_insurance import ( # noqa: ALN039,ALN043 |
| components/offer_catalog/public/entities/for_display.py:11 ⧉ | from components.fr.internal.offer.health.enums.plan import ( # noqa: ALN039,ALN043 |
| components/offer_catalog/public/entities/for_display.py:17 ⧉ | from components.offer_builder.shared.enums.price_structure_type import ( # noqa: ALN039,ALN043 |
| components/offer_catalog/public/controllers/subscription.py:38 ⧉ | from components.fr.internal.business_logic.search import ( # noqa: ALN039,ALN043 |
| components/offer_catalog/internal/presenters/offer_versions_price_diff.py:4 ⧉ | from components.contracting.external.price.fr.health_insurance import ( # noqa: ALN043 # - todo extract to a shared package |
| components/offer_catalog/internal/views/show_offer_version_compliance.py:22 ⧉ | from components.contracting.external.population import ( # noqa: ALN043 |
| components/offer_catalog/internal/views/tests/test_list_health_offer_versions.py:3 ⧉ | from components.fr.internal.tests.factories.plan import ( # noqa: ALN043 |
| components/offer_catalog/internal/views/tests/test_list_offers.py:3 ⧉ | from components.fr.internal.tests.factories.plan import ( # noqa: ALN043 |
ALN039 occurs 9 times¶
| File:line | Content |
|---|---|
| components/offer_catalog/public/blueprint.py:52 ⧉ | from components.contracting.utils.templating import ( # noqa: ALN039,ALN043 # We want to display the contracting nav bar on the offer catalog pages |
| components/offer_catalog/public/cost.py:4 ⧉ | from components.contracting.external.subscription.api.entities.subscription import ( # noqa: ALN039,ALN043 |
| components/offer_catalog/public/cost.py:7 ⧉ | from components.offer_builder.shared.enums.price_structure_type import ( # noqa: ALN039,ALN043 |
| components/offer_catalog/public/cost.py:26 ⧉ | from components.contracting.external.price.fr.health_insurance import ( # noqa: ALN039,ALN043 |
| components/offer_catalog/public/entities/for_display.py:5 ⧉ | from components.contracting.external.price.fr.health_insurance import ( # noqa: ALN039,ALN043 |
| components/offer_catalog/public/entities/for_display.py:8 ⧉ | from components.fr.internal.models.enums.professional_category import ( # noqa: ALN039,ALN069 |
| components/offer_catalog/public/entities/for_display.py:11 ⧉ | from components.fr.internal.offer.health.enums.plan import ( # noqa: ALN039,ALN043 |
| components/offer_catalog/public/entities/for_display.py:17 ⧉ | from components.offer_builder.shared.enums.price_structure_type import ( # noqa: ALN039,ALN043 |
| components/offer_catalog/public/controllers/subscription.py:38 ⧉ | from components.fr.internal.business_logic.search import ( # noqa: ALN039,ALN043 |