Kinvey/swift-sdk

View on GitHub
Kinvey/Kinvey/HttpRequestFactory.swift

Summary

Maintainability
F
5 days
Test Coverage

File HttpRequestFactory.swift has 854 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import Foundation

struct HttpRequestFactory: RequestFactory {
    
    let client: Client
Severity: Major
Found in Kinvey/Kinvey/HttpRequestFactory.swift - About 2 days to fix

    Function buildAppDataGroup has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            collectionName: String,
            keys: [String],
            initialObject: [String : Any],
            reduceJSFunction: String,
            condition: NSPredicate?,
    Severity: Major
    Found in Kinvey/Kinvey/HttpRequestFactory.swift - About 50 mins to fix

      Function buildUserSignUp has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              username: String? = nil,
              password: String? = nil,
              user: User? = nil,
              options: Options?,
              resultType: Result.Type
      Severity: Minor
      Found in Kinvey/Kinvey/HttpRequestFactory.swift - About 35 mins to fix

        Function buildLiveStreamUnsubscribe has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                streamName: String,
                userId: String,
                deviceId: String,
                options: Options?,
                resultType: Result.Type
        Severity: Minor
        Found in Kinvey/Kinvey/HttpRequestFactory.swift - About 35 mins to fix

          Function buildOAuthGrantAuthenticate has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  redirectURI: URL,
                  tempLoginUri: URL,
                  username: String,
                  password: String,
                  options: Options?
          Severity: Minor
          Found in Kinvey/Kinvey/HttpRequestFactory.swift - About 35 mins to fix

            Function buildLiveStreamSubscribe has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    streamName: String,
                    userId: String,
                    deviceId: String,
                    options: Options?,
                    resultType: Result.Type
            Severity: Minor
            Found in Kinvey/Kinvey/HttpRequestFactory.swift - About 35 mins to fix

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

                  func buildLiveStreamAccess<Result>(
                      streamName: String,
                      userId: String,
                      options: Options?,
                      resultType: Result.Type
              Severity: Major
              Found in Kinvey/Kinvey/HttpRequestFactory.swift and 1 other location - About 1 hr to fix
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 513..527

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

              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 buildAppDataRemoveById<Result>(
                      collectionName: String,
                      objectId: String,
                      options: Options?,
                      resultType: Result.Type
              Severity: Major
              Found in Kinvey/Kinvey/HttpRequestFactory.swift and 1 other location - About 1 hr to fix
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 811..825

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

              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 buildLiveStreamUnsubscribe<Result>(
                      streamName: String,
                      userId: String,
                      deviceId: String,
                      options: Options?,
              Severity: Major
              Found in Kinvey/Kinvey/HttpRequestFactory.swift and 1 other location - About 1 hr to fix
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 842..856

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

              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 buildLiveStreamSubscribe<Result>(
                      streamName: String,
                      userId: String,
                      deviceId: String,
                      options: Options?,
              Severity: Major
              Found in Kinvey/Kinvey/HttpRequestFactory.swift and 1 other location - About 1 hr to fix
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 858..872

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

              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 buildUserResetPassword<Result>(
                      usernameOrEmail: String,
                      options: Options?,
                      resultType: Result.Type
                  ) -> HttpRequest<Result> {
              Severity: Major
              Found in Kinvey/Kinvey/HttpRequestFactory.swift and 1 other location - About 1 hr to fix
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 260..273

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

              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 buildSendEmailConfirmation<Result>(
                      forUsername username: String,
                      options: Options?,
                      resultType: Result.Type
                  ) -> HttpRequest<Result> {
              Severity: Major
              Found in Kinvey/Kinvey/HttpRequestFactory.swift and 1 other location - About 1 hr to fix
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 293..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 105.

              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 buildUserFind<Result>(
                      query: Query,
                      options: Options?,
                      resultType: Result.Type
                  ) -> HttpRequest<Result> {
              Severity: Major
              Found in Kinvey/Kinvey/HttpRequestFactory.swift and 1 other location - About 1 hr to fix
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 209..221

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

              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 buildUserGet<Result>(
                      userId: String,
                      options: Options?,
                      resultType: Result.Type
                  ) -> HttpRequest<Result> {
              Severity: Major
              Found in Kinvey/Kinvey/HttpRequestFactory.swift and 1 other location - About 1 hr to fix
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 223..235

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

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

                  func buildUserUnregisterRealtime<Result>(
                      user: User,
                      deviceId: String,
                      options: Options?,
                      resultType: Result.Type
              Severity: Major
              Found in Kinvey/Kinvey/HttpRequestFactory.swift and 3 other locations - About 1 hr to fix
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 874..887
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 889..902
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 904..917

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

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

                  func buildUserRegisterRealtime<Result>(
                      user: User,
                      deviceId: String,
                      options: Options?,
                      resultType: Result.Type
              Severity: Major
              Found in Kinvey/Kinvey/HttpRequestFactory.swift and 3 other locations - About 1 hr to fix
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 874..887
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 889..902
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 919..932

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

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

                  func buildAppDataSubscribe<Result>(
                      collectionName: String,
                      deviceId: String,
                      options: Options?,
                      resultType: Result.Type
              Severity: Major
              Found in Kinvey/Kinvey/HttpRequestFactory.swift and 3 other locations - About 1 hr to fix
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 889..902
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 904..917
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 919..932

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

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

                  func buildAppDataUnSubscribe<Result>(
                      collectionName: String,
                      deviceId: String,
                      options: Options?,
                      resultType: Result.Type
              Severity: Major
              Found in Kinvey/Kinvey/HttpRequestFactory.swift and 3 other locations - About 1 hr to fix
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 874..887
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 904..917
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 919..932

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

              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

                  func buildAppDataGroup<Result>(
                      collectionName: String,
                      keys: [String],
                      initialObject: [String : Any],
                      reduceJSFunction: String,
              Severity: Major
              Found in Kinvey/Kinvey/HttpRequestFactory.swift and 1 other location - About 1 hr to fix
              Kinvey/Kinvey/RequestFactory.swift on lines 1..351

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

              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 buildPushRegisterDevice(_ deviceToken: Data, options: Options?) -> HttpRequest<Any> {
                      let client = options?.client ?? self.client
                      return buildPushDevice(
                          deviceToken,
                          options: options,
              Severity: Major
              Found in Kinvey/Kinvey/HttpRequestFactory.swift and 1 other location - About 1 hr to fix
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 566..574

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

              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 buildPushUnRegisterDevice(_ deviceToken: Data, options: Options?) -> HttpRequest<Any> {
                      let client = options?.client ?? self.client
                      return buildPushDevice(
                          deviceToken,
                          options: options,
              Severity: Major
              Found in Kinvey/Kinvey/HttpRequestFactory.swift and 1 other location - About 1 hr to fix
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 556..564

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

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

                  func buildAppDataGetById<Result>(
                      collectionName: String,
                      id: String,
                      options: Options?,
                      resultType: Result.Type
              Severity: Minor
              Found in Kinvey/Kinvey/HttpRequestFactory.swift and 1 other location - About 50 mins to fix
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 401..414

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

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

                  func buildAppDataCountByQuery<Result>(
                      collectionName: String,
                      query: Query?,
                      options: Options?,
                      resultType: Result.Type
              Severity: Minor
              Found in Kinvey/Kinvey/HttpRequestFactory.swift and 1 other location - About 50 mins to fix
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 357..370

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

              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

                  func buildOAuthGrantAuthenticate(
                      redirectURI: URL,
                      tempLoginUri: URL,
                      username: String,
                      password: String,
              Severity: Minor
              Found in Kinvey/Kinvey/HttpRequestFactory.swift and 1 other location - About 40 mins to fix
              Kinvey/Kinvey/RequestFactory.swift on lines 1..351

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

              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

                  func buildAppDataFindByQueryDeltaSet(
                      collectionName: String,
                      query: Query,
                      sinceDate: Date,
                      options: Options?
              Severity: Minor
              Found in Kinvey/Kinvey/HttpRequestFactory.swift and 1 other location - About 35 mins to fix
              Kinvey/Kinvey/RequestFactory.swift on lines 1..351

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

              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

                      let request = HttpRequest<Result>(
                          httpMethod: .post,
                          endpoint: AppDataEndpoint.appData(client: client, collectionName: collectionName),
                          credential: client.activeUser,
                          options: options
              Severity: Minor
              Found in Kinvey/Kinvey/HttpRequestFactory.swift and 2 other locations - About 30 mins to fix
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 32..37
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 426..431

              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

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

                      let request = HttpRequest<Result>(
                          httpMethod: .post,
                          endpoint: AppDataEndpoint.appDataGroup(client: client, collectionName: collectionName),
                          credential: client.activeUser,
                          options: options
              Severity: Minor
              Found in Kinvey/Kinvey/HttpRequestFactory.swift and 2 other locations - About 30 mins to fix
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 32..37
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 484..489

              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

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

                      let request = HttpRequest<Result>(
                          httpMethod: .post,
                          endpoint: RpcEndpoint.customEndpooint(client: client, name: name),
                          credential: client.activeUser,
                          options: options
              Severity: Minor
              Found in Kinvey/Kinvey/HttpRequestFactory.swift and 2 other locations - About 30 mins to fix
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 426..431
              Kinvey/Kinvey/HttpRequestFactory.swift on lines 484..489

              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

                  

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

              Colon at column 19 should have no spaces before it
              Open

                          "key" : keys,

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

              Colon at column 26 should have no spaces before it
              Open

                          "grant_type" : "password",

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

              Colon at column 28 should have no spaces before it
              Open

                          "redirect_uri" : redirectURI.absoluteString,

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

              Colon at column 26 should have no spaces before it
              Open

                          "grant_type" : "refresh_token",

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

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

              Colon at column 24 should have no spaces before it
              Open

                          "username" : username,

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

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

              Colon at column 37 should have no spaces before it
              Open

                              authSource.rawValue : authData

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

              Colon at column 35 should have no spaces before it
              Open

                      let bodyObject = ["email" : email]

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

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

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

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

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

              Colon at column 28 should have no spaces before it
              Open

                          "redirect_uri" : redirectURI.absoluteString,

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

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

              Colon at column 27 should have no spaces before it
              Open

                      authData: [String : Any],

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

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

              Colon at column 26 should have no spaces before it
              Open

                          "grant_type" : "authorization_code",

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

              Colon at column 29 should have no spaces before it
              Open

                          "response_type" : "code"

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

              Colon at column 46 should have no spaces before it
              Open

                  private func set(_ params: inout [String : String], clientId: String?, client: Client) {

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

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

              Colon at column 27 should have no spaces before it
              Open

                      var json: [String : Any] = [

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

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

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

                      {

              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

                  

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

              Colon at column 28 should have no spaces before it
              Open

                          "redirect_uri" : redirectURI.absoluteString,

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

              Colon at column 29 should have no spaces before it
              Open

                          "response_type" : "code",

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

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

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

              Colon at column 22 should have no spaces before it
              Open

                          "reduce" : reduceJSFunction

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

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

              Colon at column 27 should have no spaces before it
              Open

                      authData: [String : Any],

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

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

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

              Colon at column 20 should have no spaces before it
              Open

                          "code" : code

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

              Colon at column 24 should have no spaces before it
              Open

                          "password" : password

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

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

              Colon at column 31 should have no spaces before it
              Open

                          "_socialIdentity" : [

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

              Colon at column 24 should have no spaces before it
              Open

                          "password" : password

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

              Colon at column 38 should have no spaces before it
              Open

                      let bodyObject = ["username" : username]

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

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

              Colon at column 32 should have no spaces before it
              Open

                      initialObject: [String : Any],

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

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

              Colon at column 24 should have no spaces before it
              Open

                          "password" : password

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

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

              Colon at column 24 should have no spaces before it
              Open

                          "username" : username,

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

              Colon at column 29 should have no spaces before it
              Open

                          "refresh_token" : refreshToken

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

              Colon at column 27 should have no spaces before it
              Open

                      authData: [String : Any],

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

              Colon at column 24 should have no spaces before it
              Open

                          "deviceId" : deviceId

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

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

              Colon at column 24 should have no spaces before it
              Open

                          "username" : username,

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

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

              Colon at column 25 should have no spaces before it
              Open

                      params: [String : String],

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

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

              Colon at column 23 should have no spaces before it
              Open

                          "initial" : initialObject,

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

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

              Colon at column 24 should have no spaces before it
              Open

                          "platform" : "ios",

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

              Colon at column 24 should have no spaces before it
              Open

                          "deviceId" : deviceToken.hexString()

              colon-whitespace

              There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

              However, for conditional expressions there should be a single whitespace before and after the colon.

              Variable declarations

              Preferred

              var x: Int = 2

              Not Preferred

              var x : Int
              var y:   String

              Dictionary literals and types

              Preferred

              var x = [ 'key1': 1, 'key2': 2 ]
              var y: [ Int: String ]

              Not Preferred

              var x = [ 'key1' : 1, 'key2':  3]
              var y: [ Int :    String ]

              Case statements

              Preferred

              switch character {
              case "a": doSomething(a);
              default: alert();
              }

              Not Preferred

              switch character {
              case "a" : doSomething(a);
              default:     alert();
              }

              Class, Struct, Protocol, and Extension declarations

              Preferred

              class ClassName: BaseClass {
              }
              
              struct StructName: BaseStruct {
              }
              
              protocol ProtocolName: AnotherProtocol {
              }
              
              extension TypeName: ProtocolName {
              }

              Not Preferred

              class ClassName : BaseClass {
              }
              
              struct StructName:  BaseStruct {
              }
              
              protocol ProtocolName:AnotherProtocol {
              }
              
              extension TypeName : ProtocolName {
              }

              Tuple declarations

              Preferred

              var y = (key: 1, value: 2)

              Not Preferred

              var y = (key:1, value : 2)

              Function declarations

              Preferred

              func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
              }</t:>

              Not Preferred

              func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
              }</t>

              Conditional expressions

              Preferred

              var x = condition ? a : b

              Not Preferred

              var x = condition ? a: b
              var x = condition ? a   : b

              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