Showing 376 of 1,136 total issues
Function getSuggestedFormat
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
func getSuggestedFormat() -> VideoFormat {
switch isHEVCMain10HWDecodingAvailable() {
case .supported:
if #available(OSX 10.15, *) {
return .v4KHDR
Function collectionView
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
func collectionView(_ itemForRepresentedObjectAtcollectionView: NSCollectionView,
itemForRepresentedObjectAt indexPath: IndexPath) -> NSCollectionViewItem {
let item = playingCollectionView.makeItem(withIdentifier:
NSUserInterfaceItemIdentifier(rawValue: "PlayingCollectionViewItem"), for: indexPath)
Function addLayerForType
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private func addLayerForType(_ layerType: InfoType, layer: CALayer) {
var newLayer: AnimatableLayer?
if PrefsInfo.ofType(layerType).isEnabled && shouldEnableOnScreen(PrefsInfo.ofType(layerType).displays) {
switch layerType {
Function fetch
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
static func fetch(completion: @escaping(Result<GeoLocation, NetworkError>) -> Void) {
// Check if we already have a geocoded location for this ?
if PrefsTime.geocodedString == PrefsInfo.weather.locationString {
debugLog("returning cached location from previous geocoding")
let lat = String(format: "%.2f", PrefsTime.cachedLatitude)
Function pickFolderButton
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
@IBAction func pickFolderButton(_ sender: Any) {
let openPanel = NSOpenPanel()
openPanel.canChooseDirectories = true
openPanel.canChooseFiles = false
Function reframe
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
func reframe() {
// ReRect the name & artist
let rect = nameLayer.calculateRect(string: nameLayer.string as! String,
font: nameLayer.font as! NSFont,
maxWidth: Double(layerManager.frame!.size.width))
Function randomVideo
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
func randomVideo(excluding: [AerialVideo], isVertical: Bool) -> (AerialVideo?, Bool) {
var shouldLoop = false
let timeManagement = TimeManagement.sharedInstance
let (shouldRestrictByDayNight, restrictTo) = timeManagement.shouldRestrictPlaybackToDayNightVideo()
Function viewDidLoad
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
override func viewDidLoad() {
super.viewDidLoad()
DispatchQueue.main.async {
self.scrollView.contentView.scroll(NSMakePoint(0,0))
- 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 runShell
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
func runShell() -> String? {
guard let config = config else {
return 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 mouseDown
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
override func mouseDown(with event: NSEvent) {
let displayDetection = DisplayDetection.sharedInstance
// Grab relative location of the click in view
let point = convert(event.locationInWindow, from: 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 makeLegendBlock
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
func makeLegendBlock(size: Double) -> CALayer {
let mainLayer = CALayer()
// Make a vertically centered layer for t°
let windLayer = CAVCTextLayer()
- 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 moveOldManifests
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
func moveOldManifests() {
debugLog("move")
let cacheDirectory = VideoCache.appSupportDirectory!
var cacheResourcesString = cacheDirectory
- 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 consolidateLoadedRanges
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
func consolidateLoadedRanges() {
var consolidatedRanges: [NSRange] = []
let sortedRanges = loadedRanges.sorted { $0.location < $1.location }
- 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 ensureDownload
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
static func ensureDownload(action: @escaping () -> Void) {
// Do we manage the cache or not ?
if PrefsCache.enableManagement {
// Check network first
if !canNetwork() {
- 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 getRemainingPercent
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
static func getRemainingPercent() -> Int {
// Take a snapshot of all the power source info
guard let snapshot = IOPSCopyPowerSourcesInfo()?.takeRetainedValue()
else { return 0 }
- 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 updateStatusBar
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
func updateStatusBar() {
if PrefsCache.enableManagement {
// We are in managed mode
if PrefsCache.cacheLimit >= 101 {
statusDriveImageView.image = Aerial.helper.getAccentedSymbol("externaldrive.badge.checkmark")
Function setupPopover
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
func setupPopover() {
// Help popover, GVA detection requires 10.13
if #available(OSX 10.13, *) {
if !VTIsHardwareDecodeSupported(kCMVideoCodecType_H264) {
popoverH264Label.stringValue = "H264 acceleration not supported"
Function updateTimeView
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
func updateTimeView() {
switch PrefsTime.timeMode {
case .disabled:
timeBarView.isHidden = true
return
Function categorizedSourceList
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
static func categorizedSourceList() -> [SourceHeader] {
var communities: [Source] = []
var online: [Source] = []
var local: [Source] = []
var apple: [Source] = []
Function checkIfShouldRedownloadFiles
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
func checkIfShouldRedownloadFiles() {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd"
dateFormatter.locale = Locale.init(identifier: "en_GB")
let dateObj = dateFormatter.date(from: PrefsVideos.lastVideoCheck)