JohnCoates/Aerial

View on GitHub

Showing 376 of 1,136 total issues

Function urlSession has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        _ session: URLSession,
        downloadTask: URLSessionDownloadTask,
        didWriteData bytesWritten: Int64,
        totalBytesWritten: Int64,
        totalBytesExpectedToWrite: Int64
Severity: Minor
Found in Aerial/Source/Models/Downloads/DownloadManager.swift - About 35 mins to fix

    Function urlSession has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            _ session: URLSession,
            downloadTask: URLSessionDownloadTask,
            didWriteData bytesWritten: Int64,
            totalBytesWritten: Int64,
            totalBytesExpectedToWrite: Int64
    Severity: Minor
    Found in Aerial/Source/Models/Downloads/DownloadManager.swift - About 35 mins to fix

      Function with has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              pointsOfInterest: [String: String]? = nil,
              url: String? = nil,
              accessibilityLabel: String? = nil,
              id: String? = nil,
              time: String? = nil
      Severity: Minor
      Found in Aerial/Source/Models/CustomVideoFolders.swift - About 35 mins to fix

        Function setupExtraLayers has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            func setupExtraLayers(layer: CALayer, frame: CGRect) {
                self.frame = frame
        
                var topRow = [InfoType]()
                var bottomRow = [InfoType]()
        Severity: Minor
        Found in Aerial/Source/Views/Layers/LayerManager.swift - About 35 mins to fix

        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 resetAllSettings has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            @IBAction func resetAllSettings(_ sender: NSButton) {
                if Aerial.helper.showAlert(
                    question: "Reset all settings?",
                    text: "This will reset all your settings. After they are reset, Aerial will close System Preferences, you will have to reload it to access settings again.\n\nAre you sure you want to reset your settings?",
                    button1: "Reset my settings",
        Severity: Minor
        Found in Resources/MainUI/Settings panels/AdvancedViewController.swift - About 35 mins to fix

        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 getSunriseSunset has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public func getSunriseSunset() -> (Date?, Date?) {
                switch PrefsTime.timeMode {
                case .disabled:
                    return (nil, nil)
                case .nightShift:
        Severity: Minor
        Found in Aerial/Source/Models/Time/TimeManagement.swift - About 35 mins to fix

        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 setupDarkMode has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            func setupDarkMode() {
                // Dark Mode is Mojave+
                if #available(OSX 10.14, *) {
                    if PrefsTime.darkModeNightOverride {
                        darkModeNightOverride.state = .on
        Severity: Minor
        Found in Resources/MainUI/Settings panels/TimeViewController.swift - About 35 mins to fix

        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 addLayerForType has a Cognitive Complexity of 7 (exceeds 5 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 {
        Severity: Minor
        Found in Aerial/Source/Views/Layers/LayerManager.swift - About 35 mins to fix

        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 detectDayChange has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            func detectDayChange(list: [FList]) -> Int {
                var firstDay: String?
                var index = 0
                for day in list {
                    if firstDay == nil {
        Severity: Minor
        Found in Aerial/Source/Views/Layers/Weather/ForecastLayer.swift - About 35 mins to fix

        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 viewDidLoad has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            override func viewDidLoad() {
                super.viewDidLoad()
        
                // Main switch
                if PrefsDisplays.dimBrightness {
        Severity: Minor
        Found in Resources/MainUI/Settings panels/BrightnessViewController.swift - About 35 mins to fix

        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 calculateFrom has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            private func calculateFrom(latitude: Double, longitude: Double) -> (Bool, String) {
                solar = Solar.init(coordinate: CLLocationCoordinate2D(
                    latitude: latitude,
                    longitude: longitude))
        
        
        Severity: Minor
        Found in Aerial/Source/Models/Time/TimeManagement.swift - About 35 mins to fix

        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 fillOrRollCache has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            static func fillOrRollCache() {
                guard PrefsCache.enableManagement && canNetwork() else {
                    return
                }
        
        
        Severity: Minor
        Found in Aerial/Source/Models/Cache/Cache.swift - About 35 mins to fix

        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 checkIfShouldRedownloadFiles has a Cognitive Complexity of 7 (exceeds 5 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)
        Severity: Minor
        Found in Aerial/Source/Models/ManifestLoader.swift - About 35 mins to fix

        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 updateLayerList has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            static func updateLayerList() {
                if !PrefsInfo.layers.contains(.battery) {
                    PrefsInfo.layers.append(.battery)
                }
        
        
        Severity: Minor
        Found in Aerial/Source/Models/Prefs/PrefsInfo.swift - About 35 mins to fix

        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 rollLogIfNeeded has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        func rollLogIfNeeded() {
            let cacheDirectory = Cache.supportPath
            // if let cacheDirectory = path() {
            var cacheFileUrl = URL(fileURLWithPath: cacheDirectory as String)
            
        Severity: Minor
        Found in Aerial/Source/Models/ErrorLog.swift - About 35 mins to fix

        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 processPathForVideos has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            static func processPathForVideos(url: URL) {
                debugLog("processing url for videos : \(url) ")
                let folderName = url.lastPathComponent
        
                do {
        Severity: Minor
        Found in Aerial/Source/Models/Sources/SourceList.swift - About 35 mins to fix

        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 locationManager has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {
                debugLog("LMauth status change : \(status.rawValue)")
                if status == .denied {
                    if PrefsTime.cachedLatitude != 0 {
                        debugLog("Couldn't retrieve your location, using latest cached coordinates instead")
        Severity: Minor
        Found in Aerial/Source/Models/Locations.swift - About 35 mins to fix

        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 canNetwork has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            static func canNetwork() -> Bool {
                if !PrefsCache.enableManagement {
                    return true
                }
        
        
        Severity: Minor
        Found in Aerial/Source/Models/Cache/Cache.swift - About 35 mins to fix

        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 refreshVideoList has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            private func refreshVideoList() {
                debugLog("Refreshing video list")
        
                videos = []
        
        
        Severity: Minor
        Found in Aerial/Source/Models/Sources/VideoList.swift - About 35 mins to fix

        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 processPathForVideos has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            func processPathForVideos(url: URL) {
                debugLog("processing url for videos : \(url) ")
                let folderName = url.lastPathComponent
                // let manifestInstance = ManifestLoader.instance
        
        
        Severity: Minor
        Found in Aerial/Source/Controllers/CustomVideoController.swift - About 35 mins to fix

        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

        Severity
        Category
        Status
        Source
        Language