Showing 279 of 850 total issues
Function get
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public func get<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, Q: QueryParams, O: Codable>(
_ route: String,
handler: @escaping (T1, T2, Q, @escaping CodableResultClosure<O>) -> Void
) {
registerGetRoute(route: route, queryParams: Q.self, optionalQParam: false, outputType: O.self)
- 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 post
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public func post<T: TypeSafeMiddleware, I: Codable, O: Codable>(
_ route: String,
handler: @escaping (T, I, @escaping CodableResultClosure<O>) -> Void
) {
registerPostRoute(route: route, inputType: I.self, outputType: O.self)
- 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 parse
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
fileprivate static func parse(headers: HeadersContainer) -> [String: HTTPCookie] {
var cookies = [String: HTTPCookie]()
guard let cookieHeaders = headers["cookie"] else {
return cookies
}
- 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 delete
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public func delete<T: TypeSafeMiddleware, Q: QueryParams>(
_ route: String,
handler: @escaping (T, Q, @escaping ResultClosure) -> Void
) {
registerDeleteRoute(route: route, queryParams: Q.self, optionalQParam: false)
- 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 post
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public func post<T1: TypeSafeMiddleware, T2: TypeSafeMiddleware, T3: TypeSafeMiddleware, I: Codable, Id: Identifier, O: Codable>(
_ route: String,
handler: @escaping (T1, T2, T3, I, @escaping IdentifierCodableResultClosure<Id, O>) -> Void
) {
registerPostRoute(route: route, id: Id.self, inputType: I.self, outputType: O.self)
- 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
Avoid too many return
statements within this function. Open
return XCTFail()
Avoid too many return
statements within this function. Open
return router
Avoid too many return
statements within this function. Open
return
Avoid too many return
statements within this function. Open
return (bestMediaType, bestEncoder())
Avoid too many return
statements within this function. Open
return
Avoid too many return
statements within this function. Open
return false
Avoid too many return
statements within this function. Open
return originalRepositoryPath + separator + path
Avoid too many return
statements within this function. Open
return server?.unixDomainSocketPath
Avoid too many return
statements within this function. Open
return server.unixDomainSocketPath
Avoid too many return
statements within this function. Open
return false
Avoid too many return
statements within this function. Open
return nil
Avoid too many return
statements within this function. Open
return combined
Avoid too many return
statements within this function. Open
return RawBodyParser()
Avoid too many return
statements within this function. Open
return ""
Function testRouteFunc
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
func testRouteFunc() {
performServerTest(router, asyncTasks: { expectation in
self.performRequest("get", path: "/route", callback: {response in
XCTAssertNotNil(response, "ERROR!!! ClientRequest response object was nil")
XCTAssertEqual(response?.statusCode, HTTPStatusCode.OK, "HTTP Status code was \(String(describing: response?.statusCode))")
- 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"