← Back to Build Report

Complexity Analysis

Commit: 2c5b12de1e97947a2ba245ea27314a3b1fde00b0

79
Complexity Warnings

Complex Functions

Location Rule Message
src/api/admin-disputes.js:111 complexity Async function 'handleAdminUpdateDispute' has a complexity of 18. Maximum allowed is 10.
src/api/admin-disputes.js:111 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 20 to the 15 allowed.
src/api/admin-disputes.test.js:10 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 24 to the 15 allowed.
src/api/admin.js:370 complexity Async function 'handleExportData' has a complexity of 12. Maximum allowed is 10.
src/api/auth.js:100 complexity Async function 'handleLogout' has a complexity of 22. Maximum allowed is 10.
src/api/auth.js:100 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 30 to the 15 allowed.
src/api/auth.js:258 complexity Async function 'handleCreateApiKey' has a complexity of 18. Maximum allowed is 10.
src/api/auth.js:258 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 27 to the 15 allowed.
src/api/auth.js:553 complexity Async function 'handleRevealApiKey' has a complexity of 14. Maximum allowed is 10.
src/api/auth.js:553 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.
src/api/auth.js:695 complexity Async function 'handleUpdateApiKey' has a complexity of 14. Maximum allowed is 10.
src/api/auth.js:695 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.
src/api/auth.js:828 complexity Async function 'handleDeleteAccount' has a complexity of 14. Maximum allowed is 10.
src/api/auth.js:828 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.
src/api/content-deletion.js:10 complexity Async function 'handleDeleteContent' has a complexity of 22. Maximum allowed is 10.
src/api/content-deletion.js:10 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 22 to the 15 allowed.
src/api/content.js:36 complexity Async function 'handleUploadContent' has a complexity of 50. Maximum allowed is 10.
src/api/content.js:36 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 65 to the 15 allowed.
src/api/content.js:527 complexity Async function 'handleExtendContent' has a complexity of 17. Maximum allowed is 10.
src/api/content.js:527 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 18 to the 15 allowed.
src/api/content.js:751 complexity Async function 'handleDownloadContent' has a complexity of 37. Maximum allowed is 10.
src/api/content.js:751 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 56 to the 15 allowed.
src/api/disputes.js:12 complexity Async function 'handleCreateDispute' has a complexity of 13. Maximum allowed is 10.
src/api/oauth.js:112 complexity Async function 'upsertGrant' has a complexity of 11. Maximum allowed is 10.
src/api/oauth.js:221 complexity Async function 'handleOAuthAuthorize' has a complexity of 13. Maximum allowed is 10.
src/api/oauth.js:639 complexity Async function 'handleOAuthToken' has a complexity of 13. Maximum allowed is 10.
src/api/oauth.js:639 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 18 to the 15 allowed.
src/api/payments.js:271 complexity Async function 'handleCheckoutSessionCompleted' has a complexity of 14. Maximum allowed is 10.
src/api/payments.js:271 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 24 to the 15 allowed.
src/api/rate-limit.js:17 complexity Async function 'handlePurchaseRateLimit' has a complexity of 18. Maximum allowed is 10.
src/api/rate-limit.js:17 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 19 to the 15 allowed.
src/api/suppliers.js:23 complexity Async function 'handleCreateSupplier' has a complexity of 12. Maximum allowed is 10.
src/api/user.js:14 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 19 to the 15 allowed.
src/auth/middleware.js:247 complexity Async function 'validateOAuthAccessToken' has a complexity of 15. Maximum allowed is 10.
src/auth/middleware.js:366 complexity Async function 'authenticate' has a complexity of 19. Maximum allowed is 10.
src/auth/middleware.js:366 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 42 to the 15 allowed.
src/auth/middleware.test.js:596 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 25 to the 15 allowed.
src/auth/middleware.test.js:597 complexity Async method 'fetch' has a complexity of 12. Maximum allowed is 10.
src/durable-objects/content-metadata.js:16 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 33 to the 15 allowed.
src/durable-objects/content-metadata.js:16 complexity Async method 'fetch' has a complexity of 34. Maximum allowed is 10.
src/durable-objects/deletion-record.js:16 complexity Async method 'fetch' has a complexity of 12. Maximum allowed is 10.
src/durable-objects/dispute-record.js:19 complexity Async method 'fetch' has a complexity of 12. Maximum allowed is 10.
src/durable-objects/dispute-record.js:62 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 32 to the 15 allowed.
src/durable-objects/dispute-record.js:62 complexity Async method 'createDispute' has a complexity of 31. Maximum allowed is 10.
src/durable-objects/dispute-record.js:272 complexity Async method 'updateDispute' has a complexity of 11. Maximum allowed is 10.
src/durable-objects/expiration-index.js:20 complexity Async method 'fetch' has a complexity of 12. Maximum allowed is 10.
src/durable-objects/infrastructure-cost.js:24 complexity Async method 'fetch' has a complexity of 13. Maximum allowed is 10.
src/durable-objects/infrastructure-cost.js:170 complexity Async method 'getCostSummary' has a complexity of 14. Maximum allowed is 10.
src/durable-objects/payment-record.js:13 complexity Async method 'fetch' has a complexity of 12. Maximum allowed is 10.
src/durable-objects/payment-record.js:58 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.
src/durable-objects/payment-record.js:58 complexity Async method 'createTransaction' has a complexity of 17. Maximum allowed is 10.
src/durable-objects/platform-stats.js:96 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 28 to the 15 allowed.
src/durable-objects/platform-stats.js:96 complexity Async method 'getStats' has a complexity of 28. Maximum allowed is 10.
src/durable-objects/platform-stats.js:170 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 21 to the 15 allowed.
src/durable-objects/platform-stats.js:170 complexity Async method 'getFinancialStats' has a complexity of 22. Maximum allowed is 10.
src/durable-objects/supplier-registry.js:16 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 19 to the 15 allowed.
src/durable-objects/supplier-registry.js:16 complexity Async method 'fetch' has a complexity of 20. Maximum allowed is 10.
src/durable-objects/supplier-registry.js:106 complexity Async method 'createOrUpdateSupplier' has a complexity of 13. Maximum allowed is 10.
src/durable-objects/supplier-registry.js:272 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 18 to the 15 allowed.
src/durable-objects/supplier-registry.js:272 complexity Async method 'recordRequest' has a complexity of 15. Maximum allowed is 10.
src/durable-objects/user-profile.js:15 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 57 to the 15 allowed.
src/durable-objects/user-profile.js:15 complexity Async method 'fetch' has a complexity of 61. Maximum allowed is 10.
src/durable-objects/user-profile.js:764 complexity Async method 'updateApiKeyName' has a complexity of 11. Maximum allowed is 10.
src/durable-objects/user-profile.js:1295 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 25 to the 15 allowed.
src/durable-objects/user-profile.js:1295 complexity Async method 'debitBalance' has a complexity of 18. Maximum allowed is 10.
src/index.js:154 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 45 to the 15 allowed.
src/index.js:154 complexity Async method 'fetch' has a complexity of 32. Maximum allowed is 10.
src/index.js:590 complexity Function 'handleApiRoutes' has a complexity of 141. Maximum allowed is 10.
src/index.js:590 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 139 to the 15 allowed.
src/index.js:1009 complexity Async function 'handleHealth' has a complexity of 28. Maximum allowed is 10.
src/index.js:1009 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 35 to the 15 allowed.
src/index.js:1290 complexity Async function 'checkClerk' has a complexity of 15. Maximum allowed is 10.
src/index.js:1290 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 18 to the 15 allowed.
src/integration/content-lifecycle.test.js:17 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 18 to the 15 allowed.
src/utils/supplier-fallback.js:63 complexity Async function 'fetchFromAlternate' has a complexity of 13. Maximum allowed is 10.
src/utils/supplier-fallback.js:160 complexity Async function 'tryAlternateSuppliers' has a complexity of 20. Maximum allowed is 10.
src/utils/supplier-fallback.js:160 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 40 to the 15 allowed.
src/utils/supplier-validation.js:11 complexity Function 'validateSupplierURL' has a complexity of 21. Maximum allowed is 10.
src/utils/supplier-validation.js:11 sonarjs/cognitive-complexity Refactor this function to reduce its Cognitive Complexity from 20 to the 15 allowed.
Download JSON Data