Showing 754 of 2,690 total issues
Function up
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
up: async (queryInterface, Sequelize) => {
await queryInterface.createTable('t_device_param', {
id: {
allowNull: false,
primaryKey: true,
Function exports
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = (sequelize, DataTypes) => {
const deviceParam = sequelize.define(
't_device_param',
{
id: {
Function exports
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = (sequelize, DataTypes) => {
const pod = sequelize.define(
't_pod',
{
id: {
Function action.devices.commands.ColorAbsolute
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
'action.devices.commands.ColorAbsolute': (device, params) => {
const events = [];
const { color = {} } = params;
const { temperature, spectrumRGB } = color;
Function syncDeviceConverter
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function syncDeviceConverter(device) {
const endpoint = {
endpointId: device.selector,
friendlyName: device.name,
manufacturerName: 'Gladys Assistant',
Function createActions
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createActions(store) {
const actions = {
async getUsersWithLocation(state) {
store.setState({
GetUsersWithlocationStatus: RequestStatus.Getting
Function getZigbee2mqttDevices
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async getZigbee2mqttDevices(state, take, skip) {
store.setState({
getZigbee2mqttStatus: RequestStatus.Getting
});
try {
Function render
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render({}, { deviceStateHistoryInDays }) {
return (
<div class="card">
<h4 class="card-header">
<Text id="systemSettings.deviceStateRetentionTime" />
Function render
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render(props, { saving, error, variables, scene, triggersVariables, tags }) {
return (
scene && (
<div>
<DndProvider backend={this.isTouchDevice ? TouchBackend : HTML5Backend}>
Function discoverDevices
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function discoverDevices() {
logger.debug('Looking for MELCloud devices...');
if (this.status !== STATUS.CONNECTED) {
this.gladys.event.emit(EVENTS.WEBSOCKET.SEND_ALL, {
type: WEBSOCKET_MESSAGE_TYPES.MELCLOUD.STATUS,
Function up
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
up: async (queryInterface, Sequelize) => {
await queryInterface.createTable('t_room', {
id: {
allowNull: false,
primaryKey: true,
Function setupRoutes
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setupRoutes(gladys) {
const router = express.Router();
const routes = getRoutes(gladys);
const authMiddleware = AuthMiddleware('dashboard:write', gladys);
const isInstanceConfiguredMiddleware = IsInstanceConfiguredMiddleware(gladys);
Function connect
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function connect(configuration) {
const { username, password } = configuration;
if (!username || !password) {
this.status = STATUS.NOT_INITIALIZED;
Function handleNewMessage
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function handleNewMessage(topic, message) {
logger.debug(`Receives MQTT message from ${topic} : ${message}`);
try {
// If debug mode is enabled, send message to UI
Function update
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function update(selector, scene) {
const existingScene = await db.Scene.findOne({
where: {
selector,
},
Function getBySelector
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function getBySelector(selector, options) {
const optionsWithDefault = { ...DEFAULT_OPTIONS, ...options };
const include = [];
if (optionsWithDefault.expand.includes('devices')) {
include.push({
Function getHumidityInRoom
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function getHumidityInRoom(roomId, options) {
logger.debug(`Getting average humidity in room ${roomId}`);
const optionsWithDefault = { ...DEFAULT_PARAMETERS, ...options };
const oneHourAgo = new Date(new Date().getTime() - 1 * 60 * 60 * 1000);
Function handleAlexaMessage
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function handleAlexaMessage(data, rawMessage, cb) {
try {
const service = this.serviceManager.getService('alexa');
const body = {
...data.data,
Function add
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function add(device) {
this.stateManager.setState('device', device.selector, device);
this.stateManager.setState('deviceByExternalId', device.external_id, device);
this.stateManager.setState('deviceById', device.id, device);
device.features.forEach((feature) => {
Function connect
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
connect() {
const websocketUrl = config.webSocketUrl || window.location.origin.replace('http', 'ws');
if (this.ws && this.ws.close) {
this.ws.close();
}