one way to not increase cyclomatic complexity here would be to do

```python
if not autoset_owner_id:
    ...
else if form.get_app().case_sharing:
    ...
else:
    ...
```