Skip to content

IngestionPipeline.run cognitive complexity 18 (S3776) — flatten without a new call level #603

Open

Description

@zaebee

IngestionPipeline.run (src/cgis/pipeline/__init__.py) has Sonar cognitive complexity 18 (python:S3776, limit 15). Pre-existing: unchanged since before #602, which only moved the file (Sonar then saw it as new code). Quality gate passes.

Most of the weight is the walk loop (with Progress → for root, dirs, files → for file → if not extractor / try … except ValueError).

Constraint (memory of #458): extracting a helper out of run() that adds a call level once took pipeline self-drift 0.09 → 0.29 (orchestrator, tolerance 0.25) and was reverted. Reduce complexity by flattening (guard clauses, moving the relative-path check into _process_file), and measure pipeline drift before/after — currently 0.106 / unresolved 0.398 (lock 0.25 / 0.43).

Acceptance: S3776 clean on run, pipeline drift within lock, identity snapshot unchanged.

Activity

  1. added this to the Perf & internals milestone on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    could-haveNice for AI agents and UXenhancementNew feature or request

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions