vs2005 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.Designer.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.Designer.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.Designer.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.Designer.vb 1460 NorthwindDataAccess



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

Thank you,
dbuchabab
 
C

Cor Ligthert [MVP]

dbuchanan,

Not to sent you from this newsgroup. However in my opinon is your question
exactly one which is nice for the newsgroup.

microsoft.public.dotnet.framework.adonet.

I wished you had crossposted it to that newsgroup in one time, while you
sent it to this newsgroup, because it is interesting of course as well for
this newsgroup.

Cor
 

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