securefederatedai/openfl

Reduce cyclomatic complexity in experimental APIs

Closed this issue · 0 comments

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.