- 필수 기능
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- 디지털 경험
- 소프트웨어 제공
- 보안
- 로그 관리
- 관리
- 인프라스트럭처
- ci
- containers
- csm
- ndm
- otel_guides
- overview
- slos
- synthetics
- tests
- 워크플로
ID: csharp-code-style/variable-naming-conventions
Language: C#
Severity: Notice
Category: Code Style
Variable names should follow the camelCase
pattern and start with a lowercase letter, except for private and protected fields that should start with _
.
class My_Class {
int MyVariable = 10;
public void foo() {
int FooBar = 14;
DateTimeOffset t1 = TimeZoneInfo.ConvertTime();
}
}
public class CertificateHelperTests {
private const string PemCertPublic = "";
}
class My_Class {
int _myVariable = 10;
[TestMethod]
public void BooleanToIntegerConverterTest()
{
var converter = new BooleanToIntegerConverter
{
ValueOnTrue = 1,
ValueOnFalse = 2
};
Assert.AreEqual(1, converter.Convert(true, typeof(int), null, null));
Assert.AreEqual(2, converter.Convert(false, typeof(int), null, null));
}
}
class My_Class {
int myVariable = 10;
}
|
|
For more information, please read the Code Analysis documentation
Identify code vulnerabilities directly in yourVS Code editor
Identify code vulnerabilities directly inJetBrains products