Showing 6 of 39 total issues
Method parseModule
has a Cognitive Complexity of 76 (exceeds 20 allowed). Consider refactoring. Open
/**
* Parses a [WasmModule] from the receiving [List] of [Token]s.
*
* From [the docs](https://webassembly.github.io/spec/core/text/modules.html#text-module):
*
- 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 ValidationContext
has a Cognitive Complexity of 40 (exceeds 20 allowed). Consider refactoring. Open
/** Given a [WasmModule], creates a new [ValidationContext]. */
fun ValidationContext(module: WasmModule): ValidationContext.Module {
val types = MutableAstNodeIndex<Type>()
val functions = MutableAstNodeIndex<TypeUse>()
val tables = MutableAstNodeIndex<TableType>()
- 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 parseLiteral
has a Cognitive Complexity of 40 (exceeds 20 allowed). Consider refactoring. Open
/** Parses a [Literal] of type [T] from the receiving [List] of [Token]s at the given position. */
@OptIn(ExperimentalUnsignedTypes::class)
fun <T : Any> List<Token>.parseLiteral(
fromIndex: Int,
asClass: KClass<T>
- 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 parseStringChar
has a Cognitive Complexity of 35 (exceeds 20 allowed). Consider refactoring. Open
@OptIn(ExperimentalUnsignedTypes::class)
fun IntArray.parseStringChar(
index: Int,
inoutVal: StringChar = StringChar(),
context: ParseContext? = null
- 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 indexAfterBlockComment
has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring. Open
private fun indexAfterBlockComment(
sequence: CharSequence,
startIndex: Int,
context: ParseContext? = null
): Int {
- 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 parseInstructions
has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring. Open
/**
* Parses a [List] of [Instruction]s from the [Token]s.
*
* Throws [ParseException] if fewer than [min] are found, and returns at most [max].
*/
- 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"