Showing 754 of 2,690 total issues
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render(props, { userOptions, selectedOption, areaOptions, selectedAreaOption }) {
return (
<div>
<p>
{props.trigger.type === EVENTS.AREA.USER_ENTERED && (
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render(props, { selectedDeviceFeature }) {
let binaryDevice = false;
let presenceDevice = false;
let buttonClickDevice = false;
Function up
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
up: async (queryInterface, Sequelize) => {
await queryInterface.createTable('t_script', {
id: {
allowNull: false,
primaryKey: true,
Function determineTypeAndTraits
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function determineTypeAndTraits(device) {
const featureCategoryTypes = {};
let type;
const traits = [];
let attributes = {};
Function AreaController
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function AreaController(gladys) {
/**
* @api {post} /api/v1/area create
* @apiName create
* @apiGroup Area
Function poll
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function poll(device) {
const externalId = device.external_id;
const [prefix, topic] = device.external_id.split(':');
if (prefix !== 'tuya') {
Function connect
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function connect(configuration) {
const { baseUrl, accessKey, secretKey } = configuration;
if (!baseUrl || !accessKey || !secretKey) {
this.status = STATUS.NOT_INITIALIZED;
Function checkForContainerUpdates
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function checkForContainerUpdates(config) {
logger.info('Checking for current installed versions and required updates...');
// Check for MQTT container version
if (config.dockerMqttVersion !== DEFAULT.DOCKER_MQTT_VERSION) {
Function getAccessToken
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function getAccessToken(refreshToken, scope) {
if (!refreshToken || refreshToken.length === 0) {
throw new BadParameters();
}
const refreshTokenHash = hashRefreshToken(refreshToken);
Function throwErrorIfNeeded
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function throwErrorIfNeeded(response, emit = false, config = false) {
if (response.error) {
if (response.error === 406) {
this.connected = false;
this.accessToken = '';
Function EwelinkController
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function EwelinkController(eweLinkHandler) {
/**
* @api {post} /api/v1/service/ewelink/connect Connect to eWeLink cloud account.
* @apiName save
* @apiGroup Ewelink
Function command
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function command(message, classification, context) {
const cameraImages = [];
const roomEntity = classification.entities.find((entity) => entity.entity === 'room');
const deviceEntity = classification.entities.find((entity) => entity.entity === 'device');
Function createActions
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createActions(store) {
const actions = {
async loadProfilePicture(state) {
// if a profile picture already exist
if (state.profilePicture) {
Function promise
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const promise = new Promise((resolve, reject) => {
let err = '';
const childProcess = spawn('node', [SCRIPT_PATH, JSON.stringify(params)]);
childProcess.stdout.on('data', async (data) => {
Function disarm
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function disarm(selector) {
// In case there is a timeout to arm this house, we clear it
clearTimeout(this.armingHouseTimeout.get(selector));
if (this.armingHouseTimeout.get(selector)) {
this.armingHouseTimeout.delete(selector);
Function getEventsInRange
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async getEventsInRange(state, from, to) {
store.setState({
DeviceGetStatus: CalendarGetEventsStatus.Getting
});
try {
Function saveCaldavSettings
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async saveCaldavSettings(state) {
store.setState({
caldavSaveSyncStatus: CalDAVStatus.Getting
});
try {
Function saveNextcloudTalkSettings
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async saveNextcloudTalkSettings(state) {
store.setState({
nextcloudTalkSaveSettingsStatus: RequestStatus.Getting
});
try {
Function render
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render(
props,
{ name, color, radius, latitude, longitude, houses, loading, createAreaError, deleteAreaError, getAreaError }
) {
return (
Function BadgeNumberDeviceValue
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const BadgeNumberDeviceValue = props => {
const { category, type, last_value: lastValue = null, unit } = props.deviceFeature;
const colorMethod = BADGE_CATEGORIES[category];
if (!colorMethod) {