JohnCoates/Aerial

View on GitHub

Showing 257 of 1,136 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            return videos
                .filter { filters.contains($0.timeOfDay.lowercased()) && !PrefsVideos.hidden.contains($0.id) }
                .sorted { $0.secondaryName < $1.secondaryName }
Severity: Minor
Found in Aerial/Source/Models/Sources/VideoList.swift and 1 other location - About 50 mins to fix
Aerial/Source/Models/Sources/VideoList.swift on lines 184..186

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            let vids = videos
                .filter { filters.contains($0.name.lowercased()) && !PrefsVideos.hidden.contains($0.id) }
                .sorted { $0.secondaryName < $1.secondaryName }
Severity: Minor
Found in Aerial/Source/Models/Sources/VideoList.swift and 1 other location - About 50 mins to fix
Aerial/Source/Models/Sources/VideoList.swift on lines 189..191

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

        if path.starts(with: "settings:") {
            let idx = path.firstIndex(of: ":")
            switchToSettings(String(path[idx!...].dropFirst())) // Oh Swift...
        }
Severity: Major
Found in Resources/MainUI/PanelWindowController.swift and 2 other locations - About 50 mins to fix
Resources/MainUI/PanelWindowController.swift on lines 195..198
Resources/MainUI/PanelWindowController.swift on lines 211..214

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

        if path.starts(with: "infos:") {
            let idx = path.firstIndex(of: ":")
            switchToInfos(String(path[idx!...].dropFirst())) // Oh Swift...
        }
Severity: Major
Found in Resources/MainUI/PanelWindowController.swift and 2 other locations - About 50 mins to fix
Resources/MainUI/PanelWindowController.swift on lines 195..198
Resources/MainUI/PanelWindowController.swift on lines 206..209

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

        if path.starts(with: "modern:") {
            let idx = path.firstIndex(of: ":")
            switchToModern(String(path[idx!...].dropFirst())) // Oh Swift...
        }
Severity: Major
Found in Resources/MainUI/PanelWindowController.swift and 2 other locations - About 50 mins to fix
Resources/MainUI/PanelWindowController.swift on lines 206..209
Resources/MainUI/PanelWindowController.swift on lines 211..214

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

            if let match = bestMatchedLanguage {
                debugLog("Best matched language : \(match)")
                bundlePath.append(contentsOf: "/TVIdleScreenStrings.bundle/" + match + ".lproj/")
            } else {
                debugLog("No match, reverting to english")
Severity: Minor
Found in Aerial/Source/Models/Cache/PoiStringProvider.swift and 1 other location - About 45 mins to fix
Aerial/Source/Models/Cache/PoiStringProvider.swift on lines 69..78

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if PrefsInfo.weather.degree == .celsius {
            if PrefsInfo.weatherWindMode == .kph {
                textWind.string = "\(Int(wind.speed * 3.6)) km/h"
            } else {
                textWind.string = "\(Int(wind.speed)) m/s"
Severity: Minor
Found in Aerial/Source/Views/Layers/Weather/ConditionLayer.swift and 1 other location - About 45 mins to fix
Aerial/Source/Views/Layers/Weather/ForecastLayer.swift on lines 364..372

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if PrefsInfo.weather.degree == .celsius {
            if PrefsInfo.weatherWindMode == .kph {
                windLayer.string = "km/h"
            } else {
                windLayer.string = "m/s"
Severity: Minor
Found in Aerial/Source/Views/Layers/Weather/ForecastLayer.swift and 1 other location - About 45 mins to fix
Aerial/Source/Views/Layers/Weather/ConditionLayer.swift on lines 260..268

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

            if let match = bestMatchedLanguage {
                debugLog("Best matched language : \(match)")
                bundlePath.append(contentsOf: "/TVIdleScreenStrings.bundle/" + match + ".lproj/")
            } else {
                debugLog("No match, reverting to english")
Severity: Minor
Found in Aerial/Source/Models/Cache/PoiStringProvider.swift and 1 other location - About 45 mins to fix
Aerial/Source/Models/Cache/PoiStringProvider.swift on lines 56..65

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    override init(withLayer: CALayer, isPreview: Bool, offsets: LayerOffsets, manager: LayerManager) {
        super.init(withLayer: withLayer, isPreview: isPreview, offsets: offsets, manager: manager)

        self.opacity = 0
    }
Severity: Major
Found in Aerial/Source/Views/Layers/Music/MusicLayer.swift and 7 other locations - About 45 mins to fix
Aerial/Source/Views/Layers/BatteryIconLayer.swift on lines 32..37
Aerial/Source/Views/Layers/ClockLayer.swift on lines 26..31
Aerial/Source/Views/Layers/CountdownLayer.swift on lines 26..31
Aerial/Source/Views/Layers/DateLayer.swift on lines 26..31
Aerial/Source/Views/Layers/DownloadIndicatorLayer.swift on lines 26..31
Aerial/Source/Views/Layers/MessageLayer.swift on lines 26..31
Aerial/Source/Views/Layers/TimerLayer.swift on lines 28..33

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 55.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    override init(withLayer: CALayer, isPreview: Bool, offsets: LayerOffsets, manager: LayerManager) {
        super.init(withLayer: withLayer, isPreview: isPreview, offsets: offsets, manager: manager)

        // Always on layers should start with full opacity
        self.opacity = 1
Severity: Major
Found in Aerial/Source/Views/Layers/CountdownLayer.swift and 7 other locations - About 45 mins to fix
Aerial/Source/Views/Layers/BatteryIconLayer.swift on lines 32..37
Aerial/Source/Views/Layers/ClockLayer.swift on lines 26..31
Aerial/Source/Views/Layers/DateLayer.swift on lines 26..31
Aerial/Source/Views/Layers/DownloadIndicatorLayer.swift on lines 26..31
Aerial/Source/Views/Layers/MessageLayer.swift on lines 26..31
Aerial/Source/Views/Layers/Music/MusicLayer.swift on lines 33..37
Aerial/Source/Views/Layers/TimerLayer.swift on lines 28..33

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 55.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    override init(withLayer: CALayer, isPreview: Bool, offsets: LayerOffsets, manager: LayerManager) {
        super.init(withLayer: withLayer, isPreview: isPreview, offsets: offsets, manager: manager)

        // Always on layers should start with full opacity
        self.opacity = 1
Severity: Major
Found in Aerial/Source/Views/Layers/BatteryIconLayer.swift and 7 other locations - About 45 mins to fix
Aerial/Source/Views/Layers/ClockLayer.swift on lines 26..31
Aerial/Source/Views/Layers/CountdownLayer.swift on lines 26..31
Aerial/Source/Views/Layers/DateLayer.swift on lines 26..31
Aerial/Source/Views/Layers/DownloadIndicatorLayer.swift on lines 26..31
Aerial/Source/Views/Layers/MessageLayer.swift on lines 26..31
Aerial/Source/Views/Layers/Music/MusicLayer.swift on lines 33..37
Aerial/Source/Views/Layers/TimerLayer.swift on lines 28..33

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 55.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    override init(withLayer: CALayer, isPreview: Bool, offsets: LayerOffsets, manager: LayerManager) {
        super.init(withLayer: withLayer, isPreview: isPreview, offsets: offsets, manager: manager)

        // Always on layers should start with full opacity
        self.opacity = 1
Severity: Major
Found in Aerial/Source/Views/Layers/TimerLayer.swift and 7 other locations - About 45 mins to fix
Aerial/Source/Views/Layers/BatteryIconLayer.swift on lines 32..37
Aerial/Source/Views/Layers/ClockLayer.swift on lines 26..31
Aerial/Source/Views/Layers/CountdownLayer.swift on lines 26..31
Aerial/Source/Views/Layers/DateLayer.swift on lines 26..31
Aerial/Source/Views/Layers/DownloadIndicatorLayer.swift on lines 26..31
Aerial/Source/Views/Layers/MessageLayer.swift on lines 26..31
Aerial/Source/Views/Layers/Music/MusicLayer.swift on lines 33..37

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 55.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    override init(withLayer: CALayer, isPreview: Bool, offsets: LayerOffsets, manager: LayerManager) {
        super.init(withLayer: withLayer, isPreview: isPreview, offsets: offsets, manager: manager)

        // Always on layers should start with full opacity
        self.opacity = 1
Severity: Major
Found in Aerial/Source/Views/Layers/DateLayer.swift and 7 other locations - About 45 mins to fix
Aerial/Source/Views/Layers/BatteryIconLayer.swift on lines 32..37
Aerial/Source/Views/Layers/ClockLayer.swift on lines 26..31
Aerial/Source/Views/Layers/CountdownLayer.swift on lines 26..31
Aerial/Source/Views/Layers/DownloadIndicatorLayer.swift on lines 26..31
Aerial/Source/Views/Layers/MessageLayer.swift on lines 26..31
Aerial/Source/Views/Layers/Music/MusicLayer.swift on lines 33..37
Aerial/Source/Views/Layers/TimerLayer.swift on lines 28..33

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 55.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    override init(withLayer: CALayer, isPreview: Bool, offsets: LayerOffsets, manager: LayerManager) {
        super.init(withLayer: withLayer, isPreview: isPreview, offsets: offsets, manager: manager)

        // We start with a full opacity
        self.opacity = 1
Severity: Major
Found in Aerial/Source/Views/Layers/MessageLayer.swift and 7 other locations - About 45 mins to fix
Aerial/Source/Views/Layers/BatteryIconLayer.swift on lines 32..37
Aerial/Source/Views/Layers/ClockLayer.swift on lines 26..31
Aerial/Source/Views/Layers/CountdownLayer.swift on lines 26..31
Aerial/Source/Views/Layers/DateLayer.swift on lines 26..31
Aerial/Source/Views/Layers/DownloadIndicatorLayer.swift on lines 26..31
Aerial/Source/Views/Layers/Music/MusicLayer.swift on lines 33..37
Aerial/Source/Views/Layers/TimerLayer.swift on lines 28..33

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 55.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    override init(withLayer: CALayer, isPreview: Bool, offsets: LayerOffsets, manager: LayerManager) {
        super.init(withLayer: withLayer, isPreview: isPreview, offsets: offsets, manager: manager)

        // We start with a full opacity
        self.opacity = 1
Severity: Major
Found in Aerial/Source/Views/Layers/DownloadIndicatorLayer.swift and 7 other locations - About 45 mins to fix
Aerial/Source/Views/Layers/BatteryIconLayer.swift on lines 32..37
Aerial/Source/Views/Layers/ClockLayer.swift on lines 26..31
Aerial/Source/Views/Layers/CountdownLayer.swift on lines 26..31
Aerial/Source/Views/Layers/DateLayer.swift on lines 26..31
Aerial/Source/Views/Layers/MessageLayer.swift on lines 26..31
Aerial/Source/Views/Layers/Music/MusicLayer.swift on lines 33..37
Aerial/Source/Views/Layers/TimerLayer.swift on lines 28..33

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 55.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    override init(withLayer: CALayer, isPreview: Bool, offsets: LayerOffsets, manager: LayerManager) {
        super.init(withLayer: withLayer, isPreview: isPreview, offsets: offsets, manager: manager)

        // Always on layers should start with full opacity
        self.opacity = 1
Severity: Major
Found in Aerial/Source/Views/Layers/ClockLayer.swift and 7 other locations - About 45 mins to fix
Aerial/Source/Views/Layers/BatteryIconLayer.swift on lines 32..37
Aerial/Source/Views/Layers/CountdownLayer.swift on lines 26..31
Aerial/Source/Views/Layers/DateLayer.swift on lines 26..31
Aerial/Source/Views/Layers/DownloadIndicatorLayer.swift on lines 26..31
Aerial/Source/Views/Layers/MessageLayer.swift on lines 26..31
Aerial/Source/Views/Layers/Music/MusicLayer.swift on lines 33..37
Aerial/Source/Views/Layers/TimerLayer.swift on lines 28..33

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 55.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

                        for video in VideoList.instance.videos.filter({ $0.source.name == source.name && !$0.isAvailableOffline }) {
                            VideoManager.sharedInstance.queueDownload(video)
                        }
Severity: Minor
Found in Aerial/Source/Views/Sources/ActionCellView.swift and 1 other location - About 45 mins to fix
Aerial/Source/Views/Sources/ActionCellView.swift on lines 35..37

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 55.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

        if let val = SourceInfo.mergeInfo[asset.id] {
            url1080pHEVC = val["url-1080-SDR"]!
            url1080pHDR = val["url-1080-HDR"]!
            url4KHEVC = val["url-4K-SDR"]!
            url4KHDR = val["url-4K-HDR"]!
Severity: Minor
Found in Aerial/Source/Models/Sources/Source.swift and 1 other location - About 45 mins to fix
Aerial/Source/Models/Sources/Source.swift on lines 239..244

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 55.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

                    for video in VideoList.instance.videos.filter({ $0.source.name == source.name && !$0.isAvailableOffline }) {
                        VideoManager.sharedInstance.queueDownload(video)
                    }
Severity: Minor
Found in Aerial/Source/Views/Sources/ActionCellView.swift and 1 other location - About 45 mins to fix
Aerial/Source/Views/Sources/ActionCellView.swift on lines 26..28

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 55.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language