Showing 759 of 2,706 total issues
Function add
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. 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) => {
- 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 UsagePointDevice
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const UsagePointDevice = ({
device,
language = 'fr',
deviceIndex,
updateDeviceParam,
- 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 updateFeatureProperty
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
updateFeatureProperty(state, listName, deviceIndex, featureIndex, property, value) {
Function createActions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const createActions = store => {
const houseActions = createActionsHouse(store);
const integrationActions = createActionsIntegration(store);
const bluetoothActions = createActionsBluetooth(store);
const actions = {
- 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 updateFeatureProperty
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
updateFeatureProperty(state, listName, deviceIndex, featureIndex, property, value) {
Function createActions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function createActions(store) {
const houseActions = createActionsHouse(store);
const actions = {
async getLANManagerDevices(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 8 (exceeds 5 allowed). Consider refactoring. Open
render(
{ housesWithRooms = [], broadlinkPeripherals = [], ...props },
{ device, selectedFeature, selectedValue, editedFeatures = {}, learning, learnAllMode, peripheral, saveStatus }
) {
const canSave = Object.keys(editedFeatures).length === 0 || !device.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 getAllPropertiesObject
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const getAllPropertiesObject = (obj, path = '', results = []) => {
Object.keys(obj).forEach(key => {
const value = obj[key];
const shouldContinueParsingTree = typeof value === 'object' && value !== null && value !== undefined;
const keyIsNumber = isNumeric(key);
- 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 Profile
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const Profile = ({ children, ...props }) => {
return (
<div>
{props.unknownError && (
<div class="alert alert-danger" role="alert">
- 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 normalize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function normalize(value, currentMin, currentMax, newRangeMin, newRangeMax) {
Function writeDevice
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
async function writeDevice(peripheral, serviceUuid, characteristicUuid, value, withoutResponse = false) {
Function MessageHandler
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
const MessageHandler = function MessageHandler(event, brain, service, state, variable) {
Function Camera
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
const Camera = function Camera(stateManager, messageManager, eventManager, serviceManager, deviceManager) {
Function editRoom
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
editRoom(state, houseIndex, roomIndex, property, value) {
Function deviceFeatureWebsocketEvent
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
async deviceFeatureWebsocketEvent(state, box, x, y, payload) {
Function executeAction
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
async function executeAction(self, action, scope, columnIndex, rowIndex) {
Function getIntegrations
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
async getIntegrations(state, intl, category, searchKeyword = '', orderDir = 'asc') {
Function deviceFeatureWebsocketEvent
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
async deviceFeatureWebsocketEvent(state, box, x, y, payload) {
Function updateDeviceField
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
updateDeviceField(state, listName, index, field, value) {
Function updateBoxStatus
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
updateBoxStatus(state, key, x, y, status) {