vs2005 beta2 'Code Analysis' returns warnings on generated code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dbuchanan

    #1

    vs2005 beta2 'Code Analysis' returns warnings on generated code

    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.Desig n : Sign 'NorthwindDataA ccess' with a
    strong name key. 1

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


    Warning 42 CA1804 : Microsoft.Perfo rmance :
    EmployeesTableA dapter.GetData( Nullable`1<Syst em.Int32>):Empl oyeesDataTable
    declares a local, 'GetData', of type
    NorthwindDataAc cess.EmployeeDa taSet+Employees DataTable, which is never
    used or is only assigned to. Use this local or remove it. C:\Documents
    and Settings\Admini strator\My Documents\Visua l Studio
    2005\Projects\N orthwindDataAcc ess\NorthwindDa taAccess\Employ eeDataSet.Desig ner.vb 1229 NorthwindDataAc cess

    More Examples:

    Warning 10 CA1801 : Microsoft.Perfo rmance : The 'this' parameter (or
    'Me' in VB) of EmployeeDataSet .ShouldSerializ eEmployees():Bo olean is
    never used. Mark the method as static (or Shared in VB) or use
    'this'/Me in the method body. C:\Documents and
    Settings\Admini strator\My Documents\Visua l Studio
    2005\Projects\N orthwindDataAcc ess\NorthwindDa taAccess\Employ eeDataSet.Desig ner.vb 188 NorthwindDataAc cess


    Warning 48 CA1709 : Microsoft.Namin g : Correct the casing of parameter
    name 'LastName'. C:\Documents and Settings\Admini strator\My
    Documents\Visua l Studio
    2005\Projects\N orthwindDataAcc ess\NorthwindDa taAccess\Employ eeDataSet.Desig ner.vb 1333 NorthwindDataAc cess


    Warning 89 CA1706 : Microsoft.Namin g : '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\Admini strator\My Documents\Visua l
    Studio
    2005\Projects\N orthwindDataAcc ess\NorthwindDa taAccess\Employ eeDataSet.Desig ner.vb 1460 NorthwindDataAc cess



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

    Thank you,
    dbuchabab

  • Cor Ligthert [MVP]

    #2
    Re: vs2005 beta2 'Code Analysis' returns warnings on generated code

    dbuchanan,

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

    microsoft.publi c.dotnet.framew ork.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


    Comment

    • Cor Ligthert [MVP]

      #3
      Re: vs2005 beta2 'Code Analysis' returns warnings on generated code

      [color=blue]
      > sent it to this newsgroup[/color]

      sent it to that newsgroup


      Comment

      Working...