Showing 212 of 557 total issues
Function mergeType
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
const mergeType = function(info, type) {
if (type.base) {
const baseType = typeById [type.base];
if (baseType) {
mergeType(info, baseType);
Function generateDLxDownloadDownloadResponse
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function generateDLxDownloadDownloadResponse(rawQuery) {
const query = {
source: rawQuery.source,
outputType: rawQuery.outputType,
dataLanguage: rawQuery.dataLanguage || 'en',
Function getRawValue
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
getRawValue(packetField, buffer, start, end) {
if (start === undefined) {
start = 0;
}
if (end === undefined) {
- 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 getBlockTypeFieldsForSections
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
getBlockTypeFieldsForSections(sections) {
const _this = this;
const sectionByBlockTypeId = sections.reduce((memo, section) => {
memo [section.sectionId] = section;
- 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 normalizeDatecode
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
normalizeDatecode(input) {
let output;
if (input == null) {
output = null;
} else if (typeof input === 'number') {
- 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 setRawValue
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
setRawValue(packetField, rawValue, buffer, start, end) {
if (start === undefined) {
start = 0;
}
if (end === undefined) {
- 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 runSingleShot
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const runSingleShot = async (argv) => {
const context = {};
try {
if (argv.q) {
- 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 updateAsync
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function updateAsync(options) {
const {
width,
height,
backgroundImageUrl,
Function formatTextValueFromRawValueInternal
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
formatTextValueFromRawValueInternal(rawValue, unit, rootType, precision, defaultUnit) {
const unitText = unit ? unit.unitText : defaultUnit ? defaultUnit.unitText : '';
let result, textValue, format;
if ((rawValue === undefined) || (rawValue === null)) {
Function getValueById
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
getValueById(address, valueId, options) {
const _this = this;
options = applyDefaultOptions({}, options, {
timeout: 500,
- 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 getPacketSpecification
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
getPacketSpecification(headerOrChannel, destinationAddress, sourceAddress, command) {
if (typeof headerOrChannel === 'object') {
({ command, sourceAddress, destinationAddress } = headerOrChannel);
headerOrChannel = headerOrChannel.channel;
} else if (typeof headerOrChannel === 'string') {
- 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 storeSpecificationData
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
static storeSpecificationData(options) {
if (options === undefined) {
options = {};
}
if (options instanceof 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 _processHeaderSet
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
_processHeaderSet(now) {
let include = true;
if (this.minTimestamp) {
if (now < this.minTimestamp) {
- 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 generateEmSimulatorSensorResponse
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function generateEmSimulatorSensorResponse(requestParams, requestBody) {
let { subAddress, sensorNr, sensorType } = requestParams;
if (isNumberString(subAddress)) {
subAddress = +subAddress;
Function convertMenuXmlFile
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
const convertMenuXmlFile = async function(inputFilename, outputFilename, convert) {
inputFilename = path.resolve(__dirname, 'rpt-files', inputFilename);
outputFilename = path.resolve(__dirname, '../../src/configuration-optimizers', outputFilename);
console.log(outputFilename);
Function _filterProperties
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
_filterProperties(parent, iterator) {
const _this = this;
const originalStack = _.clone(this.stack);
Function _processRecordForTopologyScan
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
_processRecordForTopologyScan(buffer) {
const type = buffer [1] & 0x0F;
let destinationAddress = 0, sourceAddress = 0, protocolVersion = 0, command = 0, hasHeader = false;
if (((type === 3) || (type === 6)) && (buffer.length >= 20)) {
Function _convertVolumeFlowRawValue
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
_convertVolumeFlowRawValue(rawValue, sourceUnitCode, targetUnitCode) {
switch (sourceUnitCode) {
case 'LitersPerHour':
// nop
break;
Function onHeaderSet
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onHeaderSet = async (headerSet) => {
const headers = headerSet.getSortedHeaders();
const packetFields = specification.getPacketFieldsForHeaders(headers);
const valuesById = packetFields.reduce((memo, pf) => {
Function _optimizeConfiguration
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
_optimizeConfiguration(config, adjustableValues) {
const configValueById = config.reduce((memo, configValue) => {
memo [configValue.valueId] = configValue;
return memo;
}, {});