filestack/filestack-swift

View on GitHub

Showing 260 of 260 total issues

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

    @objc public func uploadMultipleData(using multipleData: [NSData],
                                         options: UploadOptions = .defaults,
                                         queue: DispatchQueue = .main,
                                         uploadProgress: ((Progress) -> Void)? = nil,
                                         completionHandler: @escaping ([JSONResponse]) -> Void) -> Uploader {
Severity: Minor
Found in Sources/FilestackSDK/Public/Extensions/Client+ObjC.swift - About 35 mins to fix

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

        @discardableResult
        @objc
        @available(*, deprecated, message: "Marked for removal in version 3.0. Please use upload(using:options:queue:uploadProgress:completionHandler:) instead")
        public func multiFileUpload(from localURLs: [URL],
                                    storeOptions: StorageOptions = StorageOptions(location: .s3, access: .private),
    Severity: Minor
    Found in Sources/FilestackSDK/Public/Extensions/Client+Deprecated.swift and 1 other location - About 35 mins to fix
    Sources/FilestackSDK/Public/Extensions/Client+Deprecated.swift on lines 15..35

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

    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

            let task = CDNService.shared.session.dataTask(with: request) { (data, response, error) in
                progressObservers.removeAll()
                queue?.async {
                    completionHandler(DataResponse(request: request, response: response, data: data, error: error))
                }
    Severity: Minor
    Found in Sources/FilestackSDK/Public/Models/FileLink.swift and 1 other location - About 35 mins to fix
    Sources/FilestackSDK/Public/Models/FileLink.swift on lines 275..280

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

    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

            let task = APIService.shared.session.uploadTask(with: request, fromFile: fileURL) { (data, response, error) in
                progressObservers.removeAll()
                queue?.async {
                    completionHandler(DataResponse(request: request, response: response, data: data, error: error))
                }
    Severity: Minor
    Found in Sources/FilestackSDK/Public/Models/FileLink.swift and 1 other location - About 35 mins to fix
    Sources/FilestackSDK/Public/Models/FileLink.swift on lines 69..74

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

    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

        @discardableResult
        @objc
        @available(*, deprecated, message: "Marked for removal in version 3.0. Please use upload(using:options:queue:uploadProgress:completionHandler:) instead")
        public func multiPartUpload(from localURL: URL,
                                    storeOptions: StorageOptions = StorageOptions(location: .s3, access: .private),
    Severity: Minor
    Found in Sources/FilestackSDK/Public/Extensions/Client+Deprecated.swift and 1 other location - About 35 mins to fix
    Sources/FilestackSDK/Public/Extensions/Client+Deprecated.swift on lines 38..58

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

    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 uploadDataChunk has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        func uploadDataChunk(using response: JSONResponse) {
            guard !isCancelled else { return }
    
            if let apiErrorDescription = error(from: response) {
                finish(with: .failure(.api(apiErrorDescription)))

    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

    Function upload has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        func upload() {
            let uploadURL = URL(string: "multipart/commit", relativeTo: Constants.uploadURL)!
    
            retrier = .init(attempts: Defaults.maxRetries, label: uploadURL.relativePath) { (semaphore) -> HTTPURLResponse? in
                var httpURLResponse: HTTPURLResponse?
    Severity: Minor
    Found in Sources/FilestackSDK/Internal/Operations/CommitPartUploadOperation.swift - About 35 mins 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

    Function uploadDataChunk has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        func uploadDataChunk(using response: JSONResponse) {
            guard !isCancelled else { return }
    
            if let apiErrorDescription = error(from: response) {
                finish(with: .failure(.api(apiErrorDescription)))

    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

    Function toDictionary has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        func toDictionary() -> [String: Any] {
            var dict = [String: Any]()
    
            dict["expiry"] = expiry.timeIntervalSince1970
    
    
    Severity: Minor
    Found in Sources/FilestackSDK/Public/Models/Policy.swift - About 35 mins 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

    Function upload has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        func upload() {
            let uploadURL = URL(string: "multipart/complete", relativeTo: Constants.uploadURL)!
            let headers = ["Content-Type": "application/json"]
    
            retrier = .init(attempts: Defaults.maxRetries, label: uploadURL.relativePath) { (semaphore) -> JSONResponse? in
    Severity: Minor
    Found in Sources/FilestackSDK/Internal/Operations/CompleteUploadOperation.swift - About 35 mins 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

    Function asDictionary has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public func asDictionary() -> [String: Any] {
            var options: [String: Any] = [
                "location": location.description.lowercased(),
            ]
    
    
    Severity: Minor
    Found in Sources/FilestackSDK/Public/Extensions/StorageOptions+asDictionary.swift - About 35 mins 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

            let expectedURL = Constants.cdnURL.appendingPathComponent("minify_js=booleans:true,builtIns:false," +
                "consecutiveAdds:true,deadcode:false,evaluate:true,flipComparisons:false,guards:true,infinity:false," +
                "mangle:true,memberExpressions:false,mergeVars:true,numericLiterals:false,propertyLiterals:true," +
                "regexpConstructors:false,removeConsole:true,removeDebugger:false,removeUndefined:true,simplify:false," +
                "simplifyComparisons:true,typeConstructors:false,undefinedToVoid:true")
    Severity: Minor
    Found in Tests/FilestackSDKTests/TransformableTests.swift and 1 other location - About 35 mins to fix
    Tests/FilestackSDKTests/TransformableTests.swift on lines 1067..1075

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

    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

            let expectedURL = Constants.cdnURL
                .appendingPathComponent(
                    "video_convert=preset:m4a,force:false,title:Chapter 1," +
                        "extname:m4a,filename:chapter_1,location:S3,path:/myfiles/chapter_1.m4a," +
                        "access:public,container:user-audios," +
    Severity: Minor
    Found in Tests/FilestackSDKTests/TransformableTests.swift and 1 other location - About 35 mins to fix
    Tests/FilestackSDKTests/TransformableTests.swift on lines 1602..1607

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

    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 operation = WorkOperation<Bool>() { work in
                Thread.sleep(forTimeInterval: 5)
                work.finish(with: .success(true))
            }
    Severity: Minor
    Found in Tests/FilestackSDKTests/BaseOperationTests.swift and 2 other locations - About 35 mins to fix
    Tests/FilestackSDKTests/BaseOperationTests.swift on lines 77..80
    Tests/FilestackSDKTests/BaseOperationTests.swift on lines 175..178

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

    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 operation = WorkOperation<Bool>() { work in
                Thread.sleep(forTimeInterval: 2)
                work.finish(with: .success(true))
            }
    Severity: Minor
    Found in Tests/FilestackSDKTests/BaseOperationTests.swift and 2 other locations - About 35 mins to fix
    Tests/FilestackSDKTests/BaseOperationTests.swift on lines 134..137
    Tests/FilestackSDKTests/BaseOperationTests.swift on lines 175..178

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

    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 operation = WorkOperation<Bool>() { work in
                Thread.sleep(forTimeInterval: 1)
                work.finish(with: .success(true))
            }
    Severity: Minor
    Found in Tests/FilestackSDKTests/BaseOperationTests.swift and 2 other locations - About 35 mins to fix
    Tests/FilestackSDKTests/BaseOperationTests.swift on lines 77..80
    Tests/FilestackSDKTests/BaseOperationTests.swift on lines 134..137

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

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

            let queryItems = (requestURL.query?.split { $0 == "?" || $0 ==  "&" })?.sorted()
    Severity: Major
    Found in Tests/FilestackSDKTests/FileLinkTests.swift and 3 other locations - About 35 mins to fix
    Tests/FilestackSDKTests/FileLinkTests.swift on lines 153..153
    Tests/FilestackSDKTests/FileLinkTests.swift on lines 180..180
    Tests/FilestackSDKTests/FileLinkTests.swift on lines 299..299

    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

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

            let queryItems = (requestURL.query?.split { $0 == "?" || $0 ==  "&" })?.sorted()
    Severity: Major
    Found in Tests/FilestackSDKTests/FileLinkTests.swift and 3 other locations - About 35 mins to fix
    Tests/FilestackSDKTests/FileLinkTests.swift on lines 153..153
    Tests/FilestackSDKTests/FileLinkTests.swift on lines 299..299
    Tests/FilestackSDKTests/FileLinkTests.swift on lines 363..363

    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

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

            let queryItems = (requestURL.query?.split { $0 == "?" || $0 ==  "&" })?.sorted()
    Severity: Major
    Found in Tests/FilestackSDKTests/FileLinkTests.swift and 3 other locations - About 35 mins to fix
    Tests/FilestackSDKTests/FileLinkTests.swift on lines 180..180
    Tests/FilestackSDKTests/FileLinkTests.swift on lines 299..299
    Tests/FilestackSDKTests/FileLinkTests.swift on lines 363..363

    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

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

            let queryItems = (requestURL.query?.split { $0 == "?" || $0 ==  "&" })?.sorted()
    Severity: Major
    Found in Tests/FilestackSDKTests/FileLinkTests.swift and 3 other locations - About 35 mins to fix
    Tests/FilestackSDKTests/FileLinkTests.swift on lines 153..153
    Tests/FilestackSDKTests/FileLinkTests.swift on lines 180..180
    Tests/FilestackSDKTests/FileLinkTests.swift on lines 363..363

    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

    Severity
    Category
    Status
    Source
    Language