lib/services/get-enrollment-summary.js
Function decode
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports.decode = (buffer, offset, apduLen) => {
let len = 0;
let result;
let decodedValue;
const value = {};
Function decodeAcknowledge
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports.decodeAcknowledge = (buffer, offset, apduLen) => {
let len = 0;
let result;
const enrollmentSummaries = [];
while ((apduLen - len) > 0) {
Function decodeAcknowledge
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports.decodeAcknowledge = (buffer, offset, apduLen) => {
let len = 0;
let result;
const enrollmentSummaries = [];
while ((apduLen - len) > 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 encode
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports.encode = (buffer, acknowledgmentFilter, enrollmentFilter, eventStateFilter, eventTypeFilter, priorityFilter, notificationClassFilter) => {
baAsn1.encodeContextEnumerated(buffer, 0, acknowledgmentFilter);
if (enrollmentFilter) {
baAsn1.encodeOpeningTag(buffer, 1);
baAsn1.encodeOpeningTag(buffer, 0);
Function decode
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports.decode = (buffer, offset, apduLen) => {
let len = 0;
let result;
let decodedValue;
const value = {};
- 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
Avoid too many return
statements within this function. Open
Open
if (result.tagNumber !== baEnum.ApplicationTags.UNSIGNED_INTEGER) return;
Avoid too many return
statements within this function. Open
Open
return {
enrollmentSummaries: enrollmentSummaries,
len: len
};
Parsing error: Invalid ecmaVersion. Open
Open
'use strict';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/