GladysProject/Gladys

View on GitHub

Showing 754 of 2,690 total issues

Function getUsers has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    async getUsers(state) {
      store.setState({
        usersGetStatus: RequestStatus.Getting
      });
      try {
Severity: Minor
Found in front/src/actions/gatewayLinkUser.js - About 1 hr to fix

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

    function createActions(store) {
      const boxActions = createBoxActions(store);
    
      const actions = {
        async getTemperatureInRoom(state, box, x, y) {
    Severity: Minor
    Found in front/src/actions/dashboard/boxes/temperatureInRoom.js - About 1 hr to fix

      Function getDefaultState has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function getDefaultState() {
        const session = config.gatewayMode ? new GatewaySession() : config.demoMode ? new DemoSession() : new Session();
        const httpClient = config.demoMode
          ? new DemoHttpClient()
          : config.gatewayMode
      Severity: Minor
      Found in front/src/utils/getDefaultState.js - About 1 hr to fix

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

          render(props, {}) {
            return (
              <tr>
                <td class={style.userNameCell}>
                  {props.user.name}
        Severity: Minor
        Found in front/src/routes/settings/settings-gateway/GatewayUserRow.jsx - About 1 hr to fix

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

            render(props, { confirmBackup }) {
              return (
                <tr>
                  <td>
                    {dayjs(props.backup.created_at)
          Severity: Minor
          Found in front/src/routes/settings/settings-backup/GatewayBackupRow.jsx - About 1 hr to fix

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

              render(props, { confirmBackup }) {
                return (
                  <tr>
                    <td>
                      {dayjs(props.backup.created_at)

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

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

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

                function buildFeatures(deviceName, expose, parentType) {
                  const { type, name, property, access, value_min: minValue, value_max: maxValue, unit: deviceUnit, values } = expose;
                  const { names = {}, feature, getFeatureIndexes = () => [''] } = exposesMap[type] || {};
                  const byName = buildByName(names, name, parentType);
                
                
                Severity: Minor
                Found in server/services/zigbee2mqtt/utils/features/buildFeatures.js - About 1 hr to fix

                  Function stopStreaming has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  async function stopStreaming(cameraSelector) {
                    const liveStream = this.liveStreams.get(cameraSelector);
                    if (!liveStream) {
                      return;
                    }
                  Severity: Minor
                  Found in server/services/rtsp-camera/lib/stopStreaming.js - About 1 hr to fix

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

                    function buildFeatures(deviceName, deviceExternalId) {
                      return [
                        // temperature sensor
                        {
                          name: `${deviceName} temperature`,
                    Severity: Minor
                    Found in server/services/broadlink/lib/commands/features/broadlink.sensor.js - About 1 hr to fix

                      Function scanPresence has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      async function scanPresence() {
                        const devices = await this.gladys.device.get({
                          service: 'bluetooth',
                          device_feature_category: DEVICE_FEATURE_CATEGORIES.PRESENCE_SENSOR,
                        });
                      Severity: Minor
                      Found in server/services/bluetooth/lib/commands/bluetooth.scanPresence.js - About 1 hr to fix

                        Function purgeAggregateStates has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        async function purgeAggregateStates() {
                          logger.debug('Purging device feature aggregate states...');
                          const deviceAggregateStateHistoryInDays = await this.variable.getValue(
                            SYSTEM_VARIABLE_NAMES.DEVICE_AGGREGATE_STATE_HISTORY_IN_DAYS,
                          );
                        Severity: Minor
                        Found in server/lib/device/device.purgeAggregateStates.js - About 1 hr to fix

                          Function loginTwoFactor has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              async loginTwoFactor(state, e) {
                                if (e) {
                                  e.preventDefault();
                                }
                                store.setState({
                          Severity: Minor
                          Found in front/src/actions/gateway.js - About 1 hr to fix

                            Function ACTIONS.ECOWATT.CONDITION has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              [ACTIONS.ECOWATT.CONDITION]: async (self, action) => {
                                try {
                                  const data = await self.gateway.getEcowattSignals();
                                  const todayDate = dayjs.tz(dayjs(), self.timezone).format('YYYY-MM-DD');
                                  const todayHour = dayjs.tz(dayjs(), self.timezone).hour();
                            Severity: Minor
                            Found in server/lib/scene/scene.actions.js - About 1 hr to fix

                              Function checkTrigger has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function checkTrigger(event) {
                                logger.debug(`Trigger: new event checkTrigger "${event.type}"`);
                                if (!triggersFunc[event.type]) {
                                  throw new Error(`Trigger type "${event.type}" has no checker function.`);
                                }
                              Severity: Minor
                              Found in server/lib/scene/scene.checkTrigger.js - About 1 hr to fix

                                Function duplicate has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                async function duplicate(selector, name, icon) {
                                  const existingScene = await db.Scene.findOne({
                                    where: {
                                      selector,
                                    },
                                Severity: Minor
                                Found in server/lib/scene/scene.duplicate.js - About 1 hr to fix

                                  Function saveCaldavSettings has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    async saveCaldavSettings(state) {
                                      store.setState({
                                        caldavSaveSharingStatus: CalDAVStatus.Getting
                                      });
                                      try {
                                  Severity: Minor
                                  Found in front/src/routes/integration/all/caldav/share-page/actions.js - About 1 hr to fix

                                    Function getXiaomiDevices has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        async getXiaomiDevices(state) {
                                          store.setState({
                                            getXiaomiDevicesStatus: RequestStatus.Getting
                                          });
                                          try {
                                    Severity: Minor
                                    Found in front/src/routes/integration/all/xiaomi/actions.js - About 1 hr to fix

                                      Function saveConfiguration has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          async saveConfiguration(state) {
                                            event.preventDefault();
                                            store.setState({
                                              connectEweLinkStatus: RequestStatus.Getting,
                                              eweLinkConnected: false,
                                      Severity: Minor
                                      Found in front/src/routes/integration/all/ewelink/actions.js - About 1 hr to fix

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

                                          render(props, { loading, device, peripheral, isRemote }) {
                                            return (
                                              <BroadlinkPage user={props.user}>
                                                <div
                                                  class={cx('dimmer', {
                                        Severity: Minor
                                        Found in front/src/routes/integration/all/broadlink/remote-page/index.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language