Function verify_values
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
verify_values(values, branch) {
const depth = (branch.match(/\//) || []).length;
if (typeof values !== "object") {
this.failure = `value of ${branch} must be an object`;
}
- 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 get_next_address
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
get_next_address(addr, depth) {
let next_addr;
if (addr == null) {
if (this.current_addr == null) {
next_addr = 0;
- 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 verify_values
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
verify_values(values, branch) {
const depth = (branch.match(/\//) || []).length;
if (typeof values !== "object") {
this.failure = `value of ${branch} must be an object`;
}
Function get_next_address
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
get_next_address(addr, depth) {
let next_addr;
if (addr == null) {
if (this.current_addr == null) {
next_addr = 0;
Function verify_item
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
verify_item(item, branch) {
if (typeof item !== "object") {
this.failure = `data item "${item}" in ${branch} must be an object`;
}
else {
- 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 verify_typeset
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
verify_typeset(typeset, branch) {
if (typeof typeset === "object") {
for (let i in typeset) {
const item = typeset[i];
if ((typeof item !== "string")
- 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 verify_dataset
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
verify_dataset(data, branch) {
if (data.length == 0) {
this.failure = `data in ${branch} is empty`;
}
else {
- 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 verify_type
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
verify_type(type, branch) {
const valid_types = ['u8', 'u16', 'u32', 'u64', 'i8', 'i16', 'i32', 'i64', 'bool', 'float', 'double', 'string', 'none'];
if ((typeof type !== "string") && (typeof type !== "object")) {
this.failure = `"${protocolKey.TYPE}" of "${branch}", "${type}" must be a string (or an array if (enum)`;
- 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"