W3C home > Mailing lists > Public > public-qa-dev@w3.org > December 2006

Re: [css-validator] counting listed warnings

From: Jean-Guilhem Rouel <jean-gui@w3.org>
Date: Thu, 14 Dec 2006 10:57:43 -0500
Message-ID: <45817477.7000007@w3.org>
To: olivier Thereaux <ot@w3.org>
Cc: QA Dev <public-qa-dev@w3.org>, Philippe Le Hegaret <plh@w3.org>, Sijtsche Smeman <sijtschesmeman@wanadoo.nl>


Another suggestion would be to produce a warning only if its level 
corresponds to what the user asked. That would avoid the computation of 
a lot of warnings and a simple warnings.size() (or something like that) 
would be enough to get the number of warnings.


olivier Thereaux a écrit :
> Hello Java gurus,
> I have a small question with the CSS validator I think some of you may 
> be able to enlighten me about.
> Context: in recent changes to formatting and styling of CSS validator 
> results, we've made the warnings (and validated stylesheet) invisible 
> and toggle-able.
> see: 
> http://qa-dev.w3.org:8001/css-validator/validator?uri=http%3A%2F%2Fwww.w3.org%2F 
> I think it would be much better, in terms of UI, to have:
> * _Warnings (12)_
> instead of:
> * _Warnings_
> My problem is that the only "number of warnings" currently available 
> through the Warnings class interface is the *total* number of warnings, 
> and unless the validator is running in "show all warnings" mode, this is 
> not the number we want to display.
> I would like to get the number of warnings currently listed, i.e the 
> number of warnings up to a certain level.
> I have looked at a few ways this could be achieved, can you tell me 
> which is the best way, or suggest better, and if possible help with code?
> 1) I first thought of just counting them within the produceWarning() 
> routine in org/w3c/css/css/StyleSheetGeneratorHTML2.java, and pass that 
> to the "general" properties variable, but due to how produceWarning() is 
> called, it doesn't work.
> 2) Another idea would be to create another routine, similar to 
> produceWarning(), which would just be called around line 465 in 
> org/w3c/css/css/StyleSheetGeneratorHTML2.java, and do the counting. But 
> that sounds a bit daft, duplicating code like that.
> 3) Lastly, I thought the cleanest way would probably be to add new 
> properties and methods to the Warnings class 
> (org/w3c/css/util/Warnings.java), allowing it to count no just the 
> number of all warnings but also the number of warnings per level. It 
> seems like the cleanest way, but perhaps overkill?
> Thoughts, and help, welcome.
> (and apologies in advance if what I'm saying is heretic in Java - I am 
> not a Java coder... :) )
> Thank you.
> --olivier

Jean-Guilhem Rouel                    http://www.w3.org/People/Jean-Gui
W3C Webmaster   MIT/CSAIL             http://www.w3.org/
Voice: +1.617.258.8143                Fax: +1.617.258.5999
Received on Thursday, 14 December 2006 15:58:18 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:36:26 UTC