The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Code Critic Changes

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Code Critic Changes Posted: Jan 17, 2009 9:46 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Code Critic Changes
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Cincom Smalltalk Blog - Smalltalk with Rants

Advertisement

I hadn't really noticed, but there were some changes to the code critic between VW 7.5 and 7.6. Here are two screenshots - the first being 7.5, the second being 7.6:

You'll notice that the "Miscellaneous" category is missing in 7.6, and, if you look through and compare, there's been a general reorganization. It's also the case that four checks have been deprecated, amongst them the "long method" check. I'm not claiming that these are great checks; for instance, the "long methods" check calls anything over 10 lines "long" - kind of a subjective thing.

Having said that, I recently received a question from a colleague, who was relaying a concern from an academic customer. For teaching purposes, he liked the "long methods" check. So the question arose, how do you bring those rules back into play? As it happens, it's not hard - you need to make two small changes

First, modify BasicLintRule class>>protocols to look like this:


protocols
	^ OrderedCollection new
		add: ( #Bugs << #browser >> 'Bugs' ) -> 'bugs';
		add: ( #PossibleBugs << #browser >> 'Possible bugs' ) -> 'possible bugs';
		add:
			( #UnnecessaryCode << #browser >> 'Unnecessary code' ) ->
					'unnecessary code';
		add:
			( #IntentionRevealing << #browser >> 'Intention revealing' ) ->
					'intention revealing';

		add: (#Miscellaneous << #browser >> 'Miscellaneous') -> 'miscellaneous';
		yourself

That's almost enough. Now you need to go to class BlockLintRule and rename the protocol category "deprecated" to "miscellaneous". Alternatively, you could just use the name "deprecated" in the #protocols method above and leave everything else alone. After doing that, you'll see this in 7.6:

In general, if you want to add new rules you can look in class BlockLintRule - the class methods are the rules, and the categories are the rule category names that show up in the Code Critic tab of the browser.

Technorati Tags: , ,

Read: Code Critic Changes

Topic: Phillippe Marshcall on Deploying Smalltalk Apps Previous Topic   Next Topic Topic: Website Bounciness

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use