Add unreferenced global variables to maintenance dialog

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

Locked
User avatar
Bushmills
Posts: 286
Joined: 23 Sep 2014 21:56

Add unreferenced global variables to maintenance dialog

Post by Bushmills » 22 May 2016 19:35

and allow their removal, just as it is already possible with triggers, conditions and actions. Otherwise users get increasingly weary of running flows made by others, frequently requiring manual cleaning up global variables after their removal. The count of global variables on a system may also be substantial, making it hard to decide for each variable whether it's still in use.
Alternatively, add date/time to each variable, showing when it has been referenced the last time.


IGY
Posts: 20
Joined: 02 Nov 2014 13:22

Re: Add unreferenced global variables to maintenance dialog

Post by IGY » 26 May 2016 09:35

+1

I would suggest introducing the same internal mechanism used for referring actions, conditions and triggers. This is essentially what Bushmills already implied.

Thus making it possible to:

- rename global variables
- list all flows that use a particular variable

I know this is a major change request ;-)

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Add unreferenced global variables to maintenance dialog

Post by MURTUMA » 27 May 2016 06:48

+1
IGY wrote:- rename global variables
Though, this might be too hard to implement as globally renaming vars inside scripts is quite different from changing the name of elements, I reckon.

IGY
Posts: 20
Joined: 02 Nov 2014 13:22

Re: Add unreferenced global variables to maintenance dialog

Post by IGY » 28 May 2016 15:21

Yes, I said it won't be easy ;-)
The script editor would need to be able to display the friendly name of referenced variables, and provide controls for handling variables, etc....

User avatar
Bushmills
Posts: 286
Joined: 23 Sep 2014 21:56

Re: Add unreferenced global variables to maintenance dialog

Post by Bushmills » 28 May 2016 15:41

I'd be happy with a two step implementation: track and manage unreferenced first, deal with renamed variables another time :)

IGY
Posts: 20
Joined: 02 Nov 2014 13:22

Re: Add unreferenced global variables to maintenance dialog

Post by IGY » 28 May 2016 18:32

I fully agree. That would be a huge help already, and I don't want to complicate things. However, that *is* the difficult part. Once you implement this bit, you get the rest almost for free. Let's wait what el jefe says... ;-)

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Add unreferenced global variables to maintenance dialog

Post by Martin » 30 May 2016 19:10

Getting the unreferenced bit to work in all circumstances is not possible. It could not detect dynamic variable names in expressions, e.g. getValue("global_var"+another_var, 123).
But I could add the feature to just detect regular usages like global_var = xyz and similar cases. Maybe a simple feature that just searches for global_var as text would help to find unused variables in many cases.

Renaming global variables is even more complicated. It's on my todo list to investigate if it's possible with a sane amount of work but I did not have the time to check the feasibility yet (Renaming of dynamic variables will not be supported, just the simple usages).

Locked