Showing 376 of 1,136 total issues
Function setupForVideo
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
override func setupForVideo(video: AerialVideo, player: AVPlayer) {
guard let config = config else {
return
}
- 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
Avoid deeply nested control flow statements. Open
if idx < 2 {
idx += 1
} else {
idx = 0
}
Function closeButton
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
@IBAction func closeButton(_ sender: Any) {
windowController!.stopVideo()
if !downloadIndicator.isHidden {
// swiftlint:disable:next line_length
- 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 outlineView
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
func outlineView(_ outlineView: NSOutlineView, viewFor tableColumn: NSTableColumn?, item: Any) -> NSView? {
var view: NSTableCellView?
if let header = item as? Sidebar.Header {
view = outlineView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "HeaderCell"), owner: self) as? NSTableCellView
- 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
Avoid deeply nested control flow statements. Open
for view in AerialView.sharedViews where AerialView.sharedViews.first != view {
view.fastFadeOut(andPlayNext: false)
}
Avoid deeply nested control flow statements. Open
if day.frame.height > height {
height = day.frame.height
}
Avoid deeply nested control flow statements. Open
if PrefsDisplays.viewingMode == .mirrored && shouldFlip {
image = image?.flipped(flipHorizontally: true, flipVertically: false)
}
Function showImage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
func showImage(_ video: AerialVideo) {
heroPlayerView.isHidden = true
heroImageView.isHidden = false
isCachedImageView.isHidden = true
- 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
Avoid deeply nested control flow statements. Open
if dayidx == 0 {
day = makeDayBlock(slice: flist[0..<breakIndex], size: size*2)
} else {
day = makeDayBlock(slice: flist[start..<(start+8)], size: size*2)
Function willStop
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
@objc func willStop(_ aNotification: Notification) {
DisplayDetection.sharedInstance.resetUnusedScreens()
/* if #available(macOS 14.0, *) {
debugLog("🖼️ 📢📢📢 🖼️ 📢📢📢 ☢️sonoma☢️ workaround IGNORING willStop")
- 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 migrateOldCache
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
static private func migrateOldCache() {
if let formerCachePath = formerCachePath {
do {
let formerCacheURL = URL(fileURLWithPath: formerCachePath as String)
- 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 Log
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
func Log(level: ErrorLevel, message: String) {
#if DEBUG
print("\(message)\n")
#endif
- 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 resourceLoader
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
func resourceLoader(_ resourceLoader: AVAssetResourceLoader,
didCancel loadingRequest: AVAssetResourceLoadingRequest) {
// debugLog("cancelled load request: \(loadingRequest)")
var remove: VideoLoader?
- 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 lastUpdated
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
func lastUpdated() -> String {
if isCached() {
var date: Date?
if !isCachable && type == .local {
date = (try? FileManager.default.attributesOfItem(atPath:
- 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
Avoid deeply nested control flow statements. Open
if dupe.urls[.v1080pH264] == "" {
dupe.urls[.v1080pH264] = asset.url
}
Avoid deeply nested control flow statements. Open
if foundDupe?.urls[.v1080pH264] == "" {
foundDupe?.urls[.v1080pH264] = url
}
Function isAvailableOffline
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
static func isAvailableOffline(video: AerialVideo) -> Bool {
let fileManager = FileManager.default
if video.url.absoluteString.starts(with: "file") {
return fileManager.fileExists(atPath: video.url.path)
- 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 finishedDownload
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
func finishedDownload(id: String, success: Bool) {
// Manage our queuedVideo index
if let index = queuedVideos.firstIndex(of: id) {
queuedVideos.remove(at: index)
}
- 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 outlineView
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
func outlineView(_ outlineView: NSOutlineView, shouldSelectItem item: Any) -> Bool {
debugLog("selected \(item)")
if let source = item as? Source {
topPathControl.isHidden = false
- 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
Avoid deeply nested control flow statements. Open
if surl.isDirectory {
debugLog("processing dir")
self.processPathForVideos(url: surl)
}