CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Raymond Lewallen

Framework Design, Agile Coach, President Oklahoma City Developers Group, Microsoft MVP C#, TDD, Continuous Integration, Patterns and Practices, Domain Driven Design, Speaker, VB.Net, C# and Sql Server

Where are all the custom FxCop rules?

So far, I've only been able to find three places that have custom FxCop rules that are based on the new introspection engine: here, here (both of those by John Robbins), and one by Tim Weaver here. If you go to the FxCop message boards, there are plenty of people talking about their custom rules, but nobody is posting them. GotDotNet even has a User Samples area for these things to go, but you won't find any custom rules for FxCop. So why aren't people sharing these? I've been patiently waiting for many many months on new rules for the introspection engine to come up on the internet, but they aren't to be found. Come on people, whats the deal? I would certainly like to import some rules somebody else has already written and tested. No, I'm not lazy, I'm just dilatory :)

Ok, so that said, no I don't have any custom FxCop rules to share. Mine use the old FxCop reflection engine and you don't want those. Am I going to have to write some new rules so that I can barter for somebody elses?

Update: Thanks to Darrell, who lead me to David, the latest versions of John Robbins' rules can be found here.

David has and updated set of rules here.

Currently listening to: Memory - Sugarcult


Comments

TrackBack said:

Where are all the custom FxCop rules?
# February 18, 2005 5:48 AM

TrackBack said:

# February 18, 2005 8:06 AM

Darrell said:

# February 18, 2005 8:07 AM

Jim Geurts said:

I wrote a "tutorial" of sorts for using the introspection engine... Included is a rule. Otherwise, all of the custom rules that I've written are at work in VSS :) I suppose I could write some more and give them away, though.

Anyway, here is the tutorial post: http://blogs.biasecurities.com/jim/archive/2004/12/29/818.aspx
# February 18, 2005 1:09 PM

TrackBack said:

# February 18, 2005 4:57 PM

TrackBack said:

# February 19, 2005 9:43 AM

TrackBack said:

# February 25, 2005 12:04 PM

Aarti said:

Hi -

I am trying to write a custom rule based on the rules you have provided above. What I need to do is make sure the save method of the business object always calls the IsValid method. Any ideas how I could accomplish this? I am not very familiar with the FXCop Introspection SDK. Any help is greatly appreciated.

Basically I would like to rule to say if the Save method does not have IsValid - throw an error.

Thanks,
Aarti.

Code:
public bool Save(DataSet entityModel)
{
IData employee = new Data.Employee();

employeeModel = entityModel as EmployeeModel;

if(IsValid())
{
employee.Save(employeeModel);
return true;
}
else
{
return false;
}
}

public bool IsValid()
{
employeeModel.Error.Rows.Clear();
EmployeeModel.EmployeeRow employeeRow = employeeModel.Employee.Rows[0] as EmployeeModel.EmployeeRow;

if(employeeModel.Error.Rows.Count <= 0)
{
return true;
}
else
{
return false;
}
}
# June 2, 2006 9:29 AM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About Raymond Lewallen

Working primarily in the public sector during his career, Raymond has designed and built several high profile enterprise level applications for all levels of the government. Raymond now works as a solutions architect for EMC. Raymond is an agile coach, Microsoft MVP C# and also president of the Oklahoma City Developers Group and Oklahoma Agile Developers Group. Raymond spends a lot of his time learning and teaching such things as Test Driven Development, Domain Driven Design, Design Patterns and Extreme Programming practices and principles, to name a few. Raymond is also an advocate of Alt.Net. Raymond is primarily a framework guy, so don't ask him anything about UI :) Check out Devlicio.us!