Showing 212 of 557 total issues
Function runSingleShot
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
const runSingleShot = async (argv) => {
const context = {};
try {
if (argv.q) {
Function transceiveConfiguration
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
async transceiveConfiguration(options, optimizerCallback) {
if (typeof options === 'function') {
optimizerCallback = options;
options = null;
}
Function _processRecord
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
_processRecord(buffer) {
const type = buffer [1] & 0x0F;
const timestamp = moreints.readUInt64LE(buffer, 6);
if (type === 3) {
- 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 getDeviceSpecification
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
getDeviceSpecification(selfAddress, peerAddress, channel) {
if (typeof selfAddress === 'object') {
if (peerAddress === 'source') {
({ channel } = selfAddress);
peerAddress = selfAddress.destinationAddress;
- 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 transceiveConfiguration
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
async transceiveConfiguration(options, optimizerCallback) {
if (typeof options === 'function') {
optimizerCallback = options;
options = null;
}
- 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
File connection-customizer.js
has 305 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*! resol-vbus | Copyright (c) 2013-present, Daniel Wippermann | MIT license */
const {
applyDefaultOptions,
isNumber,
Function transceive
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
async transceive(txData, options) {
options = applyDefaultOptions({}, options, {
timeout: 500,
timeoutIncr: 0,
tries: 1,
Function main
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
async function main(options) {
const { signal, onListen, onRunning } = (options || {});
logger.debug('Starting server...');
- 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 main
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
async function main(args) {
let inputRscFilename = null;
let inputImageFilename = null;
let outputJsFilename = null;
- 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
File tcp-connection.js
has 300 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*! resol-vbus | Copyright (c) 2013-present, Daniel Wippermann | MIT license */
const net = require('net');
const tls = require('tls');
Function startMqttLogging
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
const startMqttLogging = async () => {
const onHeaderSet = async (headerSet, client) => {
const headers = headerSet.getSortedHeaders();
const packetFields = specification.getPacketFieldsForHeaders(headers);
Function _convertEnergyRawValue
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
_convertEnergyRawValue(rawValue, sourceUnitCode, targetUnitCode) {
switch (sourceUnitCode) {
case 'WattHours':
// nop
break;
Function startMqttLogging
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
const startMqttLogging = async () => {
const onHeaderSet = async (headerSet, client) => {
const headers = headerSet.getSortedHeaders();
const packetFields = specification.getPacketFieldsForHeaders(headers);
- 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 main
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
async function main(argv, options) {
const args = new ArgParser(argv);
function usage(message) {
args.printUsage(message, [
- 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 _createUInt32BlockTypeFieldSpecification
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
_createUInt32BlockTypeFieldSpecification(fieldIdPrefix, offset, name, typeId, factor) {
return {
fieldId: sprintf('%s_%03d_4_0', fieldIdPrefix, offset),
name,
type: this.getTypeById(typeId),
Function getPacketFieldsForHeaders
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
getPacketFieldsForHeaders(headers) {
const _this = this;
// filter out all packets
const packets = headers.reduce((memo, header) => {
Function discover
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function discover() {
const interfaceMap = os.networkInterfaces();
const interfaceNames = Object.getOwnPropertyNames(interfaceMap);
Function convertRawValue
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
convertRawValue(rawValue_, sourceUnit_, targetUnit_) {
const that = this;
let conversions;
if (Array.isArray(sourceUnit_)) {
Function discover
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
async function discover() {
const interfaceMap = os.networkInterfaces();
const interfaceNames = Object.getOwnPropertyNames(interfaceMap);
- 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 mergeTypes
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
const mergeTypes = function(menuSystem) {
const typeById = _.reduce(menuSystem.types, (memo, type) => {
memo [type.id] = type;
return memo;
}, {});