SwiftLint icon indicating copy to clipboard operation
SwiftLint copied to clipboard

Add `Cognitive Complexity Rule`

Open lorwe opened this issue 1 year ago • 5 comments

Resolves #3335

Reference: https://www.sonarsource.com/resources/cognitive-complexity/

lorwe avatar Oct 28 '24 06:10 lorwe

659 Warnings
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/Forecast.swift:161:5: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 17 (cognitive_complexity)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/Aerial.swift:374:5: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 20 (cognitive_complexity)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/Cache/Cache.swift:378:5: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 17 (cognitive_complexity)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/Cache/Cache.swift:609:5: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 17 (cognitive_complexity)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/Cache/Cache.swift:704:5: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 30 (cognitive_complexity)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/Cache/PoiStringProvider.swift:165:13: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 17 (cognitive_complexity)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/Cache/VideoLoader.swift:94:5: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 18 (cognitive_complexity)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/Extensions/NSImage+trim.swift:28:13: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 28 (cognitive_complexity)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/Hardware/NightShift.swift:41:5: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 22 (cognitive_complexity)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/ManifestLoader.swift:929:5: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/Music/Music.swift:78:11: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 29 (cognitive_complexity)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/Sources/Sidebar.swift:58:5: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 31 (cognitive_complexity)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/Sources/Source.swift:182:5: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 26 (cognitive_complexity)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/Sources/Source.swift:365:5: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 20 (cognitive_complexity)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/Sources/Source.swift:437:5: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 26 (cognitive_complexity)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/Sources/SourceList.swift:166:5: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 17 (cognitive_complexity)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/Sources/VideoList.swift:425:5: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/Time/TimeManagement.swift:45:5: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 32 (cognitive_complexity)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Views/AerialView.swift:237:5: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 34 (cognitive_complexity)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Views/AerialView.swift:774:5: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 24 (cognitive_complexity)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Views/AerialView.swift:900:14: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 21 (cognitive_complexity)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/ForecastLayer.swift:17:5: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 36 (cognitive_complexity)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Views/PrefPanel/DisplayView.swift:58:14: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 38 (cognitive_complexity)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Views/PrefPanel/InfoWeatherView.swift:126:15: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 23 (cognitive_complexity)
:warning: This PR introduced a violation in Aerial: /Resources/MainUI/VideosViewController.swift:401:5: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
:warning: This PR introduced a violation in Alamofire: /Source/Core/Request.swift:1002:12: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 29 (cognitive_complexity)
:warning: This PR introduced a violation in Alamofire: /Source/Features/URLEncodedFormEncoder.swift:585:13: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
:warning: This PR introduced a violation in Alamofire: /Tests/ProtectedTests.swift:168:13: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 19 (cognitive_complexity)
:warning: This PR introduced a violation in Alamofire: /Tests/ProtectedTests.swift:224:13: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 19 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /App/iOS/Delegates/SceneDelegate.swift:287:3: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 24 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /App/iOS/Delegates/SceneDelegate.swift:40:3: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 24 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Plugins/LeoAssetsPlugin/LeoAssetsPlugin.swift:104:15: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/DeviceCheck/DeviceCheck.swift:318:11: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 25 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Brave Notifications/BraveNotificationsPresenter.swift:54:3: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 19 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BVC+Callout.swift:237:11: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 19 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BVC+Menu.swift:124:3: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 22 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BVC+Menu.swift:49:3: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 17 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BVC+Onboarding.swift:185:11: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 17 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BVC+Playlist.swift:101:3: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 25 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BVC+ProductNotification.swift:32:11: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 20 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BVC+ProductNotification.swift:83:11: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 22 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BVC+ReaderMode.swift:159:3: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 18 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BVC+ShareActivity.swift:16:3: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 74 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BVC+TabManagerDelegate.swift:19:3: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 30 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BVC+TabManagerDelegate.swift:226:3: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 52 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BVC+ToolbarDelegate.swift:231:22: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 20 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BVC+ToolbarDelegate.swift:354:3: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 23 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BVC+ToolbarDelegate.swift:64:3: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 18 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BVC+ToolbarDelegate.swift:652:11: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 50 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BVC+ToolbarDelegate.swift:823:3: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 18 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BVC+WKNavigationDelegate.swift:1225:10: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 40 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BVC+WKNavigationDelegate.swift:1403:11: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 17 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BVC+WKNavigationDelegate.swift:153:10: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 91 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BVC+WKNavigationDelegate.swift:497:10: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 23 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BVC+WKNavigationDelegate.swift:611:22: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 21 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BVC+WKNavigationDelegate.swift:755:10: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 17 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BVC+WKNavigationDelegate.swift:918:11: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 26 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BVC+Wallet.swift:192:10: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 17 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BVC+Wallet.swift:600:3: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BVC+Widgets.swift:17:3: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 21 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BrowserViewController.swift:1264:19: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 49 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BrowserViewController.swift:1716:19: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 92 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BrowserViewController.swift:2293:3: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 17 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BrowserViewController.swift:276:10: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 18 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BrowserViewController.swift:3075:10: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BrowserViewController.swift:3343:3: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 21 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BrowserViewController.swift:449:15: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 29 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/BrowserViewController/BrowserViewController.swift:860:11: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 18 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/Favorites/FavoritesViewController.swift:601:3: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 23 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/Favorites/PreloadedFavorites.swift:12:3: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 21 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/FrequencyQuery.swift:78:11: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 17 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/Handlers/ReaderModeHandler.swift:20:10: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 41 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/HomePanel/NTPDataSource.swift:106:3: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 20 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/New Tab Page/NewTabPageFlowLayout.swift:61:12: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 17 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/New Tab Page/NewTabPageViewController.swift:559:11: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 18 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/New Tab Page/NewTabPageViewController.swift:943:3: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 23 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/New Tab Page/Sections/BraveNewsSectionProvider.swift:155:3: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 20 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/New Tab Page/Sections/BraveNewsSectionProvider.swift:240:3: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/Playlist/Controllers/PlaylistCarplayController.swift:106:3: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 34 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/Playlist/Controllers/PlaylistCarplayController.swift:364:11: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 30 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/Playlist/Controllers/PlaylistCarplayController.swift:71:3: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/Playlist/Controllers/PlaylistCarplayController.swift:953:11: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 17 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/Playlist/Controllers/PlaylistListViewController+TableViewDataSource.swift:156:3: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 53 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/Playlist/Controllers/PlaylistListViewController+TableViewDataSource.swift:76:3: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/Playlist/Controllers/PlaylistListViewController.swift:238:11: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 19 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/Playlist/Controllers/PlaylistListViewController.swift:670:3: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 20 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/Playlist/Controllers/PlaylistListViewController.swift:846:3: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/Playlist/Controllers/PlaylistViewController.swift:324:11: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 37 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/Playlist/Controllers/PlaylistViewController.swift:693:3: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/Playlist/Managers & Cache/PlaylistCacheLoader.swift:141:5: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 24 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/Playlist/Managers & Cache/PlaylistCacheLoader.swift:281:3: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 21 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/Playlist/Managers & Cache/PlaylistCacheLoader.swift:407:15: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/Playlist/VideoPlayer/UI/VideoPlayer.swift:283:11: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 44 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/Search/OpenSearch.swift:249:3: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 47 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/Search/SearchSuggestClient.swift:34:3: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 18 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/Search/SearchViewController.swift:377:3: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/Search/SearchViewController.swift:517:19: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 27 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/TabManager.swift:303:3: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 20 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/TabManager.swift:508:14: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 23 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/TabManager.swift:625:14: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 36 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/Tabs/TabBar/TabsBarViewController.swift:468:3: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/Toolbars/BottomToolbar/Menu/Bookmarks/AddEditBookmarkTableViewController.swift:254:9: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 21 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/Toolbars/BottomToolbar/Menu/Bookmarks/BookmarksViewController.swift:354:15: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 26 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/Toolbars/BottomToolbar/Menu/Bookmarks/BookmarksViewController.swift:467:3: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 18 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/Toolbars/BottomToolbar/Menu/Bookmarks/BookmarksViewController.swift:539:3: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/UserScriptManager.swift:273:3: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 27 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Login/LoginListDataSource.swift:103:11: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 18 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Settings/Debug/Rewards Internals/RewardsInternalsShareController.swift:132:11: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 19 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Settings/Debug/SandboxInspectorView.swift:34:11: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 16 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/AdvancedShieldSettings.swift:114:11: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 19 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Settings/SettingsViewController.swift:236:11: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 21 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/Sync/SyncWelcomeViewController.swift:346:11: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 26 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/UserContent/UserScripts/Scripts_Dynamic/ScriptHandlers/Paged/ContentBlockerScriptHandler.swift:50:3: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 35 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/UserContent/UserScripts/Scripts_Dynamic/ScriptHandlers/Paged/CosmeticFiltersScriptHandler.swift:39:3: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 18 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/UserContent/UserScripts/Scripts_Dynamic/ScriptHandlers/Paged/EthereumProviderScriptHandler.swift:63:14: error: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 28 (cognitive_complexity)
:warning: This PR introduced a violation in Brave: /Sources/Brave/Frontend/UserContent/UserScripts/Scripts_Dynamic/ScriptHandlers/Paged/PlaylistScriptHandler.swift:115:11: warning: Cognitive Complexity Violation: Function should have cognitive complexity 15 or less; currently complexity is 18 (cognitive_complexity)
:warning: Danger found 659 violations with this PR. Due to GitHub's max issue comment size, the number shown has been truncated to 116.
17 Messages
:book: Linting Aerial with this PR took 0.93s vs 0.93s on main (0% slower)
:book: Linting Alamofire with this PR took 1.27s vs 1.27s on main (0% slower)
:book: Linting Brave with this PR took 7.22s vs 7.22s on main (0% slower)
:book: Linting DuckDuckGo with this PR took 5.09s vs 5.09s on main (0% slower)
:book: Linting Firefox with this PR took 10.65s vs 10.63s on main (0% slower)
:book: Linting Kickstarter with this PR took 9.86s vs 9.88s on main (0% faster)
:book: Linting Moya with this PR took 0.53s vs 0.53s on main (0% slower)
:book: Linting NetNewsWire with this PR took 2.63s vs 2.63s on main (0% slower)
:book: Linting Nimble with this PR took 0.78s vs 0.77s on main (1% slower)
:book: Linting PocketCasts with this PR took 8.57s vs 8.56s on main (0% slower)
:book: Linting Quick with this PR took 0.44s vs 0.45s on main (2% faster)
:book: Linting Realm with this PR took 4.52s vs 4.51s on main (0% slower)
:book: Linting Sourcery with this PR took 2.32s vs 2.31s on main (0% slower)
:book: Linting Swift with this PR took 4.53s vs 4.51s on main (0% slower)
:book: Linting VLC with this PR took 1.26s vs 1.25s on main (0% slower)
:book: Linting Wire with this PR took 17.59s vs 17.56s on main (0% slower)
:book: Linting WordPress with this PR took 11.6s vs 11.54s on main (0% slower)

Generated by :no_entry_sign: Danger

SwiftLintBot avatar Oct 28 '24 06:10 SwiftLintBot

what needs to happen to get this merged? Is thing we can do to help on this issue. It would be amazing to have cognitive complexity rule enforcement in this library.

Sophrinix avatar Dec 13 '24 17:12 Sophrinix

also why are these warnings being generated here when none of these projects have anything to do with this project?

Sophrinix avatar Dec 13 '24 18:12 Sophrinix

what needs to happen to get this merged? Is thing we can do to help on this issue. It would be amazing to have cognitive complexity rule enforcement in this library.

So it will need to be code reviewed and approved, and then merged. Everyone who contributes to SwiftLint works on a volunteer basis, so it can take a while for people to find time to come back to it. If you look at previously merged PRs, you'll see that it can take a while.

I do have some comments on the PR, but I don't have time right now to take a proper look.

Generally if you can keep the branch clean and without merge conflicts that is good. The changelog can be a bit of a hotspot.

mildm8nnered avatar Dec 14 '24 15:12 mildm8nnered

also why are these warnings being generated here when none of these projects have anything to do with this project?

So PRs that change any code in SwiftLint (some PRs are excluded but I can't remember the exact basis offhand) are run against a set of popular open source projects, and their violations compared against what main would detect.

This gives a kind of sanity check across a much wider codebase, and inspecting the new violations can be a big clue as to where we might be picking up false alarms, and "fixed" violations can be inspected to see if they really should have been fixed by the changes. In this case, it's a new rule, so you'd only expect new violations.

mildm8nnered avatar Dec 14 '24 15:12 mildm8nnered