Skip to content

Conversation

samglt
Copy link

@samglt samglt commented Aug 29, 2025

Since a previous PR #5838 hasn't been updated in a while, here is a modification to that PR with the visitor pulled out for testing as suggested here.

I changed the visitor itself slightly to get it closer to the described algorithm in #3335. I believe it covers everything relevant to Swift except recursion and sequences of logical operators outside of if/guard statement conditions.

My changes generally lower the complexity levels compared to the above PR, but I don't know if the current warning and error levels of 15 & 20 are too high or low or if they should be spread out.

I also wonder if closures increasing nesting should be optional, since SwiftUI views are naturally full of nested closures. IMO the cognitive cost of nested views is not as big as nested conditionals and loops, but maybe it's not an issue since nested closures only add to the nesting level and don't have a cost by themselves.

@SwiftLintBot
Copy link

1116 Warnings
⚠️ If this is a user-facing change, please include a CHANGELOG entry to credit yourself!
You can find it at CHANGELOG.md.
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/Settings panels/SourcesViewController.swift:223:5: Error: Function should have cognitive complexity 15 or less; currently complexity is 23 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/VideosViewController.swift:336:5: Warning: Function should have cognitive complexity 15 or less; currently complexity is 17 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/VideosViewController.swift:401:5: Warning: Function should have cognitive complexity 15 or less; currently complexity is 20 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/VideosViewController.swift:699:5: Warning: Function should have cognitive complexity 15 or less; currently complexity is 18 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Music/Music.swift:78:11: Error: Function should have cognitive complexity 15 or less; currently complexity is 30 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/AerialVideo.swift:83:5: Warning: Function should have cognitive complexity 15 or less; currently complexity is 17 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Hardware/HardwareDetection.swift:45:5: Warning: Function should have cognitive complexity 15 or less; currently complexity is 18 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Hardware/NightShift.swift:41:5: Error: Function should have cognitive complexity 15 or less; currently complexity is 23 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Hardware/DisplayDetection.swift:279:5: Warning: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Hardware/DisplayDetection.swift:325:5: Warning: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Hardware/DisplayDetection.swift:366:5: Warning: Function should have cognitive complexity 15 or less; currently complexity is 17 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Cache/VideoLoader.swift:94:5: Warning: Function should have cognitive complexity 15 or less; currently complexity is 19 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/ManifestLoader.swift:929:5: Warning: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Cache/PoiStringProvider.swift:165:13: Warning: Function should have cognitive complexity 15 or less; currently complexity is 18 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Cache/Thumbnails.swift:41:5: Warning: Function should have cognitive complexity 15 or less; currently complexity is 19 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Cache/VideoCache.swift:144:5: Error: Function should have cognitive complexity 15 or less; currently complexity is 25 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Extensions/NSImage+trim.swift:28:13: Error: Function should have cognitive complexity 15 or less; currently complexity is 28 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Time/TimeManagement.swift:45:5: Error: Function should have cognitive complexity 15 or less; currently complexity is 34 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Cache/Cache.swift:378:5: Warning: Function should have cognitive complexity 15 or less; currently complexity is 17 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Cache/Cache.swift:609:5: Warning: Function should have cognitive complexity 15 or less; currently complexity is 17 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Cache/Cache.swift:704:5: Error: Function should have cognitive complexity 15 or less; currently complexity is 32 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Sources/Sidebar.swift:58:5: Error: Function should have cognitive complexity 15 or less; currently complexity is 32 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/API/GeoCoding.swift:30:5: Warning: Function should have cognitive complexity 15 or less; currently complexity is 18 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Aerial.swift:374:5: Error: Function should have cognitive complexity 15 or less; currently complexity is 21 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/API/Forecast.swift:161:5: Error: Function should have cognitive complexity 15 or less; currently complexity is 28 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Sources/SourceList.swift:185:5: Warning: Function should have cognitive complexity 15 or less; currently complexity is 19 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Sources/SourceList.swift:253:5: Error: Function should have cognitive complexity 15 or less; currently complexity is 21 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Sources/Source.swift:182:5: Error: Function should have cognitive complexity 15 or less; currently complexity is 27 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Sources/Source.swift:365:5: Error: Function should have cognitive complexity 15 or less; currently complexity is 21 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Sources/Source.swift:437:5: Error: Function should have cognitive complexity 15 or less; currently complexity is 27 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OpenWeather.swift:156:5: Error: Function should have cognitive complexity 15 or less; currently complexity is 48 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OneCall.swift:193:5: Error: Function should have cognitive complexity 15 or less; currently complexity is 30 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Sources/VideoList.swift:148:13: Warning: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Sources/VideoList.swift:425:5: Warning: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/AerialView+Player.swift:14:5: Warning: Function should have cognitive complexity 15 or less; currently complexity is 20 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/PrefPanel/InfoWeatherView.swift:126:15: Error: Function should have cognitive complexity 15 or less; currently complexity is 34 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Controllers/CustomVideoController.swift:491:5: Warning: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/LocationLayer.swift:48:14: Warning: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/PrefPanel/DisplayView.swift:58:14: Error: Function should have cognitive complexity 15 or less; currently complexity is 45 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/WeatherLayer.swift:135:14: Error: Function should have cognitive complexity 15 or less; currently complexity is 23 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Sources/ActionCellView.swift:15:15: Warning: Function should have cognitive complexity 15 or less; currently complexity is 17 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/ForecastLayer.swift:17:5: Error: Function should have cognitive complexity 15 or less; currently complexity is 38 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/ForecastLayer.swift:127:5: Warning: Function should have cognitive complexity 15 or less; currently complexity is 17 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/AerialView.swift:237:5: Error: Function should have cognitive complexity 15 or less; currently complexity is 41 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/AerialView.swift:561:23: Warning: Function should have cognitive complexity 15 or less; currently complexity is 19 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/AerialView.swift:778:5: Error: Function should have cognitive complexity 15 or less; currently complexity is 29 (cognitive_complexity)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/AerialView.swift:911:14: Error: Function should have cognitive complexity 15 or less; currently complexity is 25 (cognitive_complexity)
⚠️ This PR introduced a violation in Alamofire: /Example/Source/DetailViewController.swift:74:15: Warning: Function should have cognitive complexity 15 or less; currently complexity is 17 (cognitive_complexity)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Request.swift:1002:12: Error: Function should have cognitive complexity 15 or less; currently complexity is 30 (cognitive_complexity)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/URLEncodedFormEncoder.swift:585:13: Error: Function should have cognitive complexity 15 or less; currently complexity is 25 (cognitive_complexity)
⚠️ This PR introduced a violation in Alamofire: /Tests/ProtectedTests.swift:168:13: Warning: Function should have cognitive complexity 15 or less; currently complexity is 19 (cognitive_complexity)
⚠️ This PR introduced a violation in Alamofire: /Tests/ProtectedTests.swift:224:13: Warning: Function should have cognitive complexity 15 or less; currently complexity is 19 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/iOS/Delegates/AppState.swift:121:11: Warning: Function should have cognitive complexity 15 or less; currently complexity is 19 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/iOS/Delegates/AppDelegate.swift:122:3: Error: Function should have cognitive complexity 15 or less; currently complexity is 36 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/iOS/Delegates/AppDelegate.swift:390:23: Warning: Function should have cognitive complexity 15 or less; currently complexity is 20 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/iOS/Delegates/SceneDelegate.swift:352:11: Error: Function should have cognitive complexity 15 or less; currently complexity is 26 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/iOS/Delegates/SceneDelegate.swift:495:11: Error: Function should have cognitive complexity 15 or less; currently complexity is 26 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/iOS/Delegates/SceneDelegate.swift:684:11: Warning: Function should have cognitive complexity 15 or less; currently complexity is 19 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/ClientTests/User Scripts/ScriptExecutionTests.swift:238:14: Error: Function should have cognitive complexity 15 or less; currently complexity is 33 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/ClientTests/User Scripts/ScriptExecutionTests.swift:501:14: Error: Function should have cognitive complexity 15 or less; currently complexity is 25 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/BraveWalletTests/AccountsStoreTests.swift:121:3: Error: Function should have cognitive complexity 15 or less; currently complexity is 38 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/BraveWalletTests/PortfolioStoreTests.swift:176:11: Error: Function should have cognitive complexity 15 or less; currently complexity is 34 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/BraveWalletTests/PortfolioStoreTests.swift:1247:3: Error: Function should have cognitive complexity 15 or less; currently complexity is 34 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/BraveWalletTests/PortfolioStoreTests.swift:1645:3: Error: Function should have cognitive complexity 15 or less; currently complexity is 29 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/BraveWalletTests/NFTStoreTests.swift:110:11: Error: Function should have cognitive complexity 15 or less; currently complexity is 35 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/BraveWalletTests/NFTStoreTests.swift:252:3: Warning: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveVPN/Components/Settings/BraveVPNContactFormViewController.swift:64:12: Error: Function should have cognitive complexity 15 or less; currently complexity is 31 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveVPN/Components/Subscription/BraveVPN+ReceiptResponse.swift:52:10: Warning: Function should have cognitive complexity 15 or less; currently complexity is 20 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveVPN/Components/Subscription/BraveVPNInAppPurchaseObserver.swift:70:11: Error: Function should have cognitive complexity 15 or less; currently complexity is 23 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveVPN/BraveVPN.swift:433:10: Warning: Function should have cognitive complexity 15 or less; currently complexity is 18 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveNews/Composer/FeedDataSource+RSS.swift:207:3: Error: Function should have cognitive complexity 15 or less; currently complexity is 21 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveNews/Composer/FeedCardGenerator.swift:166:22: Error: Function should have cognitive complexity 15 or less; currently complexity is 47 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveNews/Customize/SearchResultsView.swift:128:11: Error: Function should have cognitive complexity 15 or less; currently complexity is 32 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveNews/Composer/FeedDataSource.swift:518:11: Error: Function should have cognitive complexity 15 or less; currently complexity is 41 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveNews/Composer/FeedDataSource.swift:679:10: Warning: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveNews/Composer/FeedDataSource.swift:963:11: Warning: Function should have cognitive complexity 15 or less; currently complexity is 17 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/Playlist/PlaylistMimeTypeDetector.swift:45:3: Error: Function should have cognitive complexity 15 or less; currently complexity is 39 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/SpeechRecognition/SpeechRecognizer.swift:102:11: Warning: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/Playlist/PlaylistManager.swift:379:21: Error: Function should have cognitive complexity 15 or less; currently complexity is 25 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/Playlist/PlaylistManager.swift:598:22: Warning: Function should have cognitive complexity 15 or less; currently complexity is 19 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/Playlist/PlaylistManager.swift:796:22: Error: Function should have cognitive complexity 15 or less; currently complexity is 49 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/Playlist/PlaylistDownloadManager.swift:517:3: Error: Function should have cognitive complexity 15 or less; currently complexity is 41 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/Playlist/PlaylistDownloadManager.swift:757:3: Warning: Function should have cognitive complexity 15 or less; currently complexity is 20 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/Playlist/PlaylistDownloadManager.swift:888:3: Error: Function should have cognitive complexity 15 or less; currently complexity is 25 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/Playlist/PlaylistDownloadManager.swift:1075:3: Error: Function should have cognitive complexity 15 or less; currently complexity is 21 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BrowserMenu/CustomizeMenuView.swift:42:11: Warning: Function should have cognitive complexity 15 or less; currently complexity is 18 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/Web/WebKit/SafeJavaScript.swift:12:3: Warning: Function should have cognitive complexity 15 or less; currently complexity is 17 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/Web/WebKit/TabWKNavigationHandler.swift:60:3: Warning: Function should have cognitive complexity 15 or less; currently complexity is 17 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/Web/WebKit/TabWKNavigationHandler.swift:228:3: Error: Function should have cognitive complexity 15 or less; currently complexity is 21 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Settings/NetworkListView.swift:47:16: Error: Function should have cognitive complexity 15 or less; currently complexity is 26 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Settings/CustomNetworkDetailsView.swift:223:3: Warning: Function should have cognitive complexity 15 or less; currently complexity is 18 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Settings/CustomNetworkDetailsView.swift:550:11: Error: Function should have cognitive complexity 15 or less; currently complexity is 22 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Settings/CustomNetworkDetailsView.swift:609:11: Error: Function should have cognitive complexity 15 or less; currently complexity is 22 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/NFT/NFTView.swift:185:24: Error: Function should have cognitive complexity 15 or less; currently complexity is 30 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Transaction Confirmations/EditPriorityFeeView.swift:84:11: Warning: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/SignMessageRequestStore.swift:62:3: Error: Function should have cognitive complexity 15 or less; currently complexity is 29 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/AccountActivityStore.swift:170:3: Error: Function should have cognitive complexity 15 or less; currently complexity is 48 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/NFTDetailStore.swift:106:11: Error: Function should have cognitive complexity 15 or less; currently complexity is 26 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/NetworkStore.swift:114:3: Error: Function should have cognitive complexity 15 or less; currently complexity is 36 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/NetworkStore.swift:406:14: Warning: Function should have cognitive complexity 15 or less; currently complexity is 20 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/NetworkStore.swift:501:10: Warning: Function should have cognitive complexity 15 or less; currently complexity is 19 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/PortfolioStore.swift:150:3: Warning: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/PortfolioStore.swift:431:3: Error: Function should have cognitive complexity 15 or less; currently complexity is 72 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/CryptoStore.swift:249:10: Error: Function should have cognitive complexity 15 or less; currently complexity is 27 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/CryptoStore.swift:905:11: Error: Function should have cognitive complexity 15 or less; currently complexity is 27 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/KeyringStore.swift:724:10: Warning: Function should have cognitive complexity 15 or less; currently complexity is 19 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/SwapTokenStore.swift:249:3: Warning: Function should have cognitive complexity 15 or less; currently complexity is 18 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/SwapTokenStore.swift:399:22: Warning: Function should have cognitive complexity 15 or less; currently complexity is 20 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/SwapTokenStore.swift:650:22: Error: Function should have cognitive complexity 15 or less; currently complexity is 32 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/SwapTokenStore.swift:755:22: Warning: Function should have cognitive complexity 15 or less; currently complexity is 18 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/SwapTokenStore.swift:803:22: Error: Function should have cognitive complexity 15 or less; currently complexity is 30 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/SwapTokenStore.swift:1067:3: Error: Function should have cognitive complexity 15 or less; currently complexity is 70 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/SwapTokenStore.swift:1070:5: Error: Function should have cognitive complexity 15 or less; currently complexity is 30 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/TransactionsActivityStore.swift:140:3: Error: Function should have cognitive complexity 15 or less; currently complexity is 25 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/SelectAccountTokenStore.swift:257:3: Error: Function should have cognitive complexity 15 or less; currently complexity is 47 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/SelectAccountTokenStore.swift:388:11: Error: Function should have cognitive complexity 15 or less; currently complexity is 31 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/AssetDetailStore.swift:207:10: Error: Function should have cognitive complexity 15 or less; currently complexity is 38 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/AssetDetailStore.swift:434:22: Error: Function should have cognitive complexity 15 or less; currently complexity is 29 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/NFTStore.swift:277:3: Error: Function should have cognitive complexity 15 or less; currently complexity is 55 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/TransactionDetailsStore.swift:118:3: Error: Function should have cognitive complexity 15 or less; currently complexity is 64 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/AccountsStore.swift:151:22: Error: Function should have cognitive complexity 15 or less; currently complexity is 69 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/TransactionConfirmationStore.swift:320:3: Error: Function should have cognitive complexity 15 or less; currently complexity is 23 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/TransactionConfirmationStore.swift:443:22: Error: Function should have cognitive complexity 15 or less; currently complexity is 34 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/TransactionConfirmationStore.swift:566:14: Warning: Function should have cognitive complexity 15 or less; currently complexity is 17 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/TransactionConfirmationStore.swift:669:14: Error: Function should have cognitive complexity 15 or less; currently complexity is 137 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/SendTokenStore.swift:347:3: Error: Function should have cognitive complexity 15 or less; currently complexity is 38 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/SendTokenStore.swift:474:22: Error: Function should have cognitive complexity 15 or less; currently complexity is 32 (cognitive_complexity)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/BraveWallet/Crypto/Stores/SendTokenStore.swift:611:22: Warning: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
⚠️ Danger found 1116 violations with this PR. Due to GitHub's max issue comment size, the number shown has been truncated to 129.
18 Messages
📖 Building this branch resulted in a binary size of 26848.1 KiB vs 26798.35 KiB when built on main (0% larger).
📖 Linting Aerial with this PR took 0.82 s vs 0.82 s on main (0% slower).
📖 Linting Alamofire with this PR took 1.02 s vs 1.02 s on main (0% slower).
📖 Linting Brave with this PR took 6.93 s vs 6.92 s on main (0% slower).
📖 Linting DuckDuckGo with this PR took 20.27 s vs 20.17 s on main (0% slower).
📖 Linting Firefox with this PR took 10.49 s vs 10.48 s on main (0% slower).
📖 Linting Kickstarter with this PR took 7.77 s vs 7.76 s on main (0% slower).
📖 Linting Moya with this PR took 0.44 s vs 0.44 s on main (0% slower).
📖 Linting NetNewsWire with this PR took 2.39 s vs 2.38 s on main (0% slower).
📖 Linting Nimble with this PR took 0.65 s vs 0.64 s on main (1% slower).
📖 Linting PocketCasts with this PR took 7.17 s vs 7.17 s on main (0% slower).
📖 Linting Quick with this PR took 0.41 s vs 0.41 s on main (0% slower).
📖 Linting Realm with this PR took 3.5 s vs 3.49 s on main (0% slower).
📖 Linting Sourcery with this PR took 1.84 s vs 1.86 s on main (1% faster).
📖 Linting Swift with this PR took 4.29 s vs 4.26 s on main (0% slower).
📖 Linting VLC with this PR took 1.12 s vs 1.12 s on main (0% slower).
📖 Linting Wire with this PR took 17.13 s vs 17.05 s on main (0% slower).
📖 Linting WordPress with this PR took 10.04 s vs 10.03 s on main (0% slower).

Here's an example of your CHANGELOG entry:

* Add cognitive complexity.  
  [samglt](https://github.com/samglt)
  [#issue_number](https://github.com/realm/SwiftLint/issues/issue_number)

note: There are two invisible spaces after the entry's text.

Generated by 🚫 Danger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants