Showing 70 of 260 total issues
Function multiPartUpload
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public func multiPartUpload(from localURL: URL,
storeOptions: StorageOptions = StorageOptions(location: .s3, access: .private),
useIntelligentIngestionIfAvailable: Bool = true,
queue: DispatchQueue = .main,
startUploadImmediately: Bool = true,
Function stubMultipartCompleteRequest
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
func stubMultipartCompleteRequest(requestTime: TimeInterval = 0,
responseTime: TimeInterval = 0,
workflows: [String]? = nil,
uploadTags: [String: String]? = nil) {
let uploadMultipartCompleteStubConditions = isScheme(Constants.uploadURL.scheme!) &&
- Read upRead up
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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
func upload(data: Data,
to url: URL,
method: String,
headers: [String: String]? = nil,
uploadProgress: ((Progress) -> Void)? = nil,
Function buildURL
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
func buildURL(handle: String? = nil,
path: String? = nil,
extra: String? = nil,
queryItems: [URLQueryItem]? = nil,
security: Security? = nil) -> URL? {
- Read upRead up
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 doRun
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
func doRun() -> Result? {
stopWatch.signalStart()
for attempt in 1...attempts {
guard !shouldCancel else { break }
- Read upRead up
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 uploadMultipleURLs
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
@objc public func uploadMultipleURLs(using localURLs: [NSURL],
options: UploadOptions = .defaults,
queue: DispatchQueue = .main,
uploadProgress: ((Progress) -> Void)? = nil,
completionHandler: @escaping ([JSONResponse]) -> Void) -> Uploader {
Function uploadData
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
@objc public func uploadData(using data: NSData,
options: UploadOptions = .defaults,
queue: DispatchQueue = .main,
uploadProgress: ((Progress) -> Void)? = nil,
completionHandler: @escaping (JSONResponse) -> Void) -> Uploader {
Function uploadURL
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
@objc public func uploadURL(using localURL: NSURL,
options: UploadOptions = .defaults,
queue: DispatchQueue = .main,
uploadProgress: ((Progress) -> Void)? = nil,
completionHandler: @escaping (JSONResponse) -> Void) -> Uploader {
Function upload
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
func upload(using uploadable: Uploadable,
options: UploadOptions = .defaults,
queue: DispatchQueue = .main,
uploadProgress: ((Progress) -> Void)? = nil,
completionHandler: @escaping (JSONResponse) -> Void) -> Uploader {
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 {
Function overwrite
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
@objc func overwrite(parameters: [String: Any]? = nil,
fileURL: URL,
queue: DispatchQueue? = .main,
uploadProgress: ((Progress) -> Void)? = nil,
completionHandler: @escaping (DataResponse) -> Void) {
Function buildURL
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
func buildURL(handle: String? = nil,
path: String? = nil,
extra: String? = nil,
queryItems: [URLQueryItem]? = nil,
security: Security? = nil) -> URL? {
Function upload
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
func upload(using uploadables: [Uploadable]? = nil,
options: UploadOptions = .defaults,
queue: DispatchQueue = .main,
uploadProgress: ((Progress) -> Void)? = nil,
completionHandler: @escaping ([JSONResponse]) -> Void) -> Uploader & DeferredAdd {
Function download
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
@objc func download(destinationURL: URL,
parameters: [String: Any]? = nil,
queue: DispatchQueue? = .main,
downloadProgress: ((Progress) -> Void)? = nil,
completionHandler: @escaping (DownloadResponse) -> Void) {
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)))
- Read upRead up
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
- Read upRead up
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(),
]
- Read upRead up
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
- Read upRead up
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)))
- Read upRead up
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?
- Read upRead up
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"