USING PYCFORGE

Check Python Code

Check current editor text, review findings, and return to the affected code without running the program.

Start a scan

Open the wrench dropdown after the text menus and choose Check Python Code…, above Run Python. Alt+O opens Tools. Scan checks the selected tab’s current text, including unsaved edits. The source is never executed or imported.

The checker combines Python syntax validation with four dedicated Ting rule packs. It follows supported module and function paths to find names used without values, unreachable statements, invalid uses of known or possible None, mismatched local-call arguments and shared mutable defaults. It follows arguments, aliases and return values through statically resolved helpers. Loop exits, exception handlers, finally and context-manager paths participate in the analysis. Findings distinguish confirmed issues, conditional warnings and review suggestions; messages identify relevant branches or helper locations.

Trace open modules

Enable Use open modules to trace imports to include current editor text from companion tabs in the next scan. Only explicitly open modules participate. Names such as helpers.py or pkg/helpers.py identify imports; ambiguous names, re-exports and unresolved imports remain unknown. Findings stay on the selected tab, with helper locations in their messages. Changes to any supplied module invalidate the retained scan.

Queue, progress, and cancellation

A scan shares the workspace's background-work capacity with conversion and editor analysis. When capacity is occupied, the dialog shows Queued — waiting for background capacity…. No checker process runs while queued. The scan uses the text captured when Scan was pressed; edits made while queued or running mark its findings stale.

Queue time is shown separately from execution time. Once admitted, the stage label and percentage bar show analysis progress. Explicit editor and conversion requests have priority over queued scans; scans have priority over passive background observers. This admission limit counts participating operations; it is not a whole-application CPU or memory quota.

Cancel clears all panels and shows Scan was halted. Closing a queued or running scan also cancels it. Cancellation returns control immediately while the child process is stopped in the background. Its capacity slot is released only after the process exits; the Scan button becomes available again after cleanup. Normal workspace shutdown also finishes this cleanup without blocking the interface. Completed results remain available while the workspace is open. There is no HTML export or automatic source editing.

Canceling a queued scan removes it from the queue without launching a process. An execution timeout or invalid worker response also stops the scan and shows a reason. Re-scan a smaller module if a limit is reached.

Review findings and recent results

Click a panel to close the dialog and highlight its code in the original tab. Reopening retains panels and scroll position. Right-click an issue panel to remove it, or re-scan to refresh the results. Removing a panel only dismisses it; a re-scan may find it again. Editing, renaming or closing a scanned tab immediately disables its retained panels in both the full dialog and the recent-scan dropdown. Stale locations are labeled as scanned lines. Changes to included companion modules do the same. Undo does not revive old results; re-scan to obtain fresh findings. A scan that finishes after its source was edited also stays stale. Re-scan always uses the currently selected tab.

The Tools control has two separate click areas. The wrench opens the usual Tools menu; the arrow opens a compact view of the latest Python scan in this workspace session. The compact view uses the same clickable issue panels and dismissed findings as the full dialog. Click a panel to navigate, right-click to remove it, or choose Open full scan. No scan, a queued or running scan, a clean completed scan, and all findings dismissed each have distinct feedback. Changed or closed source blocks outdated navigation. Escape or clicking outside closes the dropdown.

Coverage and limits

Hover over the scan-status text for coverage notes. Limits are 16 supplied modules, 1 MiB each and 2 MiB total, 50,000 syntax nodes per module, 256 functions total, 200 displayed findings and 60 seconds of execution after admission. Queue time does not count toward that deadline. Calls are bounded to 10 levels and 512 contexts; flow work has a separate operation budget. Small known loops are followed directly, with conservative merging for other loops. Exceptions from unknown operations and suppression by custom context managers introduce uncertainty.

Dynamic runtime types, class-body execution, comprehensions/lambdas, async/generator bodies, match, except*, assignment-expression bodies and global/nonlocal mutation are outside full flow analysis. Recursive and expanded calls can remain unresolved. A clean scan means no issues found by the completed checks, not proof of correctness. This feature checks Python code quality only; it does not assess conversion compatibility. Consult the conversion documentation for supported conversion behavior.

For conversion compatibility, read Supported conversions. For running a saved script, see Run Python.