Repository: louislam/uptime-kuma
File: src/components/BadgeGeneratorDialog.vue (Vue)

Code before:
            }
            let badgeURL = this.$root.baseURL + "/api/badge/" + this.monitor.id + "/" + this.badge.type;

            // eslint-disable-next-line camelcase
            let parameter_list = {};

            for (let parameter of this.parameters[this.badge.type] || []) {
                if (parameter === "duration" && this.badge.duration) {
                    badgeURL += "/" + this.badge.duration;
                    continue;
                }

                if (this.badge[parameter]) {
                    // eslint-disable-next-line camelcase
                    parameter_list[parameter] = this.badge[parameter];
                }
            }

            for (let parameter of [ "label", "style", "value" ]) {
                if (parameter === "style" && this.badge.style === "flat") {
                    continue;
                }

                if (this.badge[parameter]) {
                    // eslint-disable-next-line camelcase
                    parameter_list[parameter] = this.badge[parameter];
                }
            }

            if (Object.keys(parameter_list).length > 0) {
                return badgeURL + "?" + new URLSearchParams(parameter_list);
            }

            return badgeURL;
        },
    },

    mounted() {
        this.BadgeGeneratorModal = new Modal(this.$refs.BadgeGeneratorModal);
    },

    methods: {
        /**
         * Setting monitor
         * @param {number} monitorId    ID of monitor
         * @param {string} monitorName  Name of monitor
         */
        show(monitorId, monitorName) {
            this.monitor = {
                id: monitorId,
                name: monitorName,

Review comment (suggestion):
```suggestion
                    parameterList[parameter] = this.badge[parameter];
```

Code after:
            }
            let badgeURL = this.$root.baseURL + "/api/badge/" + this.monitor.id + "/" + this.badge.type;

            let parameterList = {};

            for (let parameter of this.parameters[this.badge.type] || []) {
                if (parameter === "duration" && this.badge.duration) {
                    badgeURL += "/" + this.badge.duration;
                    continue;
                }

                if (this.badge[parameter]) {
                    parameterList[parameter] = this.badge[parameter];
                }
            }

            for (let parameter of [ "label", "style", "value" ]) {
                if (parameter === "style" && this.badge.style === "flat") {
                    continue;
                }

                if (this.badge[parameter]) {
                    parameterList[parameter] = this.badge[parameter];
                }
            }

            if (Object.keys(parameterList).length > 0) {
                return badgeURL + "?" + new URLSearchParams(parameterList);
            }

            return badgeURL;
        },
    },

    mounted() {
        this.BadgeGeneratorModal = new Modal(this.$refs.BadgeGeneratorModal);
    },

    methods: {
        /**
         * Setting monitor
         * @param {number} monitorId    ID of monitor
         * @param {string} monitorName  Name of monitor
         */
        show(monitorId, monitorName) {
            this.monitor = {
                id: monitorId,
                name: monitorName,
            };

            this.BadgeGeneratorModal.show();