GladysProject/Gladys

View on GitHub

Showing 742 of 2,674 total issues

Function render has 117 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render(props) {
    const displayBody = METHOD_WITH_BODY.includes(props.action.method);
    return (
      <div>
        <div
Severity: Major
Found in front/src/routes/scene/edit-scene/actions/HttpRequest.jsx - About 4 hrs to fix

    Function Gladys has 115 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function Gladys(params = {}) {
      params.jwtSecret = params.jwtSecret || generateJwtSecret();
      const config = getConfig();
    
      const event = new Event();
    Severity: Major
    Found in server/lib/index.js - About 4 hrs to fix

      Function createActions has 114 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const createActions = store => {
        const houseActions = createActionsHouse(store);
        const actions = {
          async getDiscoveredDevices(state = {}) {
            store.setState({
      Severity: Major
      Found in front/src/routes/integration/all/lan-manager/discover-page/actions.js - About 4 hrs to fix

        Function createActions has 113 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function createActions(store) {
          const houseActions = createActionsHouse(store);
          const integrationActions = createActionsIntegration(store);
          const actions = {
            async getPhilipsHueDevices(state) {
        Severity: Major
        Found in front/src/routes/integration/all/philips-hue/device-page/actions.js - About 4 hrs to fix

          Function render has 113 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            render({ device = {}, deviceIndex, houses = [] }, { loading, saveError }) {
              const { features = [] } = device;
              const enableSaveButton = !device.created_at;
              const enableUpdateButton = device.updatable;
              const supportedDevice = features.findIndex(f => f.category !== DEVICE_FEATURE_CATEGORIES.BATTERY) >= 0;

            Function render has 113 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              render(props, { cardOpened }) {
                return (
                  <div class="col">
                    <div class="card">
                      <div class="card-status bg-green" />
            Severity: Major
            Found in front/src/routes/scene/edit-scene/Settings.jsx - About 4 hrs to fix

              Function createActions has 112 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function createActions(store) {
                const houseActions = createActionsHouse(store);
                const integrationActions = createActionsIntegration(store);
                const actions = {
                  async getTpLinkDevices(state) {
              Severity: Major
              Found in front/src/routes/integration/all/tp-link/device-page/actions.js - About 4 hrs to fix

                Function render has 112 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  render(props, state) {
                    return (
                      <div class="card">
                        <div class="card-header">
                          <h1 class="card-title">
                Severity: Major
                Found in front/src/routes/integration/all/tuya/setup-page/SetupTab.jsx - About 4 hrs to fix

                  Function render has 109 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    render(props, {}) {
                      const selectedOption = this.getSelectedOption();
                      return (
                        <div>
                          <div className={style.explanationText}>

                    File UsagePoints.jsx has 347 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import { Component } from 'preact';
                    import { connect } from 'unistore/preact';
                    import dayjs from 'dayjs';
                    import relativeTime from 'dayjs/plugin/relativeTime';
                    import localizedFormat from 'dayjs/plugin/localizedFormat';
                    Severity: Minor
                    Found in front/src/routes/integration/all/enedis-gateway/UsagePoints.jsx - About 4 hrs to fix

                      Function createActions has 108 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function createActions(store) {
                        const integrationActions = createActionsIntegration(store);
                        const houseActions = createActionsHouse(store);
                        const actions = {
                          async getZigbee2mqttDevices(state, take, skip) {
                      Severity: Major
                      Found in front/src/routes/integration/all/zigbee2mqtt/device-page/actions.js - About 4 hrs to fix

                        Function exports has 107 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        module.exports = (sequelize, DataTypes) => {
                          const deviceFeature = sequelize.define(
                            't_device_feature',
                            {
                              id: {
                        Severity: Major
                        Found in server/models/device_feature.js - About 4 hrs to fix

                          Function createActions has 107 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const createActions = store => {
                            const integrationActions = createActionsIntegration(store);
                            const actions = {
                              async checkStatus(state) {
                                let zigbee2mqttStatus = {
                          Severity: Major
                          Found in front/src/routes/integration/all/zigbee2mqtt/setup-page/actions.js - About 4 hrs to fix

                            Function render has 107 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              render({ houses, bluetoothSaveStatus, currentIntegration = {} }, { device, presenceSensorIndex }) {
                                const deviceService = get(device, 'service_id');
                                const bluetoothDevice = !deviceService || deviceService === currentIntegration.id;
                                const disableForm = bluetoothSaveStatus === RequestStatus.Getting || !bluetoothDevice;
                                const { features = [] } = device;

                              File EditChart.jsx has 344 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import { Component } from 'preact';
                              import { Localizer, Text } from 'preact-i18n';
                              import { connect } from 'unistore/preact';
                              import Select from 'react-select';
                              import get from 'get-value';
                              Severity: Minor
                              Found in front/src/components/boxs/chart/EditChart.jsx - About 4 hrs to fix

                                Function render has 106 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  render({ action }, { selectedCalendarsOptions, calendarsOptions }) {
                                    return (
                                      <div>
                                        <div class="row">
                                          <div class="col-md-12">
                                Severity: Major
                                Found in front/src/routes/scene/edit-scene/actions/CalendarIsEventRunning.jsx - About 4 hrs to fix

                                  Function Zigbee2mqttController has 105 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  module.exports = function Zigbee2mqttController(gladys, zigbee2mqttManager) {
                                    /**
                                     * @api {get} /api/v1/service/zigbee2mqtt/discovered Get discovered Zigbee2mqtt devices
                                     * @apiName getDiscoveredDevices
                                     * @apiGroup Zigbee2mqtt
                                  Severity: Major
                                  Found in server/services/zigbee2mqtt/api/zigbee2mqtt.controller.js - About 4 hrs to fix

                                    Function render has 105 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      render(
                                        { selectedFeature, selectedValue, learnAllMode, editedFeatures, device, learning, ...props },
                                        { timeLeft, errorKey }
                                      ) {
                                        const { model: category } = device;

                                      Function UserController has 104 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      module.exports = function UserController(gladys) {
                                        /**
                                         * @api {post} /api/v1/user Create
                                         * @apiName CreateUser
                                         * @apiGroup User
                                      Severity: Major
                                      Found in server/api/controllers/user.controller.js - About 4 hrs to fix

                                        Function createActions has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        function createActions(store) {
                                          const integrationActions = createActionsIntegration(store);
                                          const houseActions = createActionsHouse(store);
                                          const actions = {
                                            async getDiscoveredDevices(state) {
                                        Severity: Major
                                        Found in front/src/routes/integration/all/zigbee2mqtt/discover-page/actions.js - About 4 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language