GladysProject/Gladys

View on GitHub

Showing 742 of 2,674 total issues

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 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,
          {
            isGladysPlus,
            dashboardDropdownOpened,
      Severity: Minor
      Found in front/src/routes/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, { 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 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 SessionController has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  module.exports = function SessionController(gladys) {
                    /**
                     * @api {post} /api/v1/session/:session_id/revoke revoke
                     * @apiName revoke
                     * @apiGroup Session
                  Severity: Minor
                  Found in server/api/controllers/session.controller.js - 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_job', {
                          id: {
                            allowNull: false,
                            primaryKey: true,
                    Severity: Minor
                    Found in server/migrations/20210726050004-add-jobs-table.js - About 1 hr to fix

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

                        up: async (queryInterface, Sequelize) => {
                          const service = await db.Service.findOne({
                            where: {
                              name: 'rtsp-camera',
                            },
                      Severity: Minor
                      Found in server/migrations/20230628144609-change-rotation-camera.js - 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

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

                            up: async (queryInterface, Sequelize) => {
                              await queryInterface.createTable('t_dashboard', {
                                id: {
                                  allowNull: false,
                                  primaryKey: true,
                          Severity: Minor
                          Found in server/migrations/20190211044839-create-dashboard.js - About 1 hr to fix

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

                              up: async (queryInterface, Sequelize) => {
                                await queryInterface.addColumn('t_house', 'alarm_mode', {
                                  type: Sequelize.STRING,
                                  allowNull: false,
                                  defaultValue: ALARM_MODES.DISARMED,
                            Severity: Minor
                            Found in server/migrations/20230929085337-alarm-mode.js - About 1 hr to fix

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

                              async function start(name, podId = null) {
                                const serviceInDb = await db.Service.findOne({
                                  where: {
                                    pod_id: podId,
                                    name,
                              Severity: Minor
                              Found in server/lib/service/service.start.js - About 1 hr to fix

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

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

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

                                      async getWeather(state, box, x, y) {
                                        boxActions.updateBoxStatus(state, BOX_KEY, x, y, RequestStatus.Getting);
                                        try {
                                          const weather = await state.httpClient.get(`/api/v1/house/${box.house}/weather`);
                                          weather.datetime_beautiful = dayjs(weather.datetime)
                                  Severity: Minor
                                  Found in front/src/actions/dashboard/boxes/weather.js - About 1 hr to fix

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

                                    async function downloadUpgrade(tag) {
                                      // reset download upgrade status
                                      this.downloadUpgradeError = null;
                                      this.downloadUpgradeFinished = null;
                                      this.downloadUpgradeLastEvent = null;
                                    Severity: Minor
                                    Found in server/lib/system/system.downloadUpgrade.js - About 1 hr to fix

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

                                      async function command(message, classification, context) {
                                        let temperatureResult;
                                        const roomEntity = classification.entities.find((entity) => entity.entity === 'room');
                                        try {
                                          switch (classification.intent) {
                                      Severity: Minor
                                      Found in server/lib/device/temperature-sensor/temperature-sensor.command.js - About 1 hr to fix

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

                                        async function command(message, classification, context) {
                                          let humidityResult;
                                          const roomEntity = classification.entities.find((entity) => entity.entity === 'room');
                                          try {
                                            switch (classification.intent) {
                                        Severity: Minor
                                        Found in server/lib/device/humidity-sensor/humidity-sensor.command.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language