Skip to content

Reduce function complexity (C901 violations) #60

@aquarion

Description

@aquarion

Several functions exceed the max-complexity threshold of 10, triggering C901 flake8 warnings.

Affected functions

File Function Complexity
atproto_posts.py Loop 52 17
destiny2.py authenticate 12
facebook_posts.py some_action 16
gw2.py run_import 12
instagram.py If 31 12
mastodon_toots.py Loop 48 15
steam.py If 35 12
tumblr.py Loop 106 12
wordpress.py Loop 44 15
wow.py Loop 342 12
utils.py niceTimeDelta 13

Suggested approach

  1. Extract helper functions to break up complex logic
  2. Use early returns to reduce nesting
  3. Consider using dispatch tables or strategy patterns where appropriate

Priority

Low - these work correctly, just harder to maintain

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions