Showing 742 of 2,674 total issues
Function waitForRestoreToFinish
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
async waitForRestoreToFinish(state) {
try {
const restoreStatus = await state.httpClient.get('/api/v1/gateway/backup/restore/status');
if (restoreStatus.restore_in_progress) {
setTimeout(() => {
Function connectBridge
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
async connectBridge(state, bridge) {
store.setState({
philipsHueCreateDeviceStatus: RequestStatus.Getting
});
try {
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render({}, { numberOfHoursBeforeStateIsOutdated }) {
return (
<div class="card">
<h4 class="card-header">
<Text id="systemSettings.numberOfHoursBeforeStateIsOutdated" />
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render(props, {}) {
let temperature_min = this.props.box.temperature_min;
let temperature_max = this.props.box.temperature_max;
const unit = this.props.user.temperature_unit_preference;
Function newValueDuplexWirelessSwitch
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function newValueDuplexWirelessSwitch(message, data) {
const { sid } = message;
logger.debug(`Xiaomi : New value duplex wireless switch, sid = ${sid}`);
const EXTERNAL_ID_CHANNEL_0_BUTTON = `xiaomi:${sid}:duplex-wireless-switch:channel-0:button`;
const EXTERNAL_ID_CHANNEL_1_BUTTON = `xiaomi:${sid}:duplex-wireless-switch:channel-1:button`;
- 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 scan
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
async function scan() {
if (!this.configured) {
throw new ServiceNotConfiguredError();
} else if (this.scanning) {
logger.warn(`LANManager already scanning for devices...`);
- 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 request
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function request(url, dataCallback, authErrorCallback, errorCallback) {
logger.debug(`Tasmota: HTTP looking for ${url}`);
const req = http.get(url, (res) => {
logger.debug(`Tasmota: HTTP response for ${url}: ${res.statusCode}`);
- 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 installMqttContainer
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
async function installMqttContainer(config) {
let dockerContainers = await this.gladys.system.getContainers({
all: true,
filters: { name: [containerDescriptor.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
Function DIRECTIVE_NAMESPACES.BrightnessController
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
[DIRECTIVE_NAMESPACES.BrightnessController]: (
directiveName,
payload,
currentValue,
binaryCurrentValue,
- 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 onNewCameraFile
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
async function onNewCameraFile(
cameraSelector,
folderPath,
cameraFolder,
filename,
- 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 installZ2mContainer
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
async function installZ2mContainer(config) {
const { z2mDriverPath } = config;
let creationNeeded = false;
let dockerContainers = await this.gladys.system.getContainers({
- 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 poll
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
async function poll(device) {
if (!this.connected) {
await this.connect();
}
- 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 setValue
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
async function setValue(device, deviceFeature, value) {
const externalId = deviceFeature.external_id;
const homeId = device.params.find((oneParam) => oneParam.name === PARAMS.HOME_ID);
const roomId = device.params.find((oneParam) => oneParam.name === PARAMS.ROOM_ID);
if (!homeId || !roomId) {
- 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 pollBinary
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
pollBinary: (eWeLinkDevice, feature) => {
const { deviceId, channel } = parseExternalId(feature.external_id);
let state = (eWeLinkDevice.params && eWeLinkDevice.params.switch) || false;
const switches = (eWeLinkDevice.params && eWeLinkDevice.params.switches) || false;
if (state || switches) {
- 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 scan
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
async function scan(state, peripheralUuid = undefined) {
if (!this.ready) {
throw new Error('Bluetooth is not ready to scan for peripherals, check BLE adapter.');
}
- 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 create
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
async function create(message) {
const gladysGatewayOpenAiEnabledVar = await this.variable.getValue(
SYSTEM_VARIABLE_NAMES.GLADYS_GATEWAY_OPEN_AI_ENABLED,
);
const openAiEnabled = gladysGatewayOpenAiEnabledVar === '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 createActions
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function createActions(store) {
const actionsProfilePicture = createActionsProfilePicture(store);
const actions = {
async login(state, e) {
- 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 actions
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const actions = store => ({
updateCalendarsToSync(state, e) {
store.setState({
calendarsToSync: {
...state.calendarsToSync,
- 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 createActions
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function createActions(store) {
const integrationActions = createActionsIntegration(store);
const actions = {
async getHouses(state) {
store.setState({
- 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 render
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
render(props, {}) {
let messageKey;
let linkUrl = '';
let linkText = '';
if (!props.usbConfigured) {
- 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"