Showing 212 of 557 total issues
Function _generateSpecificationData
has 157 lines of code (exceeds 25 allowed). Consider refactoring. Open
_generateSpecificationData(language) {
const that = this;
let units = {
...this.knownUnitsByCode,
Function main
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function main(options) {
const { signal, onListen, onRunning } = (options || {});
logger.debug('Starting server...');
Function _onConnection
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
_onConnection(socket) {
const _this = this;
const connectionInfo = {
socket,
Function transceiveValue
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
async transceiveValue(valueInfo, value, options, state) {
if (!isObject(valueInfo)) {
valueInfo = {
valueIndex: valueInfo,
};
Function main
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function main(args) {
let inputRscFilename = null;
let inputImageFilename = null;
let outputJsFilename = null;
Function receive
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
receive(timestamp, chunk) {
const _this = this;
if (this.listenerCount('rawData') > 0) {
this.emit('rawData', chunk, timestamp);
Function onData
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onData = function(chunk) {
if (phase < 1000) {
let buffer;
if (rxBuffer) {
buffer = Buffer.concat([ rxBuffer, chunk ]);
Function _generateSpecificationData
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
_generateSpecificationData(language) {
const that = this;
let units = {
...this.knownUnitsByCode,
- 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 _processBuffer
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
_processBuffer(chunk, endOfStream, processRecord) {
let buffer;
if (this.rxBuffer) {
buffer = Buffer.concat([ this.rxBuffer, chunk ]);
} 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 convertRawValue
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
convertRawValue(rawValue_, sourceUnit_, targetUnit_) {
const that = this;
let conversions;
if (Array.isArray(sourceUnit_)) {
- 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 convertHeaderSet
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
convertHeaderSet(headerSet) {
const _this = this;
const spec = this.specification;
- 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 processDownloadDownloadRequest
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
const processDownloadDownloadRequest = async (req, res) => {
try {
const i18n = specification.i18n;
const startDate = req.query.startDate ? i18n.momentUtc(req.query.startDate, 'MM/DD/YYYY') : i18n.momentUtc();
Specification
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
class Specification {
/**
* Creates a new Specification instance and optionally initializes its members with the given values.
*
Function _emitEnd
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
_emitEnd() {
const spec = this.specification;
const allHeaders = this.allHeaderSet.getHeaders();
- 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 onLine
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onLine = function(line) {
let newPhase = -1;
if (line [0] === '+') {
if (phase === 0) {
if (_this.viaTag) {
Function completeConfiguration
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
async completeConfiguration(...configs) {
const _this = this;
const adjustableValues = _this._getAdjustableValues();
Function _processRecord
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
_processRecord(buffer) {
const type = buffer [1] & 0x0F;
const timestamp = moreints.readUInt64LE(buffer, 6);
if (type === 3) {
Function _connect
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
_connect() {
return new Promise((resolve, reject) => {
let cleanup = () => { reject(new Error('Called too soon')); };
const options = {
Function _emitEnd
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
_emitEnd() {
const spec = this.specification;
const allHeaders = this.allHeaderSet.getHeaders();
Function getPacketFieldsForHeaders
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
getPacketFieldsForHeaders(headers) {
const _this = this;
// filter out all packets
const packets = headers.reduce((memo, header) => {
- 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"