Перейти к основному содержимому
kitlocal.dev

Refactor for readability without changing behavior

Proposes small, behavior-preserving refactorings for a function and lists the tests that must still pass.

Этот ресурс доступен только на английском языке.

Промпты — это текст, который вы копируете в своего помощника. KitLocal их не запускает.

Заполните переменные

Всё, что вы вводите, остаётся в этом браузере. Это не добавляется в URL, не сохраняется и никуда не отправляется.

Предпросмотр

Ещё нужно: Code to refactor, Language

Refactor this {{language}} code for readability WITHOUT changing behavior.
Give a list of small steps, each independently reviewable, with the resulting code for the
final step only. Call out any step that could change behavior (ordering, errors, side effects)
and the test that would reveal it. If the existing tests are missing or weak, say which
characterization tests to write first.

Code:
{{code}}

Existing tests:

Назначение

Improve structure while keeping behavior identical and verifiable.

Когда использовать

  • A function is hard to read and you want safe, reviewable steps.

Что подготовить

  • The code and the tests that cover it, if any.

Ожидаемый результат

Steps with risk notes, then the final code.

Об этом каталоге

Встроенный снимок · опубликовано 15 нояб. 2026 г., 06:05 · Ревизия каталога 5bc079fe355af2214bc0

Показан снимок, встроенный в приложение (источник контента не настроен). В источнике может быть более свежий контент.