adboco/Unsplasher-SDK

View on GitHub

Showing 70 of 70 total issues

Function request has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    func request<T: Codable>(url: String, method: HTTPMethod = .get, parameters: Parameters = [:], encoding: URLEncoding = .queryString, includeHeaders: Bool = true, expectedType: T.Type, completion: @escaping (Result<T>) -> Void) {
        guard self.applicationID != nil, self.secret != nil else {
            completion(.failure(UnsplashError.credentialsError))
            return
        }
Severity: Minor
Found in Unsplasher/Unsplash/Requests/Requests.swift - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

    public func statistics(username: String, resolution: Unsplash.StatisticsResolution? = nil, quantity: UInt32 = 30, completion: @escaping (StatisticsResult) -> Void) {
        var parameters: Parameters = [:]
        if let resolution = resolution {
            parameters["resolution"] = resolution
        }
Severity: Major
Found in Unsplasher/Unsplash/Requests/UserRequests.swift and 1 other location - About 2 hrs to fix
Unsplasher/Unsplash/Requests/PhotoRequests.swift on lines 224..236

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

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

    public func statistics(photoId: String, resolution: Unsplash.StatisticsResolution? = nil, quantity: UInt32 = 30, completion: @escaping (StatisticsResult) -> Void) {
        var parameters: Parameters = [:]
        if let resolution = resolution {
            parameters["resolution"] = resolution
        }
Severity: Major
Found in Unsplasher/Unsplash/Requests/PhotoRequests.swift and 1 other location - About 2 hrs to fix
Unsplasher/Unsplash/Requests/UserRequests.swift on lines 66..78

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

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

    public func remove(photoId: String, from collectionId: UInt32, completion: @escaping (CollectionPhotoResult) -> Void) {
        let requiredScope: Unsplash.PermissionScope = .writeCollections
        guard self.manager.scopes.contains(requiredScope) else {
            completion(.failure(UnsplashError.scopeRequiredError(requiredScope)))
            return
Severity: Major
Found in Unsplasher/Unsplash/Requests/CollectionRequests.swift and 1 other location - About 2 hrs to fix
Unsplasher/Unsplash/Requests/CollectionRequests.swift on lines 156..165

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

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

    public func add(photoId: String, to collectionId: UInt32, completion: @escaping (CollectionPhotoResult) -> Void) {
        let requiredScope: Unsplash.PermissionScope = .writeCollections
        guard self.manager.scopes.contains(requiredScope) else {
            completion(.failure(UnsplashError.scopeRequiredError(requiredScope)))
            return
Severity: Major
Found in Unsplasher/Unsplash/Requests/CollectionRequests.swift and 1 other location - About 2 hrs to fix
Unsplasher/Unsplash/Requests/CollectionRequests.swift on lines 173..182

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

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

    public func like(id: String, completion: @escaping (LikeResult) -> Void) {
        let requiredScope: Unsplash.PermissionScope = .writeLikes
        guard self.manager.scopes.contains(requiredScope) else {
            completion(.failure(UnsplashError.scopeRequiredError(requiredScope)))
            return
Severity: Major
Found in Unsplasher/Unsplash/Requests/PhotoRequests.swift and 1 other location - About 1 hr to fix
Unsplasher/Unsplash/Requests/PhotoRequests.swift on lines 113..121

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

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

    public func unlike(id: String, completion: @escaping (LikeResult) -> Void) {
        let requiredScope: Unsplash.PermissionScope = .writeLikes
        guard self.manager.scopes.contains(requiredScope) else {
            completion(.failure(UnsplashError.scopeRequiredError(requiredScope)))
            return
Severity: Major
Found in Unsplasher/Unsplash/Requests/PhotoRequests.swift and 1 other location - About 1 hr to fix
Unsplasher/Unsplash/Requests/PhotoRequests.swift on lines 98..106

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

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

Function viewDidLoad has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    override func viewDidLoad() {
        super.viewDidLoad()
        setupView()
        
        // get photos closure
Severity: Minor
Found in Example/ViewController.swift - About 1 hr to fix

    Function loadView has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        override func loadView() {
            super.loadView()
            
            imageView.heroID = imageHeroID
            imageView.image = preloadedImage
    Severity: Minor
    Found in Example/PhotoViewController.swift - About 1 hr to fix

      Function request has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          func request<T: Codable>(url: String, method: HTTPMethod = .get, parameters: Parameters = [:], encoding: URLEncoding = .queryString, includeHeaders: Bool = true, expectedType: T.Type, completion: @escaping (Result<T>) -> Void) {
              guard self.applicationID != nil, self.secret != nil else {
                  completion(.failure(UnsplashError.credentialsError))
                  return
              }
      Severity: Minor
      Found in Unsplasher/Unsplash/Requests/Requests.swift - About 1 hr to fix

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

            func next<T: Codable>(_ type: T.Type, completion: @escaping (Result<T>) -> Void) {
                guard let url = pagination.next?.absoluteString else {
                    completion(.failure(UnsplashError.noPaginationError("No next page available.")))
                    return
                }
        Severity: Major
        Found in Unsplasher/Unsplash/Requests/Requests.swift and 3 other locations - About 1 hr to fix
        Unsplasher/Unsplash/Requests/Requests.swift on lines 227..233
        Unsplasher/Unsplash/Requests/Requests.swift on lines 238..244
        Unsplasher/Unsplash/Requests/Requests.swift on lines 260..266

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

        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 prev<T: Codable>(_ type: T.Type, completion: @escaping (Result<T>) -> Void) {
                guard let url = pagination.prev?.absoluteString else {
                    completion(.failure(UnsplashError.noPaginationError("No previous page available.")))
                    return
                }
        Severity: Major
        Found in Unsplasher/Unsplash/Requests/Requests.swift and 3 other locations - About 1 hr to fix
        Unsplasher/Unsplash/Requests/Requests.swift on lines 227..233
        Unsplasher/Unsplash/Requests/Requests.swift on lines 238..244
        Unsplasher/Unsplash/Requests/Requests.swift on lines 249..255

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

        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 first<T: Codable>(_ type: T.Type, completion: @escaping (Result<T>) -> Void) {
                guard let url = pagination.first?.absoluteString else {
                    completion(.failure(UnsplashError.noPaginationError("No first page available.")))
                    return
                }
        Severity: Major
        Found in Unsplasher/Unsplash/Requests/Requests.swift and 3 other locations - About 1 hr to fix
        Unsplasher/Unsplash/Requests/Requests.swift on lines 238..244
        Unsplasher/Unsplash/Requests/Requests.swift on lines 249..255
        Unsplasher/Unsplash/Requests/Requests.swift on lines 260..266

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

        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 last<T: Codable>(_ type: T.Type, completion: @escaping (Result<T>) -> Void) {
                guard let url = pagination.last?.absoluteString else {
                    completion(.failure(UnsplashError.noPaginationError("No last page available.")))
                    return
                }
        Severity: Major
        Found in Unsplasher/Unsplash/Requests/Requests.swift and 3 other locations - About 1 hr to fix
        Unsplasher/Unsplash/Requests/Requests.swift on lines 227..233
        Unsplasher/Unsplash/Requests/Requests.swift on lines 249..255
        Unsplasher/Unsplash/Requests/Requests.swift on lines 260..266

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

        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 testAddPhotoToCollection() {
                let expectation = self.expectation(description: "Add Photo to Collection")
                
                let photoId = "dtCTfjTEOgg"
                let id: UInt32 = 4378364
        Severity: Major
        Found in UnsplasherTests/Requests/CollectionRequestsTests.swift and 1 other location - About 1 hr to fix
        UnsplasherTests/Requests/CollectionRequestsTests.swift on lines 113..125

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

        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 testRemovePhotoFromCollection() {
                let expectation = self.expectation(description: "Remove Photo from Collection")
                
                let photoId = "dtCTfjTEOgg"
                let id: UInt32 = 4378364
        Severity: Major
        Found in UnsplasherTests/Requests/CollectionRequestsTests.swift and 1 other location - About 1 hr to fix
        UnsplasherTests/Requests/CollectionRequestsTests.swift on lines 99..111

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

        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

            func testGetRelatedCollections() {
                let expectation = self.expectation(description: "Related Collections")
                
                let id: UInt32 = 206
                
        Severity: Major
        Found in UnsplasherTests/Requests/CollectionRequestsTests.swift and 2 other locations - About 1 hr to fix
        UnsplasherTests/Requests/CollectionRequestsTests.swift on lines 39..50
        UnsplasherTests/Requests/CollectionRequestsTests.swift on lines 52..63

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

        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

            func testGetCollectionPhotos() {
                let expectation = self.expectation(description: "Collection Photos")
                
                let id: UInt32 = 206
                
        Severity: Major
        Found in UnsplasherTests/Requests/CollectionRequestsTests.swift and 2 other locations - About 1 hr to fix
        UnsplasherTests/Requests/CollectionRequestsTests.swift on lines 39..50
        UnsplasherTests/Requests/CollectionRequestsTests.swift on lines 65..76

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

        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

            func testGetCollectionById() {
                let expectation = self.expectation(description: "Collection")
                
                let id: UInt32 = 206
                
        Severity: Major
        Found in UnsplasherTests/Requests/CollectionRequestsTests.swift and 2 other locations - About 1 hr to fix
        UnsplasherTests/Requests/CollectionRequestsTests.swift on lines 52..63
        UnsplasherTests/Requests/CollectionRequestsTests.swift on lines 65..76

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

        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

        Function update has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public func update(_ user: User, completion: @escaping (UserResult) -> Void) {
                let requiredScope: Unsplash.PermissionScope = .writeUser
                guard self.manager.scopes.contains(requiredScope) else {
                    completion(.failure(UnsplashError.scopeRequiredError(requiredScope)))
                    return
        Severity: Minor
        Found in Unsplasher/Unsplash/Requests/CurrentUserRequests.swift - About 1 hr to fix
          Severity
          Category
          Status
          Source
          Language