Showing 737 of 2,655 total issues
File demo.js
has 4153 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 1106 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 779 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 render
has 283 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render(props, {}) {
return (
<div class="card">
<div class="card-header">
<h1 class="card-title">
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;
Function render
has 202 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render(
props,
{
initialized,
loading,
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;
File index.js
has 496 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';
File scene.actions.js
has 488 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,