Jump to content

comprehensive project metrics


Recommended Posts

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?
 

  • Like 1
Link to comment

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.

Link to comment

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.  

Link to comment

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.

post-28229-0-37297400-1437403010.png

  • Like 1
Link to comment

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 by ensegre
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.