Showing 754 of 2,690 total issues
File demo.js
has 4162 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import dayjs from 'dayjs';
const data = {
'post /api/v1/login': {
id: '215811c9-c0aa-4148-8a4b-e02892d7446f',
File constants.js
has 1130 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const STATE = {
ON: 1,
OFF: 0,
};
Function getRoutes
has 511 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getRoutes(gladys) {
const areaController = AreaController(gladys);
const calendarController = CalendarController(gladys);
const cameraController = CameraController(gladys);
const dashboardController = DashboardController(gladys);
Function createActions
has 443 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createActions(store) {
const actions = {
async getStatus(state) {
store.setState({
gatewayGetStatusStatus: RequestStatus.Getting
File numericType.js
has 788 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const { DEVICE_FEATURE_CATEGORIES, DEVICE_FEATURE_TYPES, DEVICE_FEATURE_UNITS } = require('../../../utils/constants');
module.exports = {
type: 'numeric',
writeValue: (expose, value) => {
Function createActions
has 293 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createActions(store) {
const actions = {
async getHouses(state) {
store.setState({
housesGetStatus: RequestStatus.Getting
Function createActions
has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring. Open
Open
function createActions(store) {
const actions = {
async getStatus(state) {
store.setState({
gatewayGetStatusStatus: RequestStatus.Getting
- 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 264 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createActions(store) {
const actions = {
async getMySelf(state) {
store.setState({
ProfileGetStatus: RequestStatus.Getting,
Function render
has 257 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render({}, {}) {
const language = get(this.props, 'user.language');
const localeSet = language === 'fr' ? fr : 'en';
const time = this.props.trigger.time
? new Date().setHours(this.props.trigger.time.substr(0, 2), this.props.trigger.time.substr(3, 2))
Function render
has 245 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render(
props,
{
nodeRedEnabled,
dockerBased,
Function createActions
has 240 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createActions(store) {
const integrationActions = createActionsIntegration(store);
const actions = {
async complete(camera) {
const cameraUrlParam = camera.params.find(param => param.name === 'CAMERA_URL');
Function render
has 233 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render(
{
deviceIndex,
editable,
deleteButton,
Function createActions
has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring. Open
Open
function createActions(store) {
const actions = {
async getMySelf(state) {
store.setState({
ProfileGetStatus: RequestStatus.Getting,
- 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
File routes.js
has 535 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const AreaController = require('./controllers/area.controller');
const CalendarController = require('./controllers/calendar.controller');
const CameraController = require('./controllers/camera.controller');
const DashboardController = require('./controllers/dashboard.controller');
const DeviceController = require('./controllers/device.controller');
Function render
has 213 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render(
{ deviceIndex, device, housesWithRooms, editable, ...props },
{ loading, errorMessage, authErrorMessage, tooMuchStatesError, statesNumber }
) {
const validModel = device.features.length > 0 || device.needAuthentication;
File scene.actions.js
has 520 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const Promise = require('bluebird');
const Handlebars = require('handlebars');
const cloneDeep = require('lodash.clonedeep');
const {
create,
Function render
has 204 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render(
props,
{
initialized,
loading,
File index.js
has 504 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Component } from 'preact';
import { connect } from 'unistore/preact';
import update from 'immutability-helper';
import { route } from 'preact-router';
import { DndProvider } from 'react-dnd';
Function createActions
has 200 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createActions(store) {
const integrationActions = createActionsIntegration(store);
const actions = {
async loadProps(state) {
let eweLinkUsername;
Function startStreaming
has 181 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function startStreaming(cameraSelector, isGladysGateway, segmentDuration = 1) {
// If stream already exist, return existing stream
if (this.liveStreams.has(cameraSelector)) {
const liveStream = this.liveStreams.get(cameraSelector);
// If we are in a local stream, and new request come from Gladys Plus