C#


CSHARP.ID.STYLE : Naming Style Violation (C#)

要旨

A class, method, field, or parameter is named in a non-standard way.

Class and method names in .Net are traditionally written in a standard way, based on pascal case. The names of classes and methods start with a capital letter, while the names of fields can start with a capital letter or small letter respectively if the field is public or not. In particular, a method should not be called as the same class where it is defined, since it might be misunderstood as a constructor. Moreover, a class should not be named as one of its superclasses or superinterfaces, up to the package name, since this can introduce confusion and, potentially, bugs.

プロパティ

クラス名 Naming Style Violation (C#)
日本語クラス名 Naming Style Violation (C#)
クラス分類 スタイル (style)
ニーモニック CSHARP.ID.STYLE
カテゴリー
CWE CWE:710 Improper Adherence to Coding Standards
対応言語 C# で利用可能です。
有効/無効設定 このワーニングクラスのチェックはデフォルトで無効になっています。チェックを有効にするにはプロジェクト設定ファイル (configuration file)に以下の WARNING_FILTER ルールを追加してください。
WARNING_FILTER += allow class="Naming Style Violation (C#)"

解決法

Modify the name in order to comply to the standard. In particular, avoid methods or fields starting with a capital letter, unless they are constants.

関連のある設定ファイルパラメータ

設定ファイルの以下のパラメータがこのワーニングクラスのチェックに影響します。