CS.LA_UNUSED

使用されていないラベル。

LA_UNUSED チェッカーは、使用されていないラベルを検出します。

脆弱コード例

コピー
  using System;
 using System.Security;
 using System.Security.Permissions;
 
 namespace TransparencyWarningsDemo
 {
 
     public class TransparentMethodsUseSecurityAssertsClass
     {
        public void test()
        {
             if(a) goto c;
             a=10;
             goto c;
             a: 
                 return x;
             c: 
                 return 0;
        }
     }
 }

Klocwork は、ラベル 'a' が使用されていないことにフラグを立てます。