Here is some data which I wanted to share.
Property keys and their occurrence in java(but not Test.java), jsp,
ftl and rptdesign(BIRT) files from the code base
http://pastebin.com/raw.php?i=zHsugL9j (csv format)
Properties seems problematic to me. excluded these from search
http://pastebin.com/raw.php?i=23cLRtwz
Code
http://pastebin.com/raw.php?i=pKQLAzRw
I am not going remove anything yet. I have some more things to check
before giving any conclusion.
I am just opening a discussion for more inputs.
Cheers
Udai
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
Mifos-developer mailing list
mifos-d...@lists.sourceforge.net
Unsubscribe or change settings at:
https://lists.sourceforge.net/lists/listinfo/mifos-developer
>From the subject heading I am gathering that your main point is that
2000+ out of 7000~ properies are not being used in application. I am
not that surprised by this. Clearly its not ideal and I can see that
this would be a pain for the likes of niklas as they will end up
translating properties not even used in some cases.
The ones we know for certain being used are the ones used by .ftl files (newer).
Of the older property files, some of these maybe completely obsolete
due to UI refactoring but its hard to say. Does your analysis indicate
which property files are no longer in use in the application and what
properties in each file are not in use also?
Note: There is some work that could be done that would allow for a
number of legacy .jsp ==> property files to be removed. At present the
only 'product' related screen left for 'move to .ftl' is the loan
product screen (create, read,update)
see http://mifosforge.jira.com/browse/MIFOS-4465
doing this makes it easy to do MIFOS-4466
There also a number of bugs and suggested improvements around the loan
product screeen
query using the following: "project = MIFOS AND component = "Product
Definition" AND resolution = Unresolved ORDER BY key DESC" in jira
Keith.
Yes, and we want to do this cleanup.
> Of the older property files, some of these maybe completely obsolete
> due to UI refactoring but its hard to say. Does your analysis indicate
> which property files are no longer in use in the application and what
> properties in each file are not in use also?
The program does a simple string search among files in code base to
find the occurrence of properties which are well in namespace
"admin.role.create.instruction", it ignores one word properties(key)
like "click", "submit". There are about 100+ properties which are one
word and makes it hard to say whether those are being used or not just
by a simple search.
But, leaving those 100+ properties there are around 7000+ properties
out of which 2000+ had 0 occurrence.
The link I have mentioned in my prev mail has occurrence data. eg.
AdminResourceUI, admin.role.create.instruction, 10
which means "admin.role.create.instruction" property from
AdminResourceUI.properties is found to be used at 10 places.
I am still trying to make sense out of that, we store some labels in
the database.
I will spend some more time and find out what other ways those 2000+
properties might be used which are not captured by the simple search.
I started looking into this when I saw lot's of questions on TWN about
properties which were not being used.
> Note: There is some work that could be done that would allow for a
> number of legacy .jsp ==> property files to be removed. At present the
> only 'product' related screen left for 'move to .ftl' is the loan
> product screen (create, read,update)
>
> see http://mifosforge.jira.com/browse/MIFOS-4465
>
> doing this makes it easy to do MIFOS-4466
>
> There also a number of bugs and suggested improvements around the loan
> product screeen
I agree, I think that dead code(jsp) from spring/ftl migration can be
one problem.
I also think that there should be some conventions about the property
key namespace
- key should be well defined e.g. "admin.role.create.instruction" (not
just simple one word like create, submit)
- key should be > 10 but < 100 chars
- key should not contains special characters like &, (), ', or , (link
in the previous mail to such properties)
- property files name should be camelCase instead of under_score to
keep things consistent.
> I also think that there should be some conventions about the property
> key namespace
> - key should be well defined e.g. "admin.role.create.instruction" (not
> just simple one word like create, submit)
> - key should be > 10 but < 100 chars
> - key should not contains special characters like &, (), ', or , (link
> in the previous mail to such properties)
> - property files name should be camelCase instead of under_score to
> keep things consistent.
Seem like a sensible list of guidelines around properties.
> Yes, and we want to do this cleanup.
Cleaning this up would be a good thing for sure but is it more
important than other things outstanding on the project. I am not
trying to dissuade you from this but just trying to understand where
the urgency has come from to do this?
Keith.
Thanks for pointing out JSR 303 validation properties. I will check
those. It's good to have more eyes, although I am not going to remove
anything without actually making sure that it is not being used at
all.
Cheers,
I get your point. I agree those issue have to be fixed at some point
which is more important.
Heh, I was thinking the same thing.
I'm crossing my fingers for this one too!
Dead code slows down development. Translations are part of development.
Although I would have to make sure that I am completely right, I would
appreciate more eyes on the results.
This code can detect and delete(disabled) the properties which are not
being used.
http://pastebin.com/KDh4JXJk
I am hoping that this way we would be able to automate deletion of
properties while throwing out the jsp/struts code.
There are around 500 properties which are excluded from this search
because of their nature which makes it difficult to include in search
(include JSR303 properties mess)
http://pastebin.com/Pk4jHGev
Apart from that I have very few strings which qualify for the
translation properties but doesn't makes any sense.
e.g. line # 1 of LoanUIResources.properties
Cheers,