GladysProject/Gladys

View on GitHub

Showing 754 of 2,690 total issues

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

  render(props, {}) {
    const variableOptions = [];

    props.actionsGroupsBefore.forEach((actionGroup, groupIndex) => {
      actionGroup.forEach((action, index) => {

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

      render(props, { alarmModesOptions, houseOptions, selectedHouseOption, selectedAlarmModeOption }) {
        return (
          <div>
            <p>
              <Text id="editScene.actionsCard.alarmSetMode.description" />
    Severity: Minor
    Found in front/src/routes/scene/edit-scene/actions/SetAlarmMode.jsx - About 1 hr to fix

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

        render(props, { alarmModesOptions, houseOptions, selectedHouseOption, selectedAlarmModeOption }) {
          return (
            <div>
              <p>
                <Text id="editScene.actionsCard.alarmCheckMode.description" />
      Severity: Minor
      Found in front/src/routes/scene/edit-scene/actions/CheckAlarmMode.jsx - About 1 hr to fix

        Function VariableController has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function VariableController(gladys) {
          /**
           * @api {post} /api/service/:service_name/variable/:variable_key Save service variable
           * @apiName SaveVariable
           * @apiGroup Variable
        Severity: Minor
        Found in server/api/controllers/variable.controller.js - About 1 hr to fix

          Function DashboardController has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = function DashboardController(gladys) {
            /**
             * @api {post} /api/v1/dashboard create
             * @apiName createDashoard
             * @apiGroup Dashboard
          Severity: Minor
          Found in server/api/controllers/dashboard.controller.js - About 1 hr to fix

            Function up has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              up: async (queryInterface, Sequelize) => {
                const service = await db.Service.findOne({
                  where: {
                    name: 'enedis',
                  },
            Severity: Minor
            Found in server/migrations/20230518062954-enedis-reset-aggregate.js - About 1 hr to fix

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

              module.exports = (sequelize, DataTypes) => {
                const deviceFeatureState = sequelize.define(
                  't_device_feature_state',
                  {
                    id: {
              Severity: Minor
              Found in server/models/device_feature_state.js - About 1 hr to fix

                Function buildFeatures has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function buildFeatures(deviceName, deviceExternalId, broadlinkDevice) {
                  const { TYPE, getEnergy } = broadlinkDevice;
                  const features = [];
                
                  // check for number of switch features
                Severity: Minor
                Found in server/services/broadlink/lib/commands/features/broadlink.switch.js - About 1 hr to fix

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

                  function createActions(store) {
                    const actions = {
                      async getEventsInRange(state, from, to) {
                        store.setState({
                          DeviceGetStatus: CalendarGetEventsStatus.Getting
                  Severity: Minor
                  Found in front/src/actions/calendar.js - About 1 hr to fix

                    Function getUsersKeys has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    async function getUsersKeys() {
                      try {
                        const onlineUsers = await this.gladysGatewayClient.getUsersInstance();
                        let localUsers = await this.variable.getValue('GLADYS_GATEWAY_USERS_KEYS');
                        localUsers = localUsers !== null ? JSON.parse(localUsers) : [];
                    Severity: Minor
                    Found in server/lib/gateway/gateway.getUsersKeys.js - About 1 hr to fix

                      Function componentWillMount has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        async componentWillMount() {
                          let { deviceSelector, peripheral } = this.props;
                          let device;
                          let loading = RequestStatus.Success;
                          let isRemote;
                      Severity: Minor
                      Found in front/src/routes/integration/all/broadlink/remote-page/index.js - About 1 hr to fix

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

                          render(
                            props,
                            {
                              dashboards,
                              currentDashboard,
                        Severity: Minor
                        Found in front/src/routes/dashboard/edit-dashboard/index.js - About 1 hr to fix

                          Function startSync has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            async startSync(state) {
                              store.setState({
                                caldavSyncStatus: CalDAVStatus.Getting,
                                caldavSaveSettingsStatus: null,
                                caldavCleanUpStatus: null
                          Severity: Minor
                          Found in front/src/routes/integration/all/caldav/account-page/actions.js - About 1 hr to fix

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

                              render(
                                props,
                                {
                                  isGladysPlus,
                                  dashboardDropdownOpened,
                            Severity: Minor
                            Found in front/src/routes/dashboard/index.js - About 1 hr to fix

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

                                render(props, { houses }) {
                                  return (
                                    <BaseEditBox {...props} titleKey="dashboard.boxTitle.alarm">
                                      <div class="form-group">
                                        <div class="form-group">
                              Severity: Minor
                              Found in front/src/components/boxs/alarm/EditAlarm.jsx - About 1 hr to fix

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

                                  render(props, { scenes, status }) {
                                    const boxTitle = props.box.name;
                                    const loading = status === RequestStatus.Getting && !status;
                                
                                    return (
                                Severity: Minor
                                Found in front/src/components/boxs/scene/SceneBox.jsx - About 1 hr to fix

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

                                    render({ value, category, type, isLive = false }, {}) {
                                      return (
                                        <div class="btn-group" role="group">
                                          <button
                                            class={cx('btn btn-sm btn-secondary', {
                                  Severity: Minor
                                  Found in front/src/components/device/ShutterButtons.jsx - About 1 hr to fix

                                    Function getTuyaConfiguration has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      async getTuyaConfiguration() {
                                        let tuyaEndpoint = '';
                                        let tuyaAccessKey = '';
                                        let tuyaSecretKey = '';
                                        let tuyaAppAccountId = '';
                                    Severity: Minor
                                    Found in front/src/routes/integration/all/tuya/setup-page/SetupTab.jsx - About 1 hr to fix

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

                                        render(props, {}) {
                                          const boxData = get(props, `${DASHBOARD_BOX_DATA_KEY}TemperatureInRoom.${props.x}_${props.y}`);
                                          const boxStatus = get(props, `${DASHBOARD_BOX_STATUS_KEY}TemperatureInRoom.${props.x}_${props.y}`);
                                          const temperature = get(boxData, 'room.temperature.temperature');
                                          const unit = get(boxData, 'room.temperature.unit');
                                      Severity: Minor
                                      Found in front/src/components/boxs/room-temperature/RoomTemperature.jsx - About 1 hr to fix

                                        Function up has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          up: async (queryInterface, Sequelize) => {
                                            await queryInterface.createTable('t_house', {
                                              id: {
                                                allowNull: false,
                                                primaryKey: true,
                                        Severity: Minor
                                        Found in server/migrations/20190206114851-create-house.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language