java/gust/backend/model/ObjectModelDeserializer.kt
Method build
has a Cognitive Complexity of 277 (exceeds 50 allowed). Consider refactoring. Open
Open
/**
* Load a raw set of mapped data, from underlying storage, into a message builder so that it may be constructed into
* a concrete Protobuf representation.
*
* @param builder
- Read upRead up
- Create a ticketCreate a ticket
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 deeply nested control flow statements. Open
Open
if (dataValue is Map<*, *>) {
// prepare the sub-builder, then attach to the top-level field
this.build(subBuilder, dataValue as Map<String, Any>)
builder.setField(field, subBuilder.build())
} else {
- Create a ticketCreate a ticket
TODO found Open
Open
TODO("recursive inflation of references not yet supported")
- Create a ticketCreate a ticket
- Exclude checks