Kinvey/swift-sdk

View on GitHub
Kinvey/Kinvey/Endpoint.swift

Summary

Maintainability
A
2 hrs
Test Coverage

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

//
//  Endpoint.swift
//  Kinvey
//
//  Created by Victor Barros on 2016-01-15.
Severity: Minor
Found in Kinvey/Kinvey/Endpoint.swift and 2 other locations - About 35 mins to fix
Kinvey/Kinvey/Endpoint.swift on lines 1..308
Kinvey/Kinvey/Endpoint.swift on lines 1..308

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

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 baseURL(client: Client, user: User) -> URL {
        return baseURL(client: client).appendingPathComponent("/\(user.userId)")
    }
Severity: Minor
Found in Kinvey/Kinvey/Endpoint.swift and 1 other location - About 35 mins to fix
Kinvey/Kinvey/Endpoint.swift on lines 157..159

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

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

    func baseURL(client: Client, collectionName: String) -> URL {
        return baseURL(client: client).appendingPathComponent("/\(collectionName)")
    }
Severity: Minor
Found in Kinvey/Kinvey/Endpoint.swift and 1 other location - About 35 mins to fix
Kinvey/Kinvey/Endpoint.swift on lines 57..59

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

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

            if let ttlInSeconds = ttlInSeconds {
                let ttl = URLQueryItem(name: "ttl_in_seconds", value: String(ttlInSeconds))
                urlQueryItems.append(ttl)
            }
Severity: Minor
Found in Kinvey/Kinvey/Endpoint.swift and 2 other locations - About 30 mins to fix
Kinvey/Kinvey/Query.swift on lines 225..228
Kinvey/Kinvey/Query.swift on lines 230..233

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

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

    
Severity: Minor
Found in Kinvey/Kinvey/Endpoint.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/Endpoint.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/Endpoint.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••¬

If statement should not have any line breaks before the opening brace
Open

        {
Severity: Minor
Found in Kinvey/Kinvey/Endpoint.swift by tailor

brace-style

Definitions of - class - struct - function - Control flow constructs (if, else if, else, switch, for, while, repeat-while) - init - protocol - enum - closure - Getters and Setters (set, get) - extension

should follow the One True Brace Style (1TBS): each construct has its opening brace one the same line along with the same indentation level as its header, the statements within the braces are indented, and the closing brace at the end is on the same indentation level as the header of the function at a line of its own. Braces are not omitted for a control statement with only a single statement in its scope. Every opening brace must also have one space preceding it.

Classes

Preferred

class SomeClass {
}

class SomeClass: SomeSuperClass {
}

Not Preferred

class SomeClass
{
}

class SomeClass: SomeSuperClass{
}

Structs

Preferred

struct SomeStruct {
}

struct SomeStruct : SomeParentStruct {
}

Not Preferred

struct SomeStruct
{
}

struct SomeStruct : SomeParentStruct  {
}

Functions

Preferred

func someMethod() {
}

func someOtherFunction () -> () {
}

Not Preferred

func someMethod()
{
}

func someOtherFunction () -> ()
{
}

Control flow constructs

  • if, else if, and else statement

Preferred

if SomeCondition {

} else if someOtherCondition {
} else {
}

Not Preferred

if SomeCondition
{

}
else if someOtherCondition
{
}
else
{
}
  • switch statement

Preferred

switch SomeData {
    default:
        break
}

Not Preferred

switch SomeData
{
    default:
        break
}
  • for loop

Preferred

for var i = 0; i < 10; i+=1 {

}

Not Preferred

for var i = 0; i < 10; i+=1
{

}
  • while loop

Preferred

while SomeCondition {

}

Not Preferred

while SomeCondition
{

}
  • repeat-while loop

Preferred

repeat {

} while SomeCondition

Not Preferred

repeat
{

} while SomeCondition

Initializers

Preferred

init(someParameter:Double, someOtherParameter:Double) {
   self.someMember = someParameter
   self.someOtherMember = someOtherParameter
}

Not Preferred

init(someParameter:Double, someOtherParameter:Double)
{
   self.someMember = someParameter
   self.someOtherMember = someOtherParameter
}

Protocols

Preferred

protocol SomeProtocol {

}

protocol SomeOtherProtocol : X {

}

Not Preferred

protocol SomeProtocol
{

}

protocol SomeOtherProtocol : X
{
}

Enums

Preferred

enum SomeEnum {
    case A, B, C, D
}

enum SomeEnum {
    case A
    case B
    case C
    case D
}

enum SomeEnum: Int {
    case A, B, C = 5, D
}

Not Preferred

enum SomeEnum
{
    case A, B, C, D
}

enum SomeEnum
{
    case A
    case B
    case C
    case D
}

enum SomeEnum: Int
{
    case A, B, C = 5, D
}

Closures

Preferred

func someFunction () -> () {
// closure
}

Not Preferred

func someFunction () -> ()
{
// closure
}

Setters and Getters

  • set

Preferred

set {
    oldValue = newValue / 2
}

Not Preferred

set
{
    oldValue = newValue / 2
}
  • get

Preferred

get {
    return value * 2
}

Not Preferred

get
{
    return value * 2
}

Extensions

Preferred

extension someExtension {
}

Not Preferred

extension someExtension
{
}

Line should not have any trailing whitespace
Open

    
Severity: Minor
Found in Kinvey/Kinvey/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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••¬

If statement should not have any line breaks before the opening brace
Open

            {
Severity: Minor
Found in Kinvey/Kinvey/Endpoint.swift by tailor

brace-style

Definitions of - class - struct - function - Control flow constructs (if, else if, else, switch, for, while, repeat-while) - init - protocol - enum - closure - Getters and Setters (set, get) - extension

should follow the One True Brace Style (1TBS): each construct has its opening brace one the same line along with the same indentation level as its header, the statements within the braces are indented, and the closing brace at the end is on the same indentation level as the header of the function at a line of its own. Braces are not omitted for a control statement with only a single statement in its scope. Every opening brace must also have one space preceding it.

Classes

Preferred

class SomeClass {
}

class SomeClass: SomeSuperClass {
}

Not Preferred

class SomeClass
{
}

class SomeClass: SomeSuperClass{
}

Structs

Preferred

struct SomeStruct {
}

struct SomeStruct : SomeParentStruct {
}

Not Preferred

struct SomeStruct
{
}

struct SomeStruct : SomeParentStruct  {
}

Functions

Preferred

func someMethod() {
}

func someOtherFunction () -> () {
}

Not Preferred

func someMethod()
{
}

func someOtherFunction () -> ()
{
}

Control flow constructs

  • if, else if, and else statement

Preferred

if SomeCondition {

} else if someOtherCondition {
} else {
}

Not Preferred

if SomeCondition
{

}
else if someOtherCondition
{
}
else
{
}
  • switch statement

Preferred

switch SomeData {
    default:
        break
}

Not Preferred

switch SomeData
{
    default:
        break
}
  • for loop

Preferred

for var i = 0; i < 10; i+=1 {

}

Not Preferred

for var i = 0; i < 10; i+=1
{

}
  • while loop

Preferred

while SomeCondition {

}

Not Preferred

while SomeCondition
{

}
  • repeat-while loop

Preferred

repeat {

} while SomeCondition

Not Preferred

repeat
{

} while SomeCondition

Initializers

Preferred

init(someParameter:Double, someOtherParameter:Double) {
   self.someMember = someParameter
   self.someOtherMember = someOtherParameter
}

Not Preferred

init(someParameter:Double, someOtherParameter:Double)
{
   self.someMember = someParameter
   self.someOtherMember = someOtherParameter
}

Protocols

Preferred

protocol SomeProtocol {

}

protocol SomeOtherProtocol : X {

}

Not Preferred

protocol SomeProtocol
{

}

protocol SomeOtherProtocol : X
{
}

Enums

Preferred

enum SomeEnum {
    case A, B, C, D
}

enum SomeEnum {
    case A
    case B
    case C
    case D
}

enum SomeEnum: Int {
    case A, B, C = 5, D
}

Not Preferred

enum SomeEnum
{
    case A, B, C, D
}

enum SomeEnum
{
    case A
    case B
    case C
    case D
}

enum SomeEnum: Int
{
    case A, B, C = 5, D
}

Closures

Preferred

func someFunction () -> () {
// closure
}

Not Preferred

func someFunction () -> ()
{
// closure
}

Setters and Getters

  • set

Preferred

set {
    oldValue = newValue / 2
}

Not Preferred

set
{
    oldValue = newValue / 2
}
  • get

Preferred

get {
    return value * 2
}

Not Preferred

get
{
    return value * 2
}

Extensions

Preferred

extension someExtension {
}

Not Preferred

extension someExtension
{
}

Line should not have any trailing whitespace
Open

    
Severity: Minor
Found in Kinvey/Kinvey/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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••¬

If statement should not have any line breaks before the opening brace
Open

            {
Severity: Minor
Found in Kinvey/Kinvey/Endpoint.swift by tailor

brace-style

Definitions of - class - struct - function - Control flow constructs (if, else if, else, switch, for, while, repeat-while) - init - protocol - enum - closure - Getters and Setters (set, get) - extension

should follow the One True Brace Style (1TBS): each construct has its opening brace one the same line along with the same indentation level as its header, the statements within the braces are indented, and the closing brace at the end is on the same indentation level as the header of the function at a line of its own. Braces are not omitted for a control statement with only a single statement in its scope. Every opening brace must also have one space preceding it.

Classes

Preferred

class SomeClass {
}

class SomeClass: SomeSuperClass {
}

Not Preferred

class SomeClass
{
}

class SomeClass: SomeSuperClass{
}

Structs

Preferred

struct SomeStruct {
}

struct SomeStruct : SomeParentStruct {
}

Not Preferred

struct SomeStruct
{
}

struct SomeStruct : SomeParentStruct  {
}

Functions

Preferred

func someMethod() {
}

func someOtherFunction () -> () {
}

Not Preferred

func someMethod()
{
}

func someOtherFunction () -> ()
{
}

Control flow constructs

  • if, else if, and else statement

Preferred

if SomeCondition {

} else if someOtherCondition {
} else {
}

Not Preferred

if SomeCondition
{

}
else if someOtherCondition
{
}
else
{
}
  • switch statement

Preferred

switch SomeData {
    default:
        break
}

Not Preferred

switch SomeData
{
    default:
        break
}
  • for loop

Preferred

for var i = 0; i < 10; i+=1 {

}

Not Preferred

for var i = 0; i < 10; i+=1
{

}
  • while loop

Preferred

while SomeCondition {

}

Not Preferred

while SomeCondition
{

}
  • repeat-while loop

Preferred

repeat {

} while SomeCondition

Not Preferred

repeat
{

} while SomeCondition

Initializers

Preferred

init(someParameter:Double, someOtherParameter:Double) {
   self.someMember = someParameter
   self.someOtherMember = someOtherParameter
}

Not Preferred

init(someParameter:Double, someOtherParameter:Double)
{
   self.someMember = someParameter
   self.someOtherMember = someOtherParameter
}

Protocols

Preferred

protocol SomeProtocol {

}

protocol SomeOtherProtocol : X {

}

Not Preferred

protocol SomeProtocol
{

}

protocol SomeOtherProtocol : X
{
}

Enums

Preferred

enum SomeEnum {
    case A, B, C, D
}

enum SomeEnum {
    case A
    case B
    case C
    case D
}

enum SomeEnum: Int {
    case A, B, C = 5, D
}

Not Preferred

enum SomeEnum
{
    case A, B, C, D
}

enum SomeEnum
{
    case A
    case B
    case C
    case D
}

enum SomeEnum: Int
{
    case A, B, C = 5, D
}

Closures

Preferred

func someFunction () -> () {
// closure
}

Not Preferred

func someFunction () -> ()
{
// closure
}

Setters and Getters

  • set

Preferred

set {
    oldValue = newValue / 2
}

Not Preferred

set
{
    oldValue = newValue / 2
}
  • get

Preferred

get {
    return value * 2
}

Not Preferred

get
{
    return value * 2
}

Extensions

Preferred

extension someExtension {
}

Not Preferred

extension someExtension
{
}

Line should not have any trailing whitespace
Open

    
Severity: Minor
Found in Kinvey/Kinvey/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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/Endpoint.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