Showing 5 of 23 total issues
Method query
has a Cognitive Complexity of 50 (exceeds 20 allowed). Consider refactoring. Open
Open
@ExperimentalCoroutinesApi
@RequiresApi(Build.VERSION_CODES.M)
suspend fun query(query: XyoPayload, payloads: List<XyoPayload>?, previousHash: String?): PostQueryResult {
val bodyString = buildQuery(query, payloads, previousHash)
val postBody = bodyString.toRequestBody(MEDIA_TYPE_JSON)
- 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
Method postBoundWitnessesAsync
has a Cognitive Complexity of 49 (exceeds 20 allowed). Consider refactoring. Open
Open
@ExperimentalCoroutinesApi
private suspend fun postBoundWitnessesAsync (
entries: List<XyoBoundWitnessJson>
): PostBoundWitnessesResult {
val bodyString = XyoSerializable.toJson(entries)
- 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
Method postBoundWitnessesAsync
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@ExperimentalCoroutinesApi
private suspend fun postBoundWitnessesAsync (
entries: List<XyoBoundWitnessJson>
): PostBoundWitnessesResult {
val bodyString = XyoSerializable.toJson(entries)
Method query
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@ExperimentalCoroutinesApi
@RequiresApi(Build.VERSION_CODES.M)
suspend fun query(query: XyoPayload, payloads: List<XyoPayload>?, previousHash: String?): PostQueryResult {
val bodyString = buildQuery(query, payloads, previousHash)
val postBody = bodyString.toRequestBody(MEDIA_TYPE_JSON)
Avoid too many return
statements within this method. Open
Open
return EcPointMath.dot(p1, p2, m, this)