GladysProject/Gladys

View on GitHub

Showing 754 of 2,690 total issues

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

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

    Function newValueSingleWiredSwitchNeutral has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function newValueSingleWiredSwitchNeutral(message, data) {
      const { sid } = message;
      logger.debug(`Xiaomi : New value single wired switch neutral, sid = ${sid}`);
      const EXTERNAL_ID_BINARY = `xiaomi:${sid}:single-wired-switch-neutral:binary`;
      const newSensor = {

      Function setValue has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      async function setValue(device, deviceFeature, value) {
        const externalId = deviceFeature.external_id;
        const [prefix, topic] = deviceFeature.external_id.split(':');
        if (prefix !== 'melcloud') {
          throw new BadParameters(`MELCloud device external_id is invalid: "${externalId}" should starts with "melcloud:"`);
      Severity: Minor
      Found in server/services/melcloud/lib/melcloud.setValue.js - About 1 hr to fix

        Function newValueSingleWiredSwitch has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function newValueSingleWiredSwitch(message, data) {
          const { sid } = message;
          logger.debug(`Xiaomi : New value single wired switch, sid = ${sid}`);
          const EXTERNAL_ID_BINARY = `xiaomi:${sid}:single-wired-switch:binary`;
          const newSensor = {

          Function init has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function init() {
            this.wss.on('connection', (ws) => {
              let user;
              let authenticated = false;
              ws.on('close', () => {
          Severity: Minor
          Found in server/api/websockets/index.js - About 1 hr to fix

            Function kelvinToRGB has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function kelvinToRGB(kelvin) {
              const temperature = kelvin / 100;
              let red;
              let green;
              let blue;
            Severity: Minor
            Found in server/utils/colors.js - About 1 hr to fix

              Function buildPeripheral has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function buildPeripheral(broadlinkDevice) {
                const deviceMapper = this.loadMapper(broadlinkDevice);
              
                if (!deviceMapper) {
                  return null;
              Severity: Minor
              Found in server/services/broadlink/lib/commands/broadlink.buildPeripheral.js - About 1 hr to fix

                Function loadThermostatDetails has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                async function loadThermostatDetails() {
                  logger.debug('loading Thermostats details...');
                  let plugs;
                  const thermostats = [];
                  try {
                Severity: Minor
                Found in server/services/netatmo/lib/netatmo.loadThermostatDetails.js - About 1 hr to fix

                  Function getConfiguration has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  async function getConfiguration() {
                    const mqttUrl = await this.gladys.variable.getValue(CONFIGURATION.MQTT_URL_KEY, this.serviceId);
                    const mqttUsername = await this.gladys.variable.getValue(CONFIGURATION.MQTT_USERNAME_KEY, this.serviceId);
                    const mqttPassword = await this.gladys.variable.getValue(CONFIGURATION.MQTT_PASSWORD_KEY, this.serviceId);
                  
                  
                  Severity: Minor
                  Found in server/services/mqtt/lib/getConfiguration.js - About 1 hr to fix

                    Function onNewCameraFile has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    async function onNewCameraFile(
                      cameraSelector,
                      folderPath,
                      cameraFolder,
                      filename,
                    Severity: Minor
                    Found in server/services/rtsp-camera/lib/onNewCameraFile.js - About 1 hr to fix

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

                      function createActions(store) {
                        const actions = {
                          async getSessions(state) {
                            store.setState({
                              sessionsGetStatus: RequestStatus.Getting
                      Severity: Minor
                      Found in front/src/actions/session.js - About 1 hr to fix

                        Function get has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        async function get(options) {
                          const optionsWithDefault = { ...DEFAULT_OPTIONS, ...options };
                        
                          // add ability to get house
                          const includeExpand = [];
                        Severity: Minor
                        Found in server/lib/user/user.get.js - About 1 hr to fix

                          Function ACTIONS.CALENDAR.IS_EVENT_RUNNING has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            [ACTIONS.CALENDAR.IS_EVENT_RUNNING]: async (self, action, scope, columnIndex, rowIndex) => {
                              // find if one event match the condition
                              const events = await self.calendar.findCurrentlyRunningEvent(
                                action.calendars,
                                action.calendar_event_name_comparator,
                          Severity: Minor
                          Found in server/lib/scene/scene.actions.js - About 1 hr to fix

                            Function handleGoogleHomeMessage has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            async function handleGoogleHomeMessage(data, rawMessage, cb) {
                              const service = this.serviceManager.getService('google-actions');
                              try {
                                const body = {
                                  ...data.data,
                            Severity: Minor
                            Found in server/lib/gateway/gateway.handleGoogleHomeMessage.js - About 1 hr to fix

                              Function updateUser has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  async updateUser(state, e) {
                                    e.preventDefault();
                                    store.setState({
                                      ProfilePatchStatus: RequestStatus.Getting
                                    });
                              Severity: Minor
                              Found in front/src/actions/profile.js - About 1 hr to fix

                                Function login has 38 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/login/loginGateway.js - About 1 hr to fix

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

                                    render({ ipMask, disabled }) {
                                      const { networkInterface, enabled, mask, name } = ipMask;
                                      const editable = !networkInterface;
                                      return (
                                        <tr>

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

                                      render({}, {}) {
                                        return (
                                          <div>
                                            <p>
                                              <Text id="editScene.triggersCard.mqttReceived.description" />
                                    Severity: Minor
                                    Found in front/src/routes/scene/edit-scene/triggers/MQTTReceivedTrigger.jsx - About 1 hr to fix

                                      Function SceneManager has 12 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                        stateManager,
                                        event,
                                        device,
                                        message,
                                        variable,
                                      Severity: Major
                                      Found in server/lib/scene/index.js - About 1 hr to fix

                                        Function Gateway has 12 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                          variable,
                                          event,
                                          system,
                                          sequelize,
                                          config,
                                        Severity: Major
                                        Found in server/lib/gateway/index.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language