Separate `analyze_assignment` to `analyze_local_assignment` and `analyze_field_assignment` and other refactoring.