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 ⧉", 15
ALN043: You can only import things from a Component public module, see: https://www.notion.so/alaninsurance/Modular-monolith-a9d84f1318d34115bbd08b3648e5a587 ⧉", 50
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 ⧉", 10
ALN021: Foreign keys must use models, not string. See this Notion page : https://www.notion.so/alaninsurance/Imports-5495c8713847434986ef03ad09158bf1 ⧉ 2
ALN071: SQLAlchemy v2 migration, in models all attributes (or functions with @declared_attr) must return a Mapped[...] type. If it's a class variable type it with ClassVar[...] 1
ALN077: Check for usage of backref in SQLAlchemy relationships and suggest using back_populates instead. 2
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. 105

Listing of files of the most critical ALN**

ALN069 occurs 15 times

File:line Content
components/eyewear/public/blueprints/admin_blueprint.py:7 ⧉ from components.fr.internal.models.alan_employee import ( # noqa: ALN039,ALN069
components/eyewear/internal/business_logic/admin_business_logic/frame_order_files.py:21 ⧉ from components.fr.internal.models.insurance_document import ( # noqa: ALN069
components/eyewear/internal/business_logic/admin_business_logic/order_comment.py:9 ⧉ from components.fr.internal.models.alan_employee import AlanEmployee # noqa: ALN069
components/eyewear/internal/business_logic/user_business_logic/frame.py:117 ⧉ from components.fr.internal.eyewear.models.eyewear_eligible_user import ( # noqa: ALN069
components/eyewear/internal/business_logic/user_business_logic/quote.py:23 ⧉ from components.fr.internal.models.insurance_profile import ( # noqa: ALN043, ALN069
components/eyewear/internal/business_logic/user_business_logic/tests/test_frame_order.py:34 ⧉ from components.gamification.internal.models.tests.factories import ( # noqa: ALN039,ALN069
components/eyewear/internal/helpers/apps.py:8 ⧉ from components.fr.internal.models.insurance_document import ( # noqa: ALN069
components/eyewear/internal/helpers/apps.py:26 ⧉ from components.fr.internal.models.user import ( # noqa: ALN069
components/eyewear/internal/helpers/apps.py:51 ⧉ from components.fr.internal.models.enrollment import ( # noqa: ALN069
components/eyewear/internal/helpers/apps.py:54 ⧉ from components.fr.internal.models.user import ( # noqa: ALN069
components/eyewear/internal/helpers/apps.py:82 ⧉ from components.fr.internal.models.user import ( # noqa: ALN069
components/eyewear/internal/helpers/apps.py:120 ⧉ from components.fr.internal.models.insurance_profile import ( # noqa: ALN069
components/eyewear/internal/helpers/apps.py:153 ⧉ from components.fr.internal.models.user import User # noqa: ALN069
components/eyewear/internal/helpers/apps.py:165 ⧉ from components.fr.internal.models.insurance_profile import ( # noqa: ALN069
components/eyewear/internal/models/eyewear_order_comment.py:14 ⧉ from components.fr.internal.models.alan_employee import ( # noqa: ALN069

ALN043 occurs 50 times

File:line Content
components/eyewear/public/blueprints/admin_blueprint.py:10 ⧉ from components.fr.internal.shareable_features.permissions import ( # noqa: ALN039,ALN043
components/eyewear/public/blueprints/admin_blueprint.py:72 ⧉ from components.fr.internal.shareable_features.query import ( # noqa: ALN039,ALN043
components/eyewear/public/blueprints/admin_blueprint.py:90 ⧉ from components.fr.internal.shareable_features.query import ( # noqa: ALN039,ALN043
components/eyewear/public/blueprints/admin_blueprint.py:197 ⧉ from components.fr.internal.shareable_features.query import ( # noqa: ALN039,ALN043
components/eyewear/public/blueprints/admin_blueprint.py:404 ⧉ from components.fr.internal.shareable_features.query import ( # noqa: ALN039,ALN043
components/eyewear/public/blueprints/admin_blueprint.py:426 ⧉ from components.fr.internal.shareable_features.query import ( # noqa: ALN039,ALN043
components/eyewear/public/blueprints/admin_blueprint.py:474 ⧉ from components.fr.internal.shareable_features.query import ( # noqa: ALN039,ALN043
components/eyewear/public/blueprints/admin_blueprint.py:592 ⧉ from components.fr.internal.shareable_features.query import ( # noqa: ALN039,ALN043
components/eyewear/internal/business_logic/admin_business_logic/optician.py:3 ⧉ from components.fr.internal.shareable_features.permissions import ( # noqa: ALN043
components/eyewear/internal/business_logic/admin_business_logic/frame_order_files.py:24 ⧉ from components.fr.internal.queuing.config import MAIN_QUEUE # noqa: ALN043
components/eyewear/internal/business_logic/admin_business_logic/frame_order_files.py:25 ⧉ from components.fr.internal.shareable_features.permissions import ( # noqa: ALN043
components/eyewear/internal/business_logic/admin_business_logic/frame.py:27 ⧉ from components.fr.internal.shareable_features.permissions import ( # noqa: ALN043
components/eyewear/internal/business_logic/admin_business_logic/frame.py:30 ⧉ from components.fr.internal.shareable_features.query import ( # noqa: ALN043
components/eyewear/internal/business_logic/admin_business_logic/contact_lens_order.py:39 ⧉ from components.fr.internal.shareable_features.permissions import ( # noqa: ALN043
components/eyewear/internal/business_logic/admin_business_logic/contact_lens_order.py:42 ⧉ from components.fr.internal.shareable_features.query import QueryPayload # noqa: ALN043
components/eyewear/internal/business_logic/admin_business_logic/contact_lens_order.py:73 ⧉ from components.fr.internal.shareable_features.query import ( # noqa: ALN043
components/eyewear/internal/business_logic/admin_business_logic/contact_lens_order_rating.py:11 ⧉ from components.fr.internal.business_logic.push_notification_logic import ( # type: ignore[attr-defined] # noqa: ALN043
components/eyewear/internal/business_logic/admin_business_logic/contact_lens_order_rating.py:14 ⧉ from components.fr.internal.business_logic.push_notification_token import ( # noqa: ALN043
components/eyewear/internal/business_logic/admin_business_logic/contact_lens_order_rating.py:17 ⧉ from components.fr.internal.push_notifications.push_notification_sender import ( # noqa: ALN043
components/eyewear/internal/business_logic/admin_business_logic/frame_stock_refill.py:19 ⧉ from components.fr.internal.shareable_features.permissions import ( # noqa: ALN043
components/eyewear/internal/business_logic/admin_business_logic/frame_order.py:28 ⧉ from components.fr.internal.queuing.config import MAIN_QUEUE # noqa: ALN043
components/eyewear/internal/business_logic/admin_business_logic/frame_order.py:29 ⧉ from components.fr.internal.shareable_features.permissions import ( # noqa: ALN043
components/eyewear/internal/business_logic/admin_business_logic/frame_order.py:32 ⧉ from components.fr.internal.shareable_features.query import QueryPayload # noqa: ALN043
components/eyewear/internal/business_logic/admin_business_logic/frame_order.py:84 ⧉ from components.fr.internal.shareable_features.query import ( # noqa: ALN043
components/eyewear/internal/business_logic/admin_business_logic/contact_lens_product.py:37 ⧉ from components.fr.internal.shareable_features.permissions import ( # noqa: ALN043
components/eyewear/internal/business_logic/admin_business_logic/contact_lens_product.py:40 ⧉ from components.fr.internal.shareable_features.query import ( # noqa: ALN043
components/eyewear/internal/business_logic/admin_business_logic/frame_order_rating.py:11 ⧉ from components.fr.internal.business_logic.push_notification_logic import ( # type: ignore[attr-defined] # noqa: ALN043
components/eyewear/internal/business_logic/admin_business_logic/frame_order_rating.py:14 ⧉ from components.fr.internal.business_logic.push_notification_token import ( # noqa: ALN043
components/eyewear/internal/business_logic/admin_business_logic/frame_order_rating.py:17 ⧉ from components.fr.internal.push_notifications.push_notification_sender import ( # noqa: ALN043
components/eyewear/internal/business_logic/admin_business_logic/testimonial.py:19 ⧉ from components.fr.internal.shareable_features.permissions import ( # noqa: ALN043
components/eyewear/internal/business_logic/admin_business_logic/testimonial.py:22 ⧉ from components.fr.internal.shareable_features.query import ( # noqa: ALN043
components/eyewear/internal/business_logic/admin_business_logic/contact_lens_order_package.py:12 ⧉ from components.eyewear.internal.helpers.serializers import ( # noqa: ALN043
components/eyewear/internal/business_logic/user_business_logic/contact_lens_payment.py:17 ⧉ from components.fr.internal.errors.error_code import ( # noqa: ALN043
components/eyewear/internal/business_logic/user_business_logic/contact_lens_order_reviewer.py:17 ⧉ from components.fr.internal.eyewear.business_logic.eyewear_prescription_checker import ( # noqa: ALN043
components/eyewear/internal/business_logic/user_business_logic/contact_lens_order_reviewer.py:20 ⧉ from components.shop.internal.business_logic.entities.prescription_entities import ( # noqa: ALN043
components/eyewear/internal/business_logic/user_business_logic/contact_lens_order_reviewer.py:23 ⧉ from components.shop.internal.business_logic.helpers.prescription_helpers import ( # noqa: ALN043
components/eyewear/internal/business_logic/user_business_logic/contact_lens_order_reviewer.py:28 ⧉ from components.shop.public.enums import ( # noqa: ALN043
components/eyewear/internal/business_logic/user_business_logic/contact_lens_order_reviewer.py:45 ⧉ from components.fr.internal.business_logic.feature import ( # noqa: ALN043
components/eyewear/internal/business_logic/user_business_logic/contact_lens_order.py:41 ⧉ from components.fr.internal.errors.error_code import ErrorCode # noqa: ALN043
components/eyewear/internal/business_logic/user_business_logic/frame_order.py:26 ⧉ from components.fr.internal.errors.error_code import ErrorCode # noqa: ALN043
components/eyewear/internal/business_logic/user_business_logic/frame_order.py:162 ⧉ from components.fr.internal.eyewear.business_logic.eligibility import ( # noqa: ALN043
components/eyewear/internal/business_logic/user_business_logic/quote.py:20 ⧉ from components.fr.internal.eyewear.business_logic.eyewear_prescription_checker import ( # noqa: ALN043
components/eyewear/internal/business_logic/user_business_logic/quote.py:23 ⧉ from components.fr.internal.models.insurance_profile import ( # noqa: ALN043, ALN069
components/eyewear/internal/business_logic/user_business_logic/tests/test_frame.py:18 ⧉ from components.fr.internal.tests.factories.eyewear_eligible_user import ( # noqa: ALN043
components/eyewear/internal/business_logic/user_business_logic/tests/test_frame.py:21 ⧉ from components.fr.internal.tests.factories.user import ( # noqa: ALN043
components/eyewear/internal/helpers/auth.py:9 ⧉ from components.fr.internal.shareable_features.auth import ( # noqa: ALN043
components/eyewear/internal/helpers/mails.py:18 ⧉ from components.fr.internal.business_logic.feature import ( # noqa: ALN043
components/eyewear/internal/helpers/mails.py:21 ⧉ from components.fr.internal.mail.async_mailer import async_mailer # noqa: ALN043
components/eyewear/internal/helpers/mails.py:22 ⧉ from components.fr.internal.mail.mailer import MailerParams # noqa: ALN043
components/eyewear/internal/helpers/mails.py:23 ⧉ from components.fr.internal.mail.personalization import Personalization # noqa: ALN043

ALN039 occurs 10 times

File:line Content
components/eyewear/public/blueprints/admin_blueprint.py:7 ⧉ from components.fr.internal.models.alan_employee import ( # noqa: ALN039,ALN069
components/eyewear/public/blueprints/admin_blueprint.py:10 ⧉ from components.fr.internal.shareable_features.permissions import ( # noqa: ALN039,ALN043
components/eyewear/public/blueprints/admin_blueprint.py:72 ⧉ from components.fr.internal.shareable_features.query import ( # noqa: ALN039,ALN043
components/eyewear/public/blueprints/admin_blueprint.py:90 ⧉ from components.fr.internal.shareable_features.query import ( # noqa: ALN039,ALN043
components/eyewear/public/blueprints/admin_blueprint.py:197 ⧉ from components.fr.internal.shareable_features.query import ( # noqa: ALN039,ALN043
components/eyewear/public/blueprints/admin_blueprint.py:404 ⧉ from components.fr.internal.shareable_features.query import ( # noqa: ALN039,ALN043
components/eyewear/public/blueprints/admin_blueprint.py:426 ⧉ from components.fr.internal.shareable_features.query import ( # noqa: ALN039,ALN043
components/eyewear/public/blueprints/admin_blueprint.py:474 ⧉ from components.fr.internal.shareable_features.query import ( # noqa: ALN039,ALN043
components/eyewear/public/blueprints/admin_blueprint.py:592 ⧉ from components.fr.internal.shareable_features.query import ( # noqa: ALN039,ALN043
components/eyewear/internal/business_logic/user_business_logic/tests/test_frame_order.py:34 ⧉ from components.gamification.internal.models.tests.factories import ( # noqa: ALN039,ALN069