Skip to content

Changed for Swift 3 compliance#50

Open
Qandelor wants to merge 2 commits intoturowicz:masterfrom
Qandelor:Adaptations/Swift3
Open

Changed for Swift 3 compliance#50
Qandelor wants to merge 2 commits intoturowicz:masterfrom
Qandelor:Adaptations/Swift3

Conversation

@Qandelor
Copy link

Have not done a lot of checks but is mostly syntaxic changes.

- returns: The class as an NSDictionary.
*/
public func toDictionary() -> NSDictionary {
open func toDictionary() -> NSDictionary {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cyclomatic Complexity Violation: Function should have complexity 10 or less: currently complexity equals 17 (cyclomatic_complexity)

}
else if let propValue:UInt32 = propValue as? UInt32 {
setValue(propertiesDictionary, value: NSNumber(value: propValue as UInt32), forKey: propName!)
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Statement Position Violation: Else and catch should be on the same line, one space after the previous declaration. (statement_position)

}
else if let propValue:UInt16 = propValue as? UInt16 {
setValue(propertiesDictionary, value: NSNumber(value: propValue as UInt16), forKey: propName!)
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Statement Position Violation: Else and catch should be on the same line, one space after the previous declaration. (statement_position)

}
else if let propValue:UInt8 = propValue as? UInt8 {
setValue(propertiesDictionary, value: NSNumber(value: propValue as UInt8), forKey: propName!)
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Statement Position Violation: Else and catch should be on the same line, one space after the previous declaration. (statement_position)

}
else if let propValue:Int64 = propValue as? Int64 {
setValue(propertiesDictionary, value: NSNumber(value: propValue as Int64), forKey: propName!)
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Statement Position Violation: Else and catch should be on the same line, one space after the previous declaration. (statement_position)

var dictionary = [String: AnyObject]()
open class Serializable: NSObject {
fileprivate class SortedDictionary : NSMutableDictionary {
var _dictionary = [String: AnyObject]()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable Name Violation: Variable name should only contain alphanumeric characters: '_dictionary' (variable_name)

- returns: The class as a JSON string.
*/
public func toJsonString(prettyPrinted: Bool = false) -> String? {
open func toJsonString(_ prettyPrinted : Bool = false) -> String? {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Colon Violation: Colons should be next to the identifier when specifying a type. (colon)

- returns: The class as JSON, wrapped in NSData.
*/
public func toJson(prettyPrinted: Bool = false) -> NSData? {
open func toJson(_ prettyPrinted : Bool = false) -> Data? {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Colon Violation: Colons should be next to the identifier when specifying a type. (colon)

else if let propValue:UInt32 = propValue as? UInt32 {
setValue(propertiesDictionary, value: NSNumber(value: propValue as UInt32), forKey: propName!)
}
else if let propValue:UInt64 = propValue as? UInt64 {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Colon Violation: Colons should be next to the identifier when specifying a type. (colon)

else if let propValue:UInt16 = propValue as? UInt16 {
setValue(propertiesDictionary, value: NSNumber(value: propValue as UInt16), forKey: propName!)
}
else if let propValue:UInt32 = propValue as? UInt32 {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Colon Violation: Colons should be next to the identifier when specifying a type. (colon)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants