Flask patterns -- application factory, blueprints, error handlers, extensions, request lifecycle, configuration, logging, CLI commands
98
98%
Does it follow best practices?
Impact
98%
1.28xAverage score across 5 eval scenarios
Passed
No known issues
create_app factory
100%
100%
Blueprints in separate files
100%
100%
Extensions init_app pattern
100%
100%
Custom exception hierarchy
50%
100%
Consistent error envelope
20%
100%
Generic exception handler logs errors
87%
100%
DB teardown with teardown_appcontext
100%
100%
DB connection via flask.g
100%
100%
Config supports testing
62%
100%
Error handlers registered in factory
100%
100%
Test fixtures
100%
100%
create_app factory
100%
100%
Blueprints for routes
100%
100%
before_request sets request ID on g
100%
100%
after_request returns response with request ID
100%
100%
Custom exception hierarchy
50%
100%
Consistent error envelope
25%
100%
Extensions init_app pattern
62%
37%
Error handlers in factory
100%
100%
Generic exception handler logs error
12%
100%
Config from environment
50%
100%
Per-request state on g not globals
91%
100%
create_app factory
100%
100%
Blueprints in separate files
100%
100%
Blueprints registered in factory
75%
100%
Custom exception hierarchy
50%
100%
Consistent error envelope
25%
100%
CLI command registered in factory
80%
100%
Extensions init_app pattern
100%
100%
Error handlers registered centrally
100%
100%
Generic exception handler
12%
100%
Config supports testing
100%
100%
Imports inside factory
12%
100%
create_app factory
100%
100%
Config classes
100%
100%
Blueprints in separate files
100%
100%
Blueprints registered in factory
75%
100%
Custom exception hierarchy
50%
100%
Consistent error envelope
70%
100%
Extensions init_app pattern
25%
62%
Request logging with before/after hooks
100%
100%
Generic exception handler
25%
100%
Error handlers registered centrally
100%
100%
Test fixtures use factory with testing config
100%
100%
create_app factory
100%
100%
Blueprints for routes
100%
100%
Blueprints registered in factory
75%
100%
Custom exception classes
60%
100%
Consistent error envelope
70%
100%
register_error_handlers called in factory
100%
100%
Generic exception handler with logging
0%
100%
Extensions in extensions.py with init_app
100%
100%
Config from environment
25%
100%
Test fixtures use factory
100%
100%
Routes raise exceptions not return errors
100%
100%