Showing 376 of 1,136 total issues
VideoList
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class VideoList {
enum FilterMode {
case location, cache, time, scene, source, rotation, favorite, hidden
}
Function showVideo
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
func showVideo(_ video: AerialVideo) {
playbackSpeedLabel.isHidden = false
playbackSpeedSlider.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
Function makeHourBlock
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
func makeHourBlock(hour: FList, size: Double) -> CALayer {
let mainLayer = CALayer()
let isNight = hour.sys!.pod! == "n" ? true : false
Function makeLegendBlock
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
func makeLegendBlock(size: Double) -> CALayer {
let mainLayer = CALayer()
// Make a vertically centered layer for t°
let windLayer = CAVCTextLayer()
Source
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
struct Source: Codable {
var name: String
var description: String
var manifestUrl: String
var type: SourceType
Function move
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
func move(toCorner: InfoCorner, fullRedraw: Bool) {
if let currCorner = currentCorner, !fullRedraw {
// Are we on the same corner ?
if currCorner == toCorner {
// And same height ?
Function setupPlayerLayer
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
func setupPlayerLayer(withPlayer player: AVPlayer) {
let displayDetection = DisplayDetection.sharedInstance
self.layer = CALayer()
guard let layer = self.layer else {
Function iconFor
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
static func iconFor(_ path: String, name: String) -> NSImage? {
if path.starts(with: "videos:location") {
return Aerial.helper.getAccentedSymbol("mappin.and.ellipse")
} else if path.starts(with: "videos:cache") && name == VideoList.instance.cacheDownloaded {
return Aerial.helper.getAccentedSymbol("internaldrive")
Function tableView
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? {
guard let path = path 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 updateVideoView
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
func updateVideoView() {
if let video = getSelectedVideo() {
debugLog("\"\(video.id)\": \"sunrise\", // \(video.name) - \(video.secondaryName)")
debugLog("\"\(video.id)\": \"sunset\", // \(video.name) - \(video.secondaryName)")
debugLog("\"\(video.id)\": \"night\", // \(video.name) - \(video.secondaryName)")
- 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 readOldJSONFromData
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
func readOldJSONFromData(_ data: Data) -> [AerialVideo] {
var processedVideos: [AerialVideo] = []
do {
let poiStringProvider = PoiStringProvider.sharedInstance
Function freeCache
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
static func freeCache() {
guard PrefsCache.enableManagement else {
return
}
Function actionButton
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
@IBAction func actionButton(_ sender: NSButton) {
if let source = source {
if source.type == .local {
NSWorkspace.shared.selectFile(nil, inFileViewerRootedAtPath: Cache.supportPath.appending("/"+source.name))
} else {
- 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 fetch
has a Cognitive Complexity of 18 (exceeds 5 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)
- 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 getCommunityPathForLocale
has a Cognitive Complexity of 18 (exceeds 5 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 != "" {
- 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 filteredVideosFor
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
private func filteredVideosFor(_ mode: FilterMode, filter: [String]) -> [AerialVideo] {
// Our preference filters contains ALL sorts of filters (location, time) that are
// saved for better user experience. So we need to filter the filters first !
var filters: [String] = []
File SourcesViewController.swift
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Cocoa
class SourcesViewController: NSViewController {
var customVideoController: CustomVideoController?
DisplayDetection
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
final class DisplayDetection: NSObject {
static let sharedInstance = DisplayDetection()
var screens = [Screen]()
var unusedScreens = [Screen]()
Function fetch
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
static func fetch(completion: @escaping(Result<OCOneCall, NetworkError>) -> Void) {
guard testJson == "" else {
let jsonData = testJson.data(using: .utf8)!
do {
File PoiStringProvider.swift
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Foundation
final class CommunityStrings {
let id: String
let name: String