LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
LFBaute

Greyed out icons on project tree for objects that are not called by any instance

Status: New

On project folder ... 

It would be great if in the project tree,

Just like any items that are called and not on project are in dependencies...

The other way would be for

- Update icons (grayed them out) for items in project without callers to be greyed out or have a different icon like an exclamation mark or similar...

 

that way it would be easier to know if an item is

dead code or not called by anyone

 

When cleaning or developing is common to forget which vis are no longer used or needed.

CLA, CTA
3 Comments
raphschru
Active Participant

As is, the idea seems to overlook some important aspects. There are several cases where a VI is not explicitly called by another VI, yet I wouldn't want it to appear as something that can be deleted.

 

What about:

 - Top-level VIs: run manually in dev mode, not called by another VI.

 - Dynamically called VIs: the compiler can't always determine whether it is called by another VI.

 - (Unit) Test / Benchmark / Scripting VIs: run manually every now and then when needed.

 - Unused members of libraries/classes that are under dependencies: all members of an utility library may not be needed by the current project.

 - Unused instances of polymorphic VIs that are under dependencies: same logic as for libraries/classes.

 

Also, for finding items with no caller, you already have a right-click option on the project root in the project tree > "Find Items with No Callers". In my opinion, modifying item icons as you proposed would be redundant with the right-click option and maybe even clutter the project tree.

LFBaute
Member

Thanks for your comments, I do agree on the corner cases.... 

given the scenarios that you mention,

what would you think about allowing developer enable or disable the feature.

 

Although there is the "Find items with no callers" tool,

it shows a lot of VIs, including dependencies (vi.lib, instr.lib, etc.....)

maybe adding filtering on this tool, filter by library, by folder or avoid showing dependency VIs,

can help the purpose of simplifying it...

 

the idea is to make easier to spot the VIs that programmer developed only for this/the project tree.... 

 

the better community comments about this, we can find something that works for all of us,

CLA, CTA
wiebe@CARYA
Knight of NI

>Although there is the "Find items with no callers" tool,

 

I find that tool quite useless, and I think for the same reason I wouldn't like the disabled items.

 

It only shows the items that are not used, not the items that are only used in items that are not used.

 

The only way to find all dead code is to recursively delete all disabled items, until thee are no disabled items left. And then you'll probably find out the items where there for a reason. 

 

It would be more useful (to me) to have a way to find which items are used (or not used), the 'callees', in manually selectable items, recursively. And\or the other way around; to quickly find all callers (recursively) on any selectable item(s).