Showing 376 of 1,136 total issues
Function updateCacheBox
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
func updateCacheBox() {
let usedCache = Cache.size()
let packsSize = Cache.packsSize()
//print("pack size : \(packsSize)")
Function getCommunityPathForLocale
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
private func getCommunityPathForLocale() -> String {
let locale: NSLocale = NSLocale(localeIdentifier: Locale.preferredLanguages[0])
// Do we have a language override ?
if PrefsAdvanced.ciOverrideLanguage != "" {
Function updateLocalSource
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
static func updateLocalSource(source: Source, reload: Bool) {
// We need the raw manifest to find the path inside
let videos = source.getUnprocessedVideos()
let originalAssets = source.getUnprocessedAssets()
Function getTrimmedRect
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
private func getTrimmedRect() -> CGRect {
let bmp = self.representations[0] as! NSBitmapImageRep
let data: UnsafeMutablePointer<UInt8> = bmp.bitmapData!
var alpha: UInt8
Function findDuplicate
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
func findDuplicate(id: String, url1080pH264: String) -> (Bool, AerialVideo?) {
// We blacklist some duplicates
if url1080pH264 != "" {
if blacklist.contains((URL(string: url1080pH264)?.lastPathComponent)!) {
return (true, nil)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function categorizedSourceList
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
static func categorizedSourceList() -> [SourceHeader] {
var communities: [Source] = []
var online: [Source] = []
var local: [Source] = []
var apple: [Source] = []
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function findDuplicate
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
static func findDuplicate(id: String, url1080pH264: String) -> (Bool, AerialVideo?) {
// We blacklist some duplicates
if url1080pH264 != "" {
if blacklist.contains((URL(string: url1080pH264)?.lastPathComponent)!) {
return (true, nil)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function generatePlaylist
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
func generatePlaylist(isRestricted: Bool, restrictedTo: String) {
// Start fresh
playlist = [AerialVideo]()
playlistIsRestricted = isRestricted
playlistRestrictedTo = restrictedTo
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function connection
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
func connection(_ connection: NSURLConnection, didReceive data: Data) {
queue.async { () -> Void in
self.fillInContentInformation(self.loadingRequest)
Function getLanguageStringFromPosition
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
func getLanguageStringFromPosition(pos: Int) -> String {
switch pos {
case 1:
return "ar"
case 2:
Function filteredVideosFor
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
private func filteredVideosFor(_ mode: FilterMode, section: Int) -> [AerialVideo] {
switch mode {
case .location:
let filter = sourcesFor(mode)[section].lowercased()
return videos
Function getLanguagePosition
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
func getLanguagePosition() -> Int {
// The list is alphabetized based on their english name in the UI
switch PrefsAdvanced.ciOverrideLanguage {
case "ar": // Arabic
return 1
Function detectDisplays
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
func detectDisplays() {
// Display detection is done in two passes :
// - Through CGDisplay, we grab all online screens (connected, but
// may or may not be powered on !) and get most information needed
// - Through NSScreen to get the backingScaleFactor (retinaness of a screen)
Function getCoordinates
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
func getCoordinates(failure: @escaping (_ error: String) -> Void,
success: @escaping (_ response: CLLocationCoordinate2D) -> Void) {
// Sonoma workaround via CompanionBridge
if !Aerial.helper.underCompanion {
if #available(macOS 14.0, *) {
Function collectionView
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
func collectionView(_ itemForRepresentedObjectAtcollectionView: NSCollectionView,
itemForRepresentedObjectAt indexPath: IndexPath) -> NSCollectionViewItem {
let item = playingCollectionView.makeItem(withIdentifier:
NSUserInterfaceItemIdentifier(rawValue: "PlayingCollectionViewItem"), for: indexPath)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function updateCacheBox
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
func updateCacheBox() {
let usedCache = Cache.size()
let packsSize = Cache.packsSize()
//print("pack size : \(packsSize)")
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function loadCachedManifests
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
func loadCachedManifests() {
if let cacheDirectory = VideoCache.appSupportDirectory {
// tvOS13
var cacheFileUrl = URL(fileURLWithPath: cacheDirectory as String)
cacheFileUrl.appendPathComponent("tvos13.json")
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function setup
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
func setup() {
let imagePath = Bundle(for: PanelWindowController.self).path(
forResource: "battery.0",
ofType: "pdf")
Function getOldFilesEstimation
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
func getOldFilesEstimation() -> (String, Int) {
// loadedManifests contains the full deduplicated list of videos
debugLog("Looking for outdated files")
if loadedManifest.isEmpty {
Function parseVideoManifest
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
func parseVideoManifest(_ data: Data) -> [AerialVideo] {
if let videoManifest = try? newJSONDecoder().decode(VideoManifest.self, from: data) {
var processedVideos: [AerialVideo] = []
for asset in videoManifest.assets {