Showing 217 of 365 total issues
File service-event-notify-data.spec.js
has 301 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
const utils = require('./utils');
const baServices = require('../../lib/services');
const baEnum = require('../../lib/enum');
Function decode
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.decode = (buffer, offset, apduLen) => {
let len = 0;
let result;
let decodedValue;
if (!baAsn1.decodeIsContextTag(buffer, offset + len, 0)) return;
Function decode
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
module.exports.decode = (buffer, offset, apduLen) => {
let len = 0;
let result;
let decodedValue;
result = baAsn1.decodeTagNumberAndValue(buffer, offset + 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"
Further reading
Function decode
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.decode = (buffer, offset, apduLen) => {
let len = 0;
const value = {};
let result;
let decodedValue;
Function decode
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
module.exports.decode = (buffer, offset, apduLen) => {
let len = 0;
let result;
let decodedValue;
let isStream;
- 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 decodeCovSubscription
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
const decodeCovSubscription = (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 bacappDecodeData
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
const bacappDecodeData = (buffer, offset, maxLength, tagDataType, lenValueType) => {
let result;
const value = {
len: 0,
type: tagDataType
Function decode
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.decode = (buffer, offset, apduLen) => {
let len = 0;
let result;
let decodedValue;
const value = {};
Function decodeAcknowledge
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
module.exports.decodeAcknowledge = (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
Function decode
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.decode = (buffer, offset, apduLen) => {
let len = 0;
let result;
let decodedValue;
result = baAsn1.decodeTagNumberAndValue(buffer, offset + len);
Function decode
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.decode = (buffer, offset, apduLen) => {
let len = 0;
let result;
let decodedValue;
len++;
Function decode
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.decode = (buffer, offset, apduLen) => {
let len = 0;
let result;
let decodedValue;
let isStream;
Function decodeReadAccessSpecification
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
const decodeReadAccessSpecification = module.exports.decodeReadAccessSpecification = (buffer, offset, apduLen) => {
let len = 0;
const value = {};
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"
Further reading
Function decode
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.decode = (buffer, offset, apduLen) => {
let len = 0;
let result;
let decodedValue;
let objectId;
Function decode
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.decode = (buffer, offset) => {
let len = 0;
const value = {};
let result;
let decodedValue;
Function decode
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.decode = (buffer, offset, apduLen) => {
let len = 0;
const value = {
property: {}
};
Function bacappEncodeApplicationData
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const bacappEncodeApplicationData = module.exports.bacappEncodeApplicationData = (buffer, value) => {
if (value.value === null) {
value.type = baEnum.ApplicationTags.NULL;
}
switch (value.type) {
Function decode
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
module.exports.decode = (buffer, offset, apduLen) => {
let len = 0;
const value = {
property: {}
};
- 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 decode
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.decode = (buffer, offset) => {
let len = 0;
let result;
let decodedValue;
let isStream = true;
Function bacappContextTagType
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
const bacappContextTagType = (property, tagNumber) => {
let tag = 0;
switch (property) {
case baEnum.PropertyIdentifier.ACTUAL_SHED_LEVEL:
case baEnum.PropertyIdentifier.REQUESTED_SHED_LEVEL:
- 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"