ensegre Posted July 20, 2015 Report Share Posted July 20, 2015 I was wondering -- I would be curious to get full metrics for my latest project -- including not only number of .vi, .ctl, .lvclass (these I can grep from the file list, or from ls -R * |grep \\\.vi | wc -l ), but also number of global variables and where used, list of unused project items, optionally some complexity metric for all vis, which vis are password protected, which are on which execution system, and whatnot. I suppose that it would be possible with a bit of effort to put together a script for that, but is there out somewhere something ready made? 1 Quote Link to comment
hooovahh Posted July 20, 2015 Report Share Posted July 20, 2015 Well there isn't a single solution. It sounds like what you want is a combination of tools, and will likely need something custom to meet your needs. It sounds like some of what you want can be understood with the VI Analyzer which is used to scan code for specific rule like no more than N local variables in a VI. There are several installed tests, and many extras online others have made. The code that runs these tests are in an LLB and you can probably copy it away and use it in your own scripting code. The project has several scripting functions, like getting all dependencies, and all dependencies that are of a specific type. (class, VI, etc). And the code complexity metric is an property node on a VI for Compiled.Code Complexity. I've used these tools in the past to generate pie charts showing how much code in a project comes from OpenG, or vi.lib or is written from scratch. Quote Link to comment
Jordan Kuehn Posted July 20, 2015 Report Share Posted July 20, 2015 I've used these tools in the past to generate pie charts showing how much code in a project comes from OpenG, or vi.lib or is written from scratch. That's an interesting thing to observe. I'm not entirely certain exactly what that would mean about code I've produced for a customer, but I might look into this. I think it may describe a great deal about the type of application. I could see creating similar amounts of code for two different applications and producing very different results according to this metric. Quote Link to comment
ensegre Posted July 20, 2015 Author Report Share Posted July 20, 2015 I see. Yes, maybe someday I'll play and will put together a tool of my taste. Indeed I see that to get odd vi properties is not difficult; I quickly put together the following as a proof of concept without bothering for recursive descending of the project hierarchy and item discrimination, maybe on some rainy day. 1 Quote Link to comment
ensegre Posted July 21, 2015 Author Report Share Posted July 21, 2015 (edited) Well, this is what I'm coming up with, I may later embellish it (for instance differentiate treatment of controls, globals, polymorphic). ETA: an improved version which treats VIs, controls, globals and reports some statistics, and on which items can be opened with double-click. LabviewProjectList-dda9fc0069d62440001862aad0be0301d4ed1f93.zip Edited July 23, 2015 by ensegre Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.