Showing 123 of 181 total issues
Function request
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
async function request(url, requestObject, onFail) {
if (requestObject.body) {
requestObject.body = JSON.stringify(requestObject.body);
if (!requestObject.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 runTestFactory
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const runTestFactory = (classInstance) => {
const toJSON = (data) => ({
type: getRequestType(data, false),
request: compose(
msg => applyUntilCondition(msg, data),
- 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 unusedExpressionWatchersFactory
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const unusedExpressionWatchersFactory = ({logger}) => {
/**
* Pool of chains, that were not awaited for
* @type {Set<any>}
*/
- 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 pairDevice
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async function pairDevice(
{webSockets, authContext, logger, pairedDeviceContext, config},
deviceId,
recordingSettings
) {
- 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 validateRepoProps
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const validateRepoProps = ({props, data, text}) => {
const selector = path(['selector'], data) || {};
if (has('apiId', selector)) {
return props;
- 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 getDeviceName
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function getDeviceName(deviceInfo, short = false) {
const {manufacturer, model, customName, deviceId} = deviceInfo;
let name;
- 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
return;
Avoid too many return
statements within this function. Open
return fs.promises
.access(dir)
.catch(() => fs.promises.mkdir(dir))
.then(() => fs.promises.writeFile(data.fileName, res.buffer))
.catch(e => {
Avoid too many return
statements within this function. Open
return 'dismissAlertMessage';
Avoid too many return
statements within this function. Open
return subtype === 'time'
? `Timer '${val1}' already exists`
: `Timer '${val1}' does not exist`;
Avoid too many return
statements within this function. Open
return res.buffer;
Avoid too many return
statements within this function. Open
return 'acceptAlertMessage';
Avoid too many return
statements within this function. Open
return `${val1}: ${val2}`;
Avoid too many return
statements within this function. Open
return res.buffer.toString('base64');
Avoid too many return
statements within this function. Open
return val1.join('\n');
Avoid too many return
statements within this function. Open
return 'acceptPromptMessage';
Avoid too many return
statements within this function. Open
return val1;
Avoid too many return
statements within this function. Open
return `${val1}: ${val2}ms`;
Avoid too many return
statements within this function. Open
return `Count for '${val1}' does not exist`;
Avoid too many return
statements within this function. Open
return;