#20 Cursor Muse Spark 1.3 (Cursor Agent, Sub-Agents)

Quality

2026-09-13-cursor-muse-spark-1-3 · Cursor Agent v2026.09.10-fd3934a

Coordinator Tool Calls

58

7 unique tools

Sub-agent Tool Calls

2.5K

read / write / shell / MCP

Sub-agents

11

Cursor Agent sub-agent spawns

Equivalent Cost

$44.92

249.2M tokens

Tool Usage per Sub-agent

11 agents
Agent F — Admin Panel + Analytics + Webhooks + Seeders
430
Agent G — Independent Verification (Round 1)
288
Agent D — Commerce Core
271
Agent B — Foundation (Tenancy, Auth, RBAC)
241
Agent H — Bugfix (Round 1)
228
Agent E — Storefront UI + Customer Accounts
219
Agent A — Database + Models
202
Agent C — Catalog + Search
187
Agent I — Final Verification (Round 1)
173
Agent H — Bugfix (Round 2)
159
Agent I — Final Sign-off (Round 2)
115

Code Quality Assessment

PHPMetrics

Code Quality Assessment

PHPMetrics 2.9.1

Classes

295

Lines of Code

12.2K

Avg MI

81.9

Avg Complexity

5.9

Est. Bugs

40.4

avg 0.137/class

Violations

0

0 errors, 0 warnings

Complexity Distribution

Low (CCN <= 5)
229 (77.6%)
Medium (6-10)
24 (8.1%)
High (> 10)
42 (14.2%)

Maintainability Distribution

Excellent (>= 85)
142 (48.1%)
Good (70-84)
30 (10.2%)
Moderate (55-69)
54 (18.3%)
Low (< 55)
69 (23.4%)

Most Complex Classes

ProductService

App\Services

CCN 143

Form

App\Livewire\Admin\Products

CCN 70

OrderService

App\Services

CCN 56

ShippingCalculator

App\Services

CCN 56

DiscountService

App\Services

CCN 53

Least Maintainable

ProductService

Services · CCN 143 · 393 LOC

Form

Products · CCN 70 · 279 LOC

CheckoutController

V1 · CCN 17 · 111 LOC

Show

Products · CCN 30 · 146 LOC

ManagesCartLines

Concerns · CCN 36 · 179 LOC

Most Coupled Classes

Controller

32

Store

29

Order

26

CheckoutService

23

Product

22

Avg Efferent

3.42

Max LCOM

9

Notes

  • PHPMetrics flags 0 rule violations across 295 classes - the largest class count of any build on this page - with an average MI of 81.9. But that average hides a single dramatic outlier: ProductService sits at CCN 143 and MI 24.77, more than double the next-most-complex class (Form, CCN 70) and by far the worst-scoring class in the tree.
  • SonarCloud is comparatively lenient on the same tree: 148 unresolved issues on PR #30 (1 bug, 2 vulnerabilities, 145 code smells - overwhelmingly code smells, unlike builds where vulnerabilities dominate). The quality gate still FAILED, on new-code reliability (B) and new-code security (C); maintainability (A), duplicated lines (2.1% vs a 3% threshold), and security-hotspot review (100%) all passed.
  • The single ProductService god-class is also the top coupling and complexity outlier simultaneously - a pattern narrower than the multi-class complexity clusters seen on other builds, where the worst offenders spread across several services and Livewire components rather than concentrating in one file.
  • 12.2K class-LOC across 295 classes (41.2 LOC/class average) with a 14.7% comment ratio - noticeably better-documented than most prior builds. Controller and Store are the most-coupled classes (32 and 29 dependents), consistent with a multi-tenant, request-routing-heavy architecture.

SonarCloud Analysis

PR #30

Bugs

1

Vulnerabilities

2

Code Smells

145

Duplication

2%

Lines of Code

20,575

Reliability

B

1 bugs

Security

C

2 vulnerabilities

Maintainability

A

1333min debt

Quality Gate Conditions

Reliability on New CodeB> 1
Security on New CodeC> 1
Maintainability on New CodeA> 1
Duplicated Lines on New Code2.1%> 3.0%
Security Hotspots Reviewed100.0%< 100%

Top Issues by Rule (148 unresolved total)

MAJORphp:S1172
39

Unused function parameters should be removed

The single largest category by far (39 of 148 total issues), e.g. an unused `$storeId` parameter in AnalyticsController - a hallmark of Agent F's ADMIN PANEL + ANALYTICS pass generating a large, fast surface area of admin CRUD endpoints.

MAJORphp:S1142
18

Functions should not contain too many return statements

Concentrated in guard-clause-heavy multi-tenancy code, e.g. ResolveStoreContext with 4 returns against the 3-return threshold - consistent with Agent B's FOUNDATION layer branching heavily on store/role resolution.

CRITICALphp:S1192
17

String literals should not be duplicated

Duplicated date-format literals in AnalyticsService (e.g. " 00:00:00" repeated 5 times) instead of centralized constants.

CRITICALphp:S3776
14

Cognitive Complexity of functions should not be too high

ResolveStoreContext again the flagship example: 17 against the 15 allowed, reflecting the same store-resolution branching that drives the S1142 cluster above.

MAJORWeb:S6840
12

DOM elements should use the "autocomplete" attribute correctly

Storefront address-form Blade component is missing or misusing autocomplete tokens on shipping/billing fields.

MAJORWeb:S6819
11

Prefer tag over ARIA role

Admin analytics dashboard uses `role="img"` on a `<div>`-based chart instead of a real `<img>`/`<svg>` element.

MAJORWeb:S9379
7

DOM elements should not use the "autofocus" attribute

Several admin auth pages (e.g. forgot-password) autofocus a field, which SonarCloud flags as an accessibility/usability anti-pattern.

MAJORWeb:S6853
6

Label elements should have a text label and an associated control

Admin Developers settings page has a `<label>` with no associated form control.

MAJORphp:S3358
6

Ternary operators should not be nested

Nested ternaries in AnalyticsService's date/metric formatting logic.