Showing 754 of 2,690 total issues
Function newValuePlug
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function newValuePlug(message, data) {
const { sid } = message;
logger.debug(`Xiaomi : New value plug, sid = ${sid}`);
const newSensor = {
service_id: this.serviceId,
Function render
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render(props, { batteryLevel, mostRecentValueAt, loading, tooMuchStatesError, statesNumber }) {
return (
<div class="col-md-6">
<div class="card">
<div class="card-header">
Function handleMqttMessage
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function handleMqttMessage(topic, message) {
// Limit events only on status changes
if (!this.zigbee2mqttConnected) {
this.zigbee2mqttConnected = true;
this.zigbee2mqttRunning = true;
Function render
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render(
props,
{
image,
error,
Function render
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render({ ipMasks = {}, disabled, updateMaskConfig, deleteMaskConfig }, { name = '', mask = '', valid }) {
const invalidMask = mask.length > 0 && !valid;
return (
<div>
<div class="form-group">
Function newValueTemperatureSensor
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function newValueTemperatureSensor(message, data) {
const { sid } = message;
logger.debug(`Xiaomi : New value temperature sensor, sid = ${sid}`);
const newSensor = {
File app.jsx
has 318 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { h, Component } from 'preact';
import { Router } from 'preact-router';
import createStore from 'unistore';
import get from 'get-value';
import config from '../config';
Function render
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render(props, { loading, saveError, tooMuchStatesError, statesNumber }) {
const { batteryLevel } = this.getDeviceProperty();
return (
<div class="col-md-6">
<div class="card">
Function render
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render({ action }, {}) {
return (
<div>
<div class="row">
<div class="col-md-12">
File TasmotaDeviceBox.jsx
has 316 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Component } from 'preact';
import { Text, Localizer, MarkupText } from 'preact-i18n';
import cx from 'classnames';
import { Link } from 'preact-router';
import get from 'get-value';
File WeatherBox.jsx
has 316 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Component } from 'preact';
import { connect } from 'unistore/preact';
import { Text } from 'preact-i18n';
import { Link } from 'preact-router/match';
import cx from 'classnames';
Function actions
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
Open
const actions = store => ({
updateCaldavHost(state, e) {
store.setState({
caldavHost: e.target.value
});
- 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 25 (exceeds 5 allowed). Consider refactoring. Open
Open
function createActions(store) {
const actionsProfilePicture = createActionsProfilePicture(store);
const actions = {
handleRoute(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 loadDeviceDetails
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function loadDeviceDetails(homeData) {
const { rooms: roomsHomeData, modules: modulesHomeData, id: homeId } = homeData;
let listDevices = [];
logger.debug('loading devices details in home id: ', homeId, '...');
Function addScene
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function addScene(sceneRaw) {
// deep clone the scene so that we don't modify the same object which will be returned to the client
const scene = cloneDeep(sceneRaw);
// first, if the scene actually exist, we cancel all triggers
this.cancelTriggers(scene.selector);
Function render
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render(
{ deviceIndex, editable, deleteButton, housesWithRooms },
{ device, loading, errorMessage, tooMuchStatesError, statesNumber }
) {
const validModel = device.features && device.features.length > 0;
actions
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
Open
const actions = {
async getStatus(state) {
store.setState({
gatewayGetStatusStatus: RequestStatus.Getting
});
EditScene
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class EditScene extends Component {
getSceneBySelector = async () => {
this.setState({
SceneGetStatus: RequestStatus.Getting
});
File Camera.jsx
has 312 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Component, createRef } from 'preact';
import { connect } from 'unistore/preact';
import cx from 'classnames';
import { Text } from 'preact-i18n';
import Hls from 'hls.js';
Function render
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render(props, { loading, error }) {
return (
<Layout>
<div class="container mt-4">
<div class="row">