GladysProject/Gladys

View on GitHub

Showing 759 of 2,706 total issues

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

function add(device) {
  this.stateManager.setState('device', device.selector, device);
  this.stateManager.setState('deviceByExternalId', device.external_id, device);
  this.stateManager.setState('deviceById', device.id, device);
  device.features.forEach((feature) => {
Severity: Minor
Found in server/lib/device/device.add.js - 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 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 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 createActions has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    const createActions = store => {
      const houseActions = createActionsHouse(store);
      const integrationActions = createActionsIntegration(store);
      const bluetoothActions = createActionsBluetooth(store);
      const actions = {
    Severity: Minor
    Found in front/src/routes/integration/all/bluetooth/setup-page/actions.js - 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 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/ewelink/actions.js - About 45 mins to fix

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

      function createActions(store) {
        const houseActions = createActionsHouse(store);
        const actions = {
          async getLANManagerDevices(state) {
            store.setState({
      Severity: Minor
      Found in front/src/routes/integration/all/lan-manager/device-page/actions.js - 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 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 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 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 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 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 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 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 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 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