Showing 376 of 1,136 total issues
Function loadBundle
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private func loadBundle() {
// Idle string bundle
var bundlePath = Cache.supportPath.appending("/macOS 14")
if PrefsAdvanced.ciOverrideLanguage == "" {
Function getTimeString
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
func getTimeString() -> String {
// Handle locale
var locale = Locale(identifier: Locale.preferredLanguages[0])
if PrefsAdvanced.ciOverrideLanguage != "" {
locale = Locale(identifier: PrefsAdvanced.ciOverrideLanguage)
Function setupRefresh
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
func setupRefresh() {
debugLog("setting up refresh")
guard let config = config else {
return
}
Function isDaytime
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public func isDaytime(zenith: Zenith) -> Bool {
guard
let _ = sunrise,
let _ = sunset
else {
Function removeCruft
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
static func removeCruft() {
// TODO: kind of a temporary safety
if VideoList.instance.videos.count > 90 {
// First let's look at the cache
Function observeValue
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
internal override func observeValue(forKeyPath keyPath: String?,
of object: Any?, change: [NSKeyValueChangeKey: Any]?,
context: UnsafeMutableRawPointer?) {
debugLog("🖼️ \(description) observeValue \(String(describing: keyPath)) \(playerLayer.isReadyForDisplay)")
Function makeWindBlock
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
func makeWindBlock(wind: OWWind) -> CALayer {
let windBlock = CALayer()
// Make a vertically centered layer for t°
let textWind = CAVCTextLayer()
Function getTimeString
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
func getTimeString() -> String {
if #available(OSX 10.12, *) {
// Handle locale
var locale = Locale(identifier: Locale.preferredLanguages[0])
if PrefsAdvanced.ciOverrideLanguage != "" {
Function getSunriseSunset
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public func getSunriseSunset() -> (Date?, Date?) {
switch PrefsTime.timeMode {
case .disabled:
return (nil, nil)
case .nightShift:
Function updateRuntimeLabel
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
func updateRuntimeLabel() {
guard let path = self.path else {
videoListRuntimeLabel.stringValue = ""
return
}
Function reloadFiles
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
func reloadFiles() {
moveOldManifests()
// Ok then, we fetch them...
debugLog("Fetching missing manifests online")
Function logToDisk
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
func logToDisk(_ message: String) {
DispatchQueue.main.async {
// Prefix message with date
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss.SSS"
Function setType
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
func setType(_ forType: InfoType, controller: OverlaysViewController) {
// We need the controller for callbacks, when we update the isEnabled state,
// we need to update the list view on the left too
self.controller = controller
Function isCornerAcceptable
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
func isCornerAcceptable(corner: Int) -> Bool {
// Not the prettiest helper, this is a bit of a hack
// If we have something in both topCenter and bottomCenter, we could infinite loop
// So as a precaution we allow whatever was picked
Function moveOldManifests
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
func moveOldManifests() {
debugLog("move")
let cacheDirectory = VideoCache.appSupportDirectory!
var cacheResourcesString = cacheDirectory
Function setupPopover
has a Cognitive Complexity of 10 (exceeds 5 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"
- 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 getTimeString
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
func getTimeString() -> String {
// Handle locale
var locale = Locale(identifier: Locale.preferredLanguages[0])
if PrefsAdvanced.ciOverrideLanguage != "" {
locale = Locale(identifier: PrefsAdvanced.ciOverrideLanguage)
- 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 screenIsUnlocked
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
@objc func screenIsUnlocked(_ aNotification: Notification) {
if #available(macOS 14.0, *) {
debugLog("🖼️ 📢📢📢 ☢️sonoma☢️ workaround screenIsUnlocked")
if !Aerial.helper.underCompanion {
if let player = player {
- 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 pickFolderButton
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
@IBAction func pickFolderButton(_ sender: Any) {
let openPanel = NSOpenPanel()
openPanel.canChooseDirectories = true
openPanel.canChooseFiles = 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
Function checkIfShouldSetBrightness
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
func checkIfShouldSetBrightness() {
let timeManagement = TimeManagement.sharedInstance
if PrefsDisplays.dimBrightness && !isPreview && brightnessToRestore == 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"