vs2k5 Beta2 'Code Analysis' returns warnings on generated code

D

dbuchanan

I built a simple Data Access Layer with the Visual Studio 2005 DataSet
Designer using the wizard. All who I have talked to who use it,
articles I haver read by those who use it speak very highly about the
quality of code that vs2005 creates.

Before adding any code of my own I ran "Code Analysis" (from debug
menu) against the code and got (no errors but) 90 warnings!

I know nothing about the "Code Analysis" and can find nothing in the
help. Some of the warnings are just good suggestions that the user
should consider based on best coding practice and the users intension
for the code such as;

Warning 4 CA2210 : Microsoft.Design : Sign 'NorthwindDataAccess'
with a strong name key. 1

Other warnings point out things I think the Wizard should have handled;


Warning 42 CA1804 : Microsoft.Performance :
EmployeesTableAdapter.GetData(Nullable`1<System.Int32>):EmployeesDataTable
declares a local, 'GetData', of type
NorthwindDataAccess.EmployeeDataSet+EmployeesDataTable, which is never
used or is only assigned to. Use this local or remove it.
C:\Documents and Settings\Administrator\My Documents\Visual Studio
2005\Projects\NorthwindDataAccess\NorthwindDataAccess\EmployeeDataSet.Desig­ner.vb
1229 NorthwindDataAccess

More Examples:

Warning 10 CA1801 : Microsoft.Performance : The 'this' parameter
(or 'Me' in VB) of EmployeeDataSet.ShouldSerializeEmployees():Boolean
is never used. Mark the method as static (or Shared in VB) or use
'this'/Me in the method body. C:\Documents and
Settings\Administrator\My Documents\Visual Studio
2005\Projects\NorthwindDataAccess\NorthwindDataAccess\EmployeeDataSet.Desig­ner.vb
188 NorthwindDataAccess

Warning 48 CA1709 : Microsoft.Naming : Correct the casing of
parameter name 'LastName'. C:\Documents and
Settings\Administrator\My Documents\Visual Studio
2005\Projects\NorthwindDataAccess\NorthwindDataAccess\EmployeeDataSet.Desig­ner.vb
1333 NorthwindDataAccess

Warning 89 CA1706 : Microsoft.Naming : 'Id' is an abbreviation and
therefore is not subject to acronym casing guidelines. Correct the
capitalization of 'ID' in parameter name 'EmployeeID' by changing it to
'Id'. C:\Documents and Settings\Administrator\My Documents\Visual
Studio
2005\Projects\NorthwindDataAccess\NorthwindDataAccess\EmployeeDataSet.Desig­ner.vb
1460 NorthwindDataAccess

Can anyone who knows more about this comment on this feature and the
results I am getting.

Thank you,
dbuchanan
 
D

David Browne

dbuchanan said:
I built a simple Data Access Layer with the Visual Studio 2005 DataSet
Designer using the wizard. All who I have talked to who use it,
articles I haver read by those who use it speak very highly about the
quality of code that vs2005 creates.

Before adding any code of my own I ran "Code Analysis" (from debug
menu) against the code and got (no errors but) 90 warnings!
. . ..

Auto-generated code is exempt from code review. You should ignore the
results of code analysis for generated code.

David
 
D

dbuchanan

But many projects will contain auto-generated code. Code analysis on
those projects would return a big volumn of results. Then I would have
the huge and discouraging task of sifting through the important and
ignoring the results form auto generated code.

Is there any easy way to turn of results from auto-generated code?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top