Showing 217 of 365 total issues
Avoid too many return
statements within this function. Open
if (!result) return;
Avoid too many return
statements within this function. Open
if (!decodeIsClosingTagNumber(buffer, offset + len, 5)) return;
Avoid too many return
statements within this function. Open
if (!decodeIsOpeningTagNumber(buffer, offset + len, 1)) return;
Avoid too many return
statements within this function. Open
if ((len + result.value) >= apduLen) return;
Avoid too many return
statements within this function. Open
return {
type: baEnum.ApplicationTags.TIMESTAMP,
value: subEvtResult.value,
len: subEvtResult.len + 2
};
Avoid too many return
statements within this function. Open
if (result.tagNumber !== 2) return;
Avoid too many return
statements within this function. Open
return {
len: len,
value: value
};
Avoid too many return
statements within this function. Open
return {
type: baEnum.ApplicationTags.READ_ACCESS_RESULT,
value: result.value,
len: result.len
};
Avoid too many return
statements within this function. Open
if (!decodeIsClosingTagNumber(buffer, offset + len, 1)) return;
Avoid too many return
statements within this function. Open
return {
len: len,
value: list,
type: baEnum.ApplicationTags.CONTEXT_SPECIFIC_DECODED
};
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
if (result.tagNumber !== 3) return;
Avoid too many return
statements within this function. Open
if (!result) return;
Avoid too many return
statements within this function. Open
return {
type: baEnum.ApplicationTags.OBJECT_PROPERTY_REFERENCE,
value: result.value,
len: result.len
};
Function decode
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
module.exports.decode = (buffer, offset, apduLen) => {
let len = 0;
const value = {};
let result;
let decodedValue;
- 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 decodeBitstring
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const decodeBitstring = module.exports.decodeBitstring = (buffer, offset, lenValue) => {
let len = 0;
const bitString = {};
bitString.value = [];
if (lenValue > 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 decodeDeviceObjPropertyRef
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const decodeDeviceObjPropertyRef = (buffer, offset) => {
let len = 0;
let arrayIndex = baEnum.ASN1_ARRAY_ALL;
if (!decodeIsContextTag(buffer, offset + len, 0)) return;
len++;
- 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"