Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 317577

Summary: Proposal for a new Facet on kdm.source : lines of code computing
Product: [Modeling] MoDisco Reporter: Fabien Giquel <fabien.giquel>
Component: InfrastructureAssignee: Nicolas Bros <nicolas.bros>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: gdupe, hugo.bruneliere, modisco.web-inbox, nicolas.bros
Version: 0.9.0Flags: nicolas.bros: indigo+
fabien.giquel: review+
Target Milestone: 0.9.0 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 317733    
Bug Blocks:    
Attachments:
Description Flags
MoDisco Plug-in with Facet and Queries to count lines in KDM InventoryItems
none
MoDisco Plug-in with Facet and Queries to count lines in KDM InventoryItems (v2)
none
MoDisco Plug-in with Facet and Queries to count lines in KDM InventoryItems (v3) none

Description Fabien Giquel CLA 2010-06-22 09:27:17 EDT
The kdm.source discoverer allows to have a representation of files/folders for one specific container, differentiating binary and not-binary files.

Computing lines of code number is a simple and a recurrent need whatever the source languages used.
Many metrics tools proposes such a feature but are not always straightforward to install or use.

It would be easy-to-do and convenient to have a facet on kdm.source metamodel to add some number of lines display.
We may compute it on SourceFile, ConfigurationFile and InventoryContainer (sum of sub elements).
We may imagine several counting (with or without blank lines, ...).
Comment 1 Nicolas Bros CLA 2010-07-05 04:57:21 EDT
Created attachment 173393 [details]
MoDisco Plug-in with Facet and Queries to count lines in KDM InventoryItems
Comment 2 Nicolas Bros CLA 2010-07-06 06:03:52 EDT
Created attachment 173522 [details]
MoDisco Plug-in with Facet and Queries to count lines in KDM InventoryItems (v2)

I had forgotten to internationalize the Manifest. I fixed it and a few other things in this new zip.
Comment 3 Fabien Giquel CLA 2010-07-06 11:58:08 EDT
Thanks for this contribution.
It works fine on files (sourcefile, configuration).
But there  is missing the count on InventoryContainer.
Comment 4 Nicolas Bros CLA 2010-07-07 05:03:01 EDT
Created attachment 173626 [details]
MoDisco Plug-in with Facet and Queries to count lines in KDM InventoryItems (v3)

Here is a new version, which computes counts recursively on InventoryContainers.
I also factorized the code and added a singleton cache to avoid parsing the same file several times.
Comment 6 Hugo Bruneliere CLA 2010-10-04 13:46:03 EDT
Contribution integrated.