The project has gotten complex, again
Metadata
Current evaluation
Merged ubuntu-core/snapcraft#323 refactored storeapi and enforced the McCabe complexity threshold, resolving #1541011 via merge commit 920c763f2.
Resolution: closed resolved
Reason: PR #323 implemented the complexity fixes in commit 60489a1a4 and merged through 920c763f2. It reduced storeapi complexity and made excessive complexity fail linting.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Here's the mccabe analysis of the project:
The project has gotten complex.
Here's the list of units exceeding 10:
- snapcraft/storeapi/common.py:
77:1: 'retry' 10
- snapcraft/storeapi/_upload.py:
187:1: 'upload_app' 11
This time when we fix the complex functions, we have to make sure to turn the warning into an error so it doesn't happen again.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged ubuntu-core/snapcraft#323 refactored storeapi and enforced the McCabe complexity threshold, resolving #1541011 via merge commit 920c763f2. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed by merged PR canonical/snapcraft#323: commit 60489a1a4 reduced storeapi McCabe complexity and enforced the complexity limit. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged canonical/snapcraft#323 via 920c763f2, landing 60489a1a4 to reduce storeapi complexity and address the retry and upload_app regressions. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. The issue flagged high McCabe complexity in snapcraft/storeapi functions and suggested enforcing complexity limits as errors to prevent recurrence. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without action. The report flagged high cyclomatic complexity in two functions and recommended refactoring with CI enforcement. No fixes or follow-up comments were recorded. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
ubuntu-core/snapcraft#323
(confidence 100%)
Merged PR titled "storeapi: reduce the mccabe complexity"; its implementation and merge commits directly resolve this item.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #323 storeapi: reduce the mccabe complexity | snapcraft | merged | Merged #323 via 920c763f2 (implementation 60489a1a4), reducing storeapi McCabe complexity and closing Launchpad bug #1541011. | |
| #519 Improve the config handling. | snapcraft | merged | Config handling was refactored and merged in canonical/snapcraft#519 as commit 17bff69c6 after prerequisite #518; moving config into storeapi remained a possible follow-up. | |
| #806 Remove snapcraft.storeapi.common | snapcraft | merged | PR #806 merged (commit c810dedd) by cjwatson, deleting the unused snapcraft/storeapi/common.py (-192 lines, 5 files) after all callers moved to StoreClient, and dropping the requests-oauthlib dependency. |