[squeak-dev] Re: SwaLint

Mariano Martinez Peck marianopeck at gmail.com
Tue Mar 3 22:08:17 UTC 2009


>
>
>>
>> Ahh I have some questions:
>>
>
>  1) I see there is one test that checks the "length" of a method. I like to
>> document and put all the necessary comments in my tests. So, in many tests,
>> I get "long method" but actually most of those methods are comments with "".
>> So, the questions is, can be comments ignored in this test?
>>
>
> In fact, we included comments intentionally. Albeit,



> I do not understand the "" command idea (please help me there).
>

Sorry. What's what you don't understand ? I dont' understand what you didn't
understand hahaaha. I give you an exampple (the firstone I found):

<code>
executeDDLScript: aDDLScript
"Its very common you need to execute a complete DDL script: create, drop or
alter tables. In these cases, you don't have any interesting results from
each query. In such a case, you should use this method. Remember SqueakDBX
doesn't do any translation so your statement delimiter must be understood by
the backend. In order to know which delimiter we use, you can see the
message queryDelimiter of the current platform backend, for example
DBXPostgresPlatform.
This message doesn't use the multistatements option of openDBX, it is all
done by SqueakDBX so you don't have to care about it''"

    | ddlStatements |
    ddlStatements := aDDLScript findTokens: self platform queryDelimiter.
    ddlStatements
        do: [:ddlStatement | self execute: ddlStatement]
 </code>




> Our reasoning was, commets normally serve the purpose of clarifying code,
> thus, if they were ommited, the code would not be easily understandable.
> Therefore, we treat comments as code. IIRC, we assumed an "averagne" of 7
> LOC per method in the beginning.


I am not totaly agree, bt doesn't matter. Very clear your answer,


>
>
>> 2) I think when you have take care of the results and analyse them to fix
>> them, the common way doing this is going test for test. So, It would be
>> fantastic being able to browse a test. And when you do this, this browse,
>> takes all the classes that has occurrences. Example: "long methods" , right
>> button, "browse all". And this opens the browser with all the classes that
>> has the long method occurrences.
>>
>
> Ok, this might be useful. Did I got this right there? You'd like to right
> click on the test group and browse all of them?


EXACTLY. I don't know if was just me, but actually that was my way of
resolving the issues. Go test after test, and browsing for each one all the
classes. Perhaps, I am the only one, so, It just doesn't worth it.

>
> Currenetly, you can select multiple (or one, depending on your personal
> settings) "occurences" of test results and
> right-click -> browse them all.


Exactly. For all of test I did that. I don't know it was the esasiest way.
So, because of this, I imagine 2)   :)

>
> By the way, you can sort the results pane by class, too. Then you can have
> a look at what classes are most affected by
> the tests selected.
>
>>
>>
>> 3) What does "Data class" mean ? are all the test detailed deeply
>> somewhere ? like a webpage, wiki, or just SwaLint browser ?
>>
>
> This notion has been taken from Michele Lanza's and Radu Marinescu's nice
> book "Object-Oriented Metrics in Practice".
> If you like to see the underlying metrics used to "calculate" the Data
> class, just enable them in the Preferences. You will
> notice, that they are named after the ones described in the book.
> Our mechanism of reusing results allows for simple creation of new Test
> Plugins. Just play around with them.
> There has been plans to cover all Metrics described in the book, however,
> time is short and I'll be able to Implement them not before summer, I
> presume.
>

Ok, perfect. Thanks!


>
> As you mention the Wiki, I'm looking forward to bring it up aroung mid
> March, again, or late March, depending on how my new server is running.


Excellent news!

>
>
>>
>> 4) What does "Dot after return consistency" mean ? I don't understand the
>> % and when it is average, low or high.
>>
>
> Oh that's a nice one :)
> This is a Style tests. It simply tests, how many returns are written
>
> ^ anObject aMessage
>
> and how many are written
>
> ^ anObject aMessage.
>
> Where 100% is "all with" and 0% "all without" dot after return.
> Thus, 50% is the worst value you can get in this test, as it implies, that
> every second return statement
> is written in the opposing style.
>
>>

and are there some differences between both ways? I mean, a real difference
? or just to do it the same way in all the code ?


>
>>
>> Thanks a lot.
>>
>
> You're welcome.
>
>>
>>
> Have a nice day
>        -Tobias
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20090303/f2764c0e/attachment.htm


More information about the Squeak-dev mailing list