Skip to content

Find longest functions and split them #5917

Open
@JukkaL

Description

@JukkaL

The mypy codebase has quite a few long functions, which is a problem since long functions are often hard to understand and modify. Once you can't see the whole function without scrolling, it's probably too long.

I think that we should refactor at least some of the longest functions into smaller ones. One way would be to systematically find all the longest functions and split them if they are hard to understand.

Not sure what is a good threshold. My editor can show 97 rows at a time on the display I typically use. I think that 97 rows is already too much most of the time. 75 rows per function might be a reasonable threshold above which we should consider taking action in code reviews. Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions