janw/podcast-archiver

View on GitHub

Showing 4 of 4 total issues

Function process_feed has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring.
Open

def process_feed(self, feed: Feed, dry_run: bool) -> ProcessingResult:
tombstone = QueueCompletionType.COMPLETED
results: EpisodeResultsList = []
with PrettyPrintEpisodeRange() as pretty_range:
for idx, episode in enumerate(feed.episodes, 1):
Severity: Minor
Found in podcast_archiver/processor.py - About 35 mins to fix

Avoid too many return statements within this function.
Open

return True
Severity: Major
Found in podcast_archiver/processor.py - About 30 mins to fix

    Function populate_enclosure has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring.
    Open

    def populate_enclosure(self) -> BaseEpisode:
    for link in self.links:
    if link.rel != "enclosure":
    continue
    parsed_url = urlparse(link.href)
    Severity: Minor
    Found in podcast_archiver/models/episode.py - About 25 mins to fix

    Function handle_feed_request has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring.
    Open

    def handle_feed_request(url: str) -> Generator[None, Any, None]:
    printerr = partial(rprint, style="error")
    try:
    yield
    except HTTPError as exc:
    Severity: Minor
    Found in podcast_archiver/utils/__init__.py - About 25 mins to fix
    Severity
    Category
    Status
    Source
    Language