lib/services/atomic-read-file.js
Function decode
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports.decode = (buffer, offset) => {
let len = 0;
let result;
let decodedValue;
let isStream = true;
Function decode
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports.decode = (buffer, offset) => {
let len = 0;
let result;
let decodedValue;
let isStream = true;
- 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 decodeAcknowledge
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports.decodeAcknowledge = (buffer, offset) => {
let len = 0;
let result;
let decodedValue;
let isStream;
Function decodeAcknowledge
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports.decodeAcknowledge = (buffer, offset) => {
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
Avoid too many return
statements within this function. Open
Open
return {
len: len,
isStream: isStream,
objectId: objectId,
position: position,
Avoid too many return
statements within this function. Open
Open
return;
Avoid too many return
statements within this function. Open
Open
return;
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
if (!baAsn1.decodeIsClosingTagNumber(buffer, offset + len, 1)) return;
Avoid too many return
statements within this function. Open
Open
return {
len: len,
endOfFile: endOfFile,
isStream: isStream,
position: position,
Avoid too many return
statements within this function. Open
Open
if (result.tagNumber !== baEnum.ApplicationTags.SIGNED_INTEGER) return;
Parsing error: Invalid ecmaVersion. Open
Open
'use strict';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/