GladysProject/Gladys

View on GitHub

Showing 754 of 2,690 total issues

Function updateFeatureProperty has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    updateFeatureProperty(state, listName, deviceIndex, featureIndex, property, value) {
Severity: Minor
Found in front/src/routes/integration/all/tasmota/actions.js - About 45 mins to fix

    Function UsagePointDevice has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    const UsagePointDevice = ({
      device,
      language = 'fr',
      deviceIndex,
      updateDeviceParam,
    Severity: Minor
    Found in front/src/routes/integration/all/enedis-gateway/UsagePoints.jsx - About 45 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function render has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      render(
        { housesWithRooms = [], broadlinkPeripherals = [], ...props },
        { device, selectedFeature, selectedValue, editedFeatures = {}, learning, learnAllMode, peripheral, saveStatus }
      ) {
        const canSave = Object.keys(editedFeatures).length === 0 || !device.name;

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function getAllPropertiesObject has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    const getAllPropertiesObject = (obj, path = '', results = []) => {
      Object.keys(obj).forEach(key => {
        const value = obj[key];
        const shouldContinueParsingTree = typeof value === 'object' && value !== null && value !== undefined;
        const keyIsNumber = isNumeric(key);
    Severity: Minor
    Found in front/src/routes/scene/edit-scene/actions/HttpRequest.jsx - About 45 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function Profile has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    const Profile = ({ children, ...props }) => {
      return (
        <div>
          {props.unknownError && (
            <div class="alert alert-danger" role="alert">
    Severity: Minor
    Found in front/src/components/user/profile.jsx - About 45 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function normalize has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function normalize(value, currentMin, currentMax, newRangeMin, newRangeMax) {
    Severity: Minor
    Found in server/utils/device.js - About 35 mins to fix

      Function writeDevice has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      async function writeDevice(peripheral, serviceUuid, characteristicUuid, value, withoutResponse = false) {
      Severity: Minor
      Found in server/services/bluetooth/lib/commands/bluetooth.writeDevice.js - About 35 mins to fix

        Function deviceFeatureWebsocketEvent has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            async deviceFeatureWebsocketEvent(state, box, x, y, payload) {
        Severity: Minor
        Found in front/src/actions/dashboard/boxes/humidityInRoom.js - About 35 mins to fix

          Function Camera has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          const Camera = function Camera(stateManager, messageManager, eventManager, serviceManager, deviceManager) {
          Severity: Minor
          Found in server/lib/device/camera/index.js - About 35 mins to fix

            Function getIntegrations has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              async getIntegrations(state, intl, category, searchKeyword = '', orderDir = 'asc') {
            Severity: Minor
            Found in front/src/actions/integration.js - About 35 mins to fix

              Function executeAction has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              async function executeAction(self, action, scope, columnIndex, rowIndex) {
              Severity: Minor
              Found in server/lib/scene/scene.executeActions.js - About 35 mins to fix

                Function MessageHandler has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                const MessageHandler = function MessageHandler(event, brain, service, state, variable) {
                Severity: Minor
                Found in server/lib/message/index.js - About 35 mins to fix

                  Function deviceFeatureWebsocketEvent has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      async deviceFeatureWebsocketEvent(state, box, x, y, payload) {
                  Severity: Minor
                  Found in front/src/actions/dashboard/boxes/temperatureInRoom.js - About 35 mins to fix

                    Function editRoom has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        editRoom(state, houseIndex, roomIndex, property, value) {
                    Severity: Minor
                    Found in front/src/actions/house.js - About 35 mins to fix

                      Function mergeBoxData has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          mergeBoxData(state, key, x, y, data) {
                      Severity: Minor
                      Found in front/src/actions/dashboard/boxActions.js - About 35 mins to fix

                        Function updateDeviceField has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            updateDeviceField(state, listName, index, field, value) {
                        Severity: Minor
                        Found in front/src/routes/integration/all/tasmota/actions.js - About 35 mins to fix

                          Function updateFeatureProperty has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              updateFeatureProperty(state, deviceIndex, featureIndex, property, value) {
                          Severity: Minor
                          Found in front/src/routes/integration/all/mqtt/device-page/actions.js - About 35 mins to fix

                            Function updateDeviceField has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                updateDeviceField(state, listName, index, field, value) {
                            Severity: Minor
                            Found in front/src/routes/integration/all/ewelink/actions.js - About 35 mins to fix

                              Function updateLocalValue has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  updateLocalValue(state, roomIndex, deviceIndex, deviceFeatureIndex, value) {
                              Severity: Minor
                              Found in front/src/actions/device.js - About 35 mins to fix

                                Function updateBoxStatus has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    updateBoxStatus(state, key, x, y, status) {
                                Severity: Minor
                                Found in front/src/actions/dashboard/boxActions.js - About 35 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language