Kinvey/swift-sdk

View on GitHub
Kinvey/Kinvey/DeviceInfo.swift

Summary

Maintainability
A
1 hr
Test Coverage

Function platformVersion has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    static func platformVersion(identifier: String = DeviceInfo.systemInfoMachine) -> String {
        switch identifier {
        case "iPod5,1": return "iPod Touch 5"
        case "iPod7,1": return "iPod Touch 6"
        case "iPhone3,1", "iPhone3,2", "iPhone3,3": return "iPhone 4"
Severity: Minor
Found in Kinvey/Kinvey/DeviceInfo.swift - About 1 hr to fix

    Line should not have any trailing whitespace
    Open

        
    Severity: Minor
    Found in Kinvey/Kinvey/DeviceInfo.swift by tailor

    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

            
    Severity: Minor
    Found in Kinvey/Kinvey/DeviceInfo.swift by tailor

    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

        
    Severity: Minor
    Found in Kinvey/Kinvey/DeviceInfo.swift by tailor

    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

        
    Severity: Minor
    Found in Kinvey/Kinvey/DeviceInfo.swift by tailor

    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

        
    Severity: Minor
    Found in Kinvey/Kinvey/DeviceInfo.swift by tailor

    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

        
    Severity: Minor
    Found in Kinvey/Kinvey/DeviceInfo.swift by tailor

    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

        
    Severity: Minor
    Found in Kinvey/Kinvey/DeviceInfo.swift by tailor

    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••¬

    Function should have at least one blank line after it
    Open

        }
    Severity: Minor
    Found in Kinvey/Kinvey/DeviceInfo.swift by tailor

    function-whitespace

    Every function and method declaration should have one blank line before and after itself. An exception to this rule are functions that are declared at the start of a file (only need one blank line after their declaration) or at the end of a file (only need one blank line before their declaration). Comments immediately before a function declaration (no blank lines between them and the function) are considered to be part of the declaration.

    Preferred

    func function1() {
      var text = 1
      var text = 2
    }
    
    function1()
    
    // a comment
    func function2() {
      // something goes here
    }
    
    struct SomeStruct {
    
      func function3() {
        // something goes here
      }
    
      func function4() {
        // something else goes here
      };
    
    }
    
    func function5() {
      // something goes here
    }

    Not Preferred

    func function1() {
      var text = 1
      var text = 2
    }
    function1()
    // a comment
    func function2() {
      // something goes here
    }
    
    struct SomeStruct {
      func function3() {
        // something goes here
      }
    
      func function4() {
        // something else goes here
      };
    }
    func function5() {
      // something goes here
    }

    Function should have at least one blank line before it
    Open

        static func platformVersion(identifier: String = DeviceInfo.systemInfoMachine) -> String {
    Severity: Minor
    Found in Kinvey/Kinvey/DeviceInfo.swift by tailor

    function-whitespace

    Every function and method declaration should have one blank line before and after itself. An exception to this rule are functions that are declared at the start of a file (only need one blank line after their declaration) or at the end of a file (only need one blank line before their declaration). Comments immediately before a function declaration (no blank lines between them and the function) are considered to be part of the declaration.

    Preferred

    func function1() {
      var text = 1
      var text = 2
    }
    
    function1()
    
    // a comment
    func function2() {
      // something goes here
    }
    
    struct SomeStruct {
    
      func function3() {
        // something goes here
      }
    
      func function4() {
        // something else goes here
      };
    
    }
    
    func function5() {
      // something goes here
    }

    Not Preferred

    func function1() {
      var text = 1
      var text = 2
    }
    function1()
    // a comment
    func function2() {
      // something goes here
    }
    
    struct SomeStruct {
      func function3() {
        // something goes here
      }
    
      func function4() {
        // something else goes here
      };
    }
    func function5() {
      // something goes here
    }

    Line should not have any trailing whitespace
    Open

        
    Severity: Minor
    Found in Kinvey/Kinvey/DeviceInfo.swift by tailor

    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

        
    Severity: Minor
    Found in Kinvey/Kinvey/DeviceInfo.swift by tailor

    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

        
    Severity: Minor
    Found in Kinvey/Kinvey/DeviceInfo.swift by tailor

    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

        
    Severity: Minor
    Found in Kinvey/Kinvey/DeviceInfo.swift by tailor

    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

        
    Severity: Minor
    Found in Kinvey/Kinvey/DeviceInfo.swift by tailor

    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

        
    Severity: Minor
    Found in Kinvey/Kinvey/DeviceInfo.swift by tailor

    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

        
    Severity: Minor
    Found in Kinvey/Kinvey/DeviceInfo.swift by tailor

    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

        
    Severity: Minor
    Found in Kinvey/Kinvey/DeviceInfo.swift by tailor

    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

        
    Severity: Minor
    Found in Kinvey/Kinvey/DeviceInfo.swift by tailor

    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

            
    Severity: Minor
    Found in Kinvey/Kinvey/DeviceInfo.swift by tailor

    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

            
    Severity: Minor
    Found in Kinvey/Kinvey/DeviceInfo.swift by tailor

    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

        
    Severity: Minor
    Found in Kinvey/Kinvey/DeviceInfo.swift by tailor

    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