Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce cyclomatic complexity in experimental APIs #1177

Open
MasterSkepticista opened this issue Nov 28, 2024 · 0 comments
Open

Reduce cyclomatic complexity in experimental APIs #1177

MasterSkepticista opened this issue Nov 28, 2024 · 0 comments
Assignees

Comments

@MasterSkepticista
Copy link
Collaborator

MasterSkepticista commented Nov 28, 2024

The functions below are too long and hamper readability.

def __extract_class_initializing_args(self, class_name):

def filter_attributes(ctx, f, **kwargs):

def save_artifacts(self, artifacts_iter, force_v4=False, len_hint=0):

Suggestions:

  • Aim for a function size that fits within screen height (note that reducing comments or blank lines won't change the way formatter views complexity).
  • Break down large functions to smaller defs. These helper defs can be part of the same module.
  • Try reducing conditional branching

These changes are required to merge #1176.

@MasterSkepticista MasterSkepticista changed the title Simplify methods in experimental APIs Reduce cyclomatic complexity in experimental APIs Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants