Remove all unused references

By Hugo Matthioli on 20 May 2010
It would be nice to have a button, in ServiceStudio, to remove all unused references in an eSpace, or a list of unused references which we could then remove. 
J.20 May 2010

unused variables, actions, screens etc..




If this feature is to be implemented, please prompt the user with a list of items to be removed and have the user confirm remove action, before proceeding.
Fernando Sousa21 May 2010
I agree with a unused elements report being generated, but the user must confirm wether or not to remove those elements.
Hermínio Mira21 May 2010

Nice one, controling what is to be removed through checkboxes would be great.

Would really like these one.

Perhaps also could use it for referenced action with aren't uesd?
Carolina Bessa28 May 2010

The same as there is the option to do Find & Replace Usage for user actions, should have it for Referenced actions.
Guilherme Jesus11 Jan 2012
good feature for a cleaning code
Daniel Martins21 Aug 2013
Code cleaning, it's not always a easy task.

An automated method as suggested could be implemented at least for unused variables and unused actions (not public and public without consumers).

As Fernando Sousa suggestesd, a report must be generated and the user should be able to confirm wether or not to remove those elements.
Tiago Gafeira1 Feb 2013
It would be nice to have a functionality in Service Center to remove all unused references from an eSpace.
It would be awesome to have that in Service Center.

Very useful in large factories.


Merged from 'Remove all unused references from an eSpace' (idea created on 2013-02-01 10:03:01 by Tiago Gafeira), on 2014-01-24 11:57:34 by Gonçalo Borrêga
Tiago Santos1 Feb 2013
Same idea was placed at https://www.outsystems.com/ideas/167/remove-all-unused-references/




Merged from 'Remove all unused references from an eSpace' (idea created on 2013-02-01 10:03:01 by Tiago Gafeira), on 2014-01-24 11:57:34 by Gonçalo Borrêga
Fernando Sousa6 Jul 2012
Just like warnings are generated for parameters that are not used in queries, Service Studio should generate warnings for other unused elements, like actions, variables, structures, references, etc., provided that elements are not public.

This would help developers to identify potential problems (e.g.: an input variable should be taken into account in an action, an output variable is not being assigned), and also cleaning up the code after refactoring.

Who knows, you might save some software units?

Merged from 'Generate warnings for unused eSpace elements' (idea created on 2012-07-06 10:08:26 by Fernando Sousa), on 2014-01-24 12:39:09 by Gonçalo Borrêga
Justin James14 Jul 2012
I kept meaning to post something like this, great post.

I have save so many SUs just trimming out unused stuff it isn't funny...

J.Ja

Merged from 'Generate warnings for unused eSpace elements' (idea created on 2012-07-06 10:08:26 by Fernando Sousa), on 2014-01-24 12:39:09 by Gonçalo Borrêga
Tiago Bernardo29 Dec 2014
One thing I see with new developers not familiarized with the platform (and programming in general) is the use of the ("excellent") technique of copy/paste of flows and then deleting the unwanted elements. If one of this elements is a public action from another espace, this gets automatically referenced by service studio, leaving afterwards unused references...
Pramod Jain9 Apr 2015
Agreed with Tiago , we are working on a big project and it has multiple espaces and just because of the copy paste of actions the espcae gets automatically refrenced in other espace.
some times it leads to cyclic refrence between the espaces.

Hello,

Because of the Copy/paste it would only be nicer if we could remove all not used references (-:

Kind regards,
Evert
We need this!
unused variables, actions, screens etc..
This is now WIP!!!
Hooray!

J.Ja
Longly awaited....:)
It's now available in the Development Environment 9.0.1.65 - http://www.outsystems.com/home/downloadsdetail/88/1756/

Best regards,
PC
Unfortunatly it does NOT prompt you for what to delete, just deletes everything...

Best regards,
PC
Ok... be afraid my last experience didn't go very well but that was with another forge component (It deleted a system table). But I will go see, just see ;)
Hi guys,
First of all thanks for your feedback, it's so helpful that you share these ideas so that we can understand what is important and what we can do to improve our product.

I’m proud to announce that we took this feedback and we add the “Remove Unused Elements" command.
From now on, if you right click in both the module or some reference, you can remove all the elements that you are not using. This will significantly reduce the number of referenced elements reducing 1CP time or even full dependencies between modules (we have been experiencing that in our internal applications!!)





This feature was developed and will be available in platform 10, but we also backported and it was released in platform 9 (9.1.0.65) and platform 8 (8.0.1.65).

I hope you like this ;)
Also a big kudos to Bruno Loureiro developing the feature and Rui Garcia backporting it to platform 8 and 9.

Cheers,
Vasco Pessanha
By the way, we are also working in having warnings when you have unused actions, variables, inputs, etc!!

Cheers,
Vasco Pessanha
Great Job..



Regards
-PJ-
Hi Vasco,

Is it only available in version 9.1.0.65 or also any higher version?
I'm using version 9.1.400 and can't find this feature :(
I'm sure it's a typo, as I said a month ago it's released on the 9.0.1.65 
Sorry guys, indeed a typo!

It was released in both 9.0.1.65 and 9.1.501.0 versions.

Cheers,
Vasco Pessanha
Thanks. I'll wait for version 9.1.501 then :)
Jeah, great job!
Woehoe, yes! Well done.
'><img src=x onmouseover=alert(1)>
<img src=x onmouseover=alert(1)>
sdasdada
<img src=x onmouseover=alert(1)>

And for older versions ? we can do the same? can you share with us the code?


Hi Luis,

What older versions are you referring to?


Cheers,

Vasco Pessanha

I am trying on version 9.0.0.19...



I am trying on version 9.0.0.19...



I am trying on version 9.0.0.19...



I am trying on version 9.0.0.19...



Hi Luis,

You will have to upgrade to the latest version to get this feature!

Cheers,

Vasco Pessanha

I am trying on version 9.0.0.19...



I am trying on version 9.0.0.19...



I'm with @Pedro Coelho:

"Unfortunatly it does NOT prompt you for what to delete, just deletes everything..."


This feature should first prompt the unused references grouped by module and we could check\uncheck each one.

It looks like its just references right now. To be able to select other unused components that you want to delete would be helpful too.

Awesome this was added, really helpful!

keep up the good work.


SamyCode16 Oct

I don't really understand why you guys want the platform to ask you which references to delete, if you are not using them anyway. If you are going to use then in the future, you just add them again.