You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Unsafe DB connections and missing returns in cobol_refractor_controller.py #292
Description
In cobol_refractor_controller.py, the IRStateManager contains paths where a database connection (Connection | None) is used without a None-check before calling .cursor() or .commit(). Additionally, get_dead_paras and get_orphaned_vars lack fallback return statements if the manager ends up in an unhandled mode.
Impact
If the database connection fails or drops, the missing None-checks will cause a hard crash. The missing fallback returns violate type safety and risk returning None instead of the expected set, cascading into downstream errors.
Proposed Fix
Add explicit self.conn is not None checks before executing SQLite operations.
Add return set() as the default fallback for getter methods.
Add regression tests to simulate dropped connections and invalid modes.
Activity