CS.LA_UNUSED
Unused label.
The LA_UNUSED checker finds unused labels.
Vulnerable code example
Copy
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 flags that label 'a' is not used.