JohnCoates/Aerial

View on GitHub
Aerial/Source/Models/Hardware/DisplayDetection.swift

Summary

Maintainability
F
3 days
Test Coverage

File DisplayDetection.swift has 376 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import Foundation
import Cocoa

class Screen: NSObject {
    var id: CGDirectDisplayID
Severity: Minor
Found in Aerial/Source/Models/Hardware/DisplayDetection.swift - About 5 hrs to fix

    DisplayDetection has 22 methods (exceeds 20 allowed). Consider refactoring.
    Open

    final class DisplayDetection: NSObject {
        static let sharedInstance = DisplayDetection()
    
        var screens = [Screen]()
        var unusedScreens = [Screen]()
    Severity: Minor
    Found in Aerial/Source/Models/Hardware/DisplayDetection.swift - About 2 hrs to fix

      Function isScreenActive has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          func isScreenActive(id: CGDirectDisplayID) -> Bool {
              let screen = findScreenWith(id: id)
              debugLog("ISA : \(screen)")
              
              switch PrefsDisplays.displayMode {
      Severity: Minor
      Found in Aerial/Source/Models/Hardware/DisplayDetection.swift - About 2 hrs 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 getZeroedActiveSpannedRect has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          func getZeroedActiveSpannedRect() -> CGRect {
              if PrefsDisplays.displayMarginsAdvanced && !advancedMargins.displays.isEmpty, let advz = advancedZeroedScreenRect {
                  // Now this is awkward... we precalculated this at detectdisplays->advancedZeroedOrigins
                  return advz
              } else {
      Severity: Minor
      Found in Aerial/Source/Models/Hardware/DisplayDetection.swift - About 2 hrs 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 getGlobalScreenRect has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          func getGlobalScreenRect() -> CGRect {
              if PrefsDisplays.displayMarginsAdvanced && !advancedMargins.displays.isEmpty, let adv = advancedScreenRect {
                  // Now this is awkward... we precalculated this at detectdisplays->advancedZeroedOrigins
                  return adv
              } else {
      Severity: Minor
      Found in Aerial/Source/Models/Hardware/DisplayDetection.swift - About 2 hrs 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 detectDisplays has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          func detectDisplays() {
              // Display detection is done in two passes :
              // - Through CGDisplay, we grab all online screens (connected, but
              //   may or may not be powered on !) and get most information needed
              // - Through NSScreen to get the backingScaleFactor (retinaness of a screen)
      Severity: Minor
      Found in Aerial/Source/Models/Hardware/DisplayDetection.swift - About 1 hr to fix

        Function detectDisplays has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            func detectDisplays() {
                // Display detection is done in two passes :
                // - Through CGDisplay, we grab all online screens (connected, but
                //   may or may not be powered on !) and get most information needed
                // - Through NSScreen to get the backingScaleFactor (retinaness of a screen)
        Severity: Minor
        Found in Aerial/Source/Models/Hardware/DisplayDetection.swift - About 1 hr 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 isScreenActive has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            func isScreenActive(id: CGDirectDisplayID) -> Bool {
                let screen = findScreenWith(id: id)
                debugLog("ISA : \(screen)")
                
                switch PrefsDisplays.displayMode {
        Severity: Minor
        Found in Aerial/Source/Models/Hardware/DisplayDetection.swift - About 1 hr to fix

          Function getMarginsJSON has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              func getMarginsJSON() -> String {
                  var adv: AdvancedMargin
          
                  if !advancedMargins.displays.isEmpty {
                      // If we have something already in preferences, return that
          Severity: Minor
          Found in Aerial/Source/Models/Hardware/DisplayDetection.swift - About 1 hr to fix

            Function getIntermediateAdvancedScreenRect has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                func getIntermediateAdvancedScreenRect() -> CGRect {
                    // At this point, this is non zeroed
                    var minX: CGFloat = 0.0, minY: CGFloat = 0.0, maxX: CGFloat = 0.0, maxY: CGFloat = 0.0
                    for screen in screens {
                        if screen.zeroedOrigin.x < minX {
            Severity: Minor
            Found in Aerial/Source/Models/Hardware/DisplayDetection.swift - About 55 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

            Avoid too many return statements within this function.
            Open

                        return false
            Severity: Major
            Found in Aerial/Source/Models/Hardware/DisplayDetection.swift - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                              return true
              Severity: Major
              Found in Aerial/Source/Models/Hardware/DisplayDetection.swift - About 30 mins to fix

                Function detectBorders has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    func detectBorders(forScreen: Screen) -> (CGFloat, CGFloat) {
                        var leftScreens: CGFloat = 0
                        var belowScreens: CGFloat = 0
                
                        for screen in screens where screen != forScreen {
                Severity: Minor
                Found in Aerial/Source/Models/Hardware/DisplayDetection.swift - About 25 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 getMarginsJSON has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    func getMarginsJSON() -> String {
                        var adv: AdvancedMargin
                
                        if !advancedMargins.displays.isEmpty {
                            // If we have something already in preferences, return that
                Severity: Minor
                Found in Aerial/Source/Models/Hardware/DisplayDetection.swift - About 25 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

                Force casts should be avoided
                Open

                            let screenID = screen.deviceDescription[NSDeviceDescriptionKey("NSScreenNumber")] as! CGDirectDisplayID

                forced-type-cast

                Avoid using the forced form of the type cast operator (as!) because Swift is not able to determine at compile time if the type conversion will succeed. In the event of an unsuccessful conversion, a runtime error will be triggered. The conditional form of the type cast operator (as?) is safer and should be used when possible.

                Preferred

                if let movie = item as? Movie {
                    print("Movie: '\(movie.name)', dir. \(movie.director)")
                }

                Not Preferred

                let movie = item as! Movie
                print("Movie: '\(movie.name)', dir. \(movie.director)")

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

                            for screen in screens where isScreenActive(id: screen.id) {
                                if screen.bottomLeftFrame.origin.x < minX {
                                    minX = screen.bottomLeftFrame.origin.x
                                }
                                if screen.bottomLeftFrame.origin.y < minY {
                Severity: Major
                Found in Aerial/Source/Models/Hardware/DisplayDetection.swift and 1 other location - About 1 hr to fix
                Aerial/Source/Models/Hardware/DisplayDetection.swift on lines 285..298

                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 111.

                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 screen in screens {
                                if screen.bottomLeftFrame.origin.x < minX {
                                    minX = screen.bottomLeftFrame.origin.x
                                }
                                if screen.bottomLeftFrame.origin.y < minY {
                Severity: Major
                Found in Aerial/Source/Models/Hardware/DisplayDetection.swift and 1 other location - About 1 hr to fix
                Aerial/Source/Models/Hardware/DisplayDetection.swift on lines 331..344

                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 111.

                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 screen.bottomLeftFrame.origin.x < forScreen.bottomLeftFrame.origin.x &&
                                screen.bottomLeftFrame.origin.x + CGFloat(screen.width) <=
                                forScreen.bottomLeftFrame.origin.x {
                                leftScreens += 1
                            }
                Severity: Minor
                Found in Aerial/Source/Models/Hardware/DisplayDetection.swift and 1 other location - About 55 mins to fix
                Aerial/Source/Models/Hardware/DisplayDetection.swift on lines 215..219

                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 65.

                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 screen.bottomLeftFrame.origin.y < forScreen.bottomLeftFrame.origin.y &&
                                screen.bottomLeftFrame.origin.y + CGFloat(screen.height) <=
                                forScreen.bottomLeftFrame.origin.y {
                                belowScreens += 1
                            }
                Severity: Minor
                Found in Aerial/Source/Models/Hardware/DisplayDetection.swift and 1 other location - About 55 mins to fix
                Aerial/Source/Models/Hardware/DisplayDetection.swift on lines 210..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 65.

                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 (screen.zeroedOrigin.x + CGFloat(screen.width)) > maxX {
                                maxX = screen.zeroedOrigin.x + CGFloat(screen.width)
                            }
                Severity: Minor
                Found in Aerial/Source/Models/Hardware/DisplayDetection.swift and 1 other location - About 45 mins to fix
                Aerial/Source/Models/Hardware/DisplayDetection.swift on lines 317..319

                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 2 locations. Consider refactoring.
                Open

                            if (screen.zeroedOrigin.y + CGFloat(screen.height)) > maxY {
                                maxY = screen.zeroedOrigin.y + CGFloat(screen.height)
                            }
                Severity: Minor
                Found in Aerial/Source/Models/Hardware/DisplayDetection.swift and 1 other location - About 45 mins to fix
                Aerial/Source/Models/Hardware/DisplayDetection.swift on lines 314..316

                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 3 locations. Consider refactoring.
                Open

                            var minX: CGFloat = 0.0, minY: CGFloat = 0.0, maxX: CGFloat = 0.0, maxY: CGFloat = 0.0
                Severity: Minor
                Found in Aerial/Source/Models/Hardware/DisplayDetection.swift and 2 other locations - About 35 mins to fix
                Aerial/Source/Models/Hardware/DisplayDetection.swift on lines 284..284
                Aerial/Source/Models/Hardware/DisplayDetection.swift on lines 306..306

                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 46.

                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 3 locations. Consider refactoring.
                Open

                            var minX: CGFloat = 0.0, minY: CGFloat = 0.0, maxX: CGFloat = 0.0, maxY: CGFloat = 0.0
                Severity: Minor
                Found in Aerial/Source/Models/Hardware/DisplayDetection.swift and 2 other locations - About 35 mins to fix
                Aerial/Source/Models/Hardware/DisplayDetection.swift on lines 306..306
                Aerial/Source/Models/Hardware/DisplayDetection.swift on lines 330..330

                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 46.

                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 3 locations. Consider refactoring.
                Open

                        var minX: CGFloat = 0.0, minY: CGFloat = 0.0, maxX: CGFloat = 0.0, maxY: CGFloat = 0.0
                Severity: Minor
                Found in Aerial/Source/Models/Hardware/DisplayDetection.swift and 2 other locations - About 35 mins to fix
                Aerial/Source/Models/Hardware/DisplayDetection.swift on lines 284..284
                Aerial/Source/Models/Hardware/DisplayDetection.swift on lines 330..330

                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 46.

                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

                    func findScreenWith(id: CGDirectDisplayID) -> Screen? {
                        for screen in screens where screen.id == id {
                            return screen
                        }
                
                
                Severity: Minor
                Found in Aerial/Source/Models/Hardware/DisplayDetection.swift and 1 other location - About 35 mins to fix
                Aerial/Source/Models/CustomVideoFolders+helpers.swift on lines 32..38

                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 44.

                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

                Line should not have any trailing whitespace
                Open

                    

                trailing-whitespace

                Flag whitespace after the last non-whitespace character on each line until the newline.

                Preferred

                let number = 42¬

                Not Preferred

                let number = 42••¬

                Line should not have any trailing whitespace
                Open

                        

                trailing-whitespace

                Flag whitespace after the last non-whitespace character on each line until the newline.

                Preferred

                let number = 42¬

                Not Preferred

                let number = 42••¬

                Line should not have any trailing whitespace
                Open

                    

                trailing-whitespace

                Flag whitespace after the last non-whitespace character on each line until the newline.

                Preferred

                let number = 42¬

                Not Preferred

                let number = 42••¬

                Line should not have any trailing whitespace
                Open

                        

                trailing-whitespace

                Flag whitespace after the last non-whitespace character on each line until the newline.

                Preferred

                let number = 42¬

                Not Preferred

                let number = 42••¬

                Line should not have any trailing whitespace
                Open

                        

                trailing-whitespace

                Flag whitespace after the last non-whitespace character on each line until the newline.

                Preferred

                let number = 42¬

                Not Preferred

                let number = 42••¬

                Line should not have any trailing whitespace
                Open

                        

                trailing-whitespace

                Flag whitespace after the last non-whitespace character on each line until the newline.

                Preferred

                let number = 42¬

                Not Preferred

                let number = 42••¬

                Line should not have any trailing whitespace
                Open

                    

                trailing-whitespace

                Flag whitespace after the last non-whitespace character on each line until the newline.

                Preferred

                let number = 42¬

                Not Preferred

                let number = 42••¬

                There are no issues that match your filters.

                Category
                Status