简体   繁体   中英

Code analysis naming rules in Visual Studio 2012/2013

I am using German Visual Studio Professional 2012 and 2013 on a German Windows 7. According to the MSDN documentation (eg http://msdn.microsoft.com/de-de/library/ms182240.aspx , http://msdn.microsoft.com/de-de/library/bb264474.aspx etc) I would expect that this code

class myClass // Complete nonsense 
{ // - I only want to raise code analysis naming rules violations 
    public int addintegers(int a, int b)
    {
        checksum++; ;
        multipart++;

        int Sum = a + b;
        return (Sum);
    }
    static int X = 1;
    static int x = 2;
    int checksum;
    int multipart;

    public static int addplus(int y)
    {
        return x + X +y;
    }

will generate several code analysis warnings when I select the ruleset "Microsoft All Rules". However, I get no name rules violations in the code analysis.

Can someone please tell me what I missed? Thanks.

You only get Naming Rule violations on public types. It assumes you don't really care about internal code, only about your public types that other people may consume.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM