JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.
If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.
If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.
| CodeSonar® 9.0p0 Hot Tips | CONFIDENTIAL | CodeSecure Inc |
識別子がプロジェクトに適用された IDENTIFIER_NAMING_* ルールによって表現されたスタイルガイド・命名規則に準拠していません。
本ワーニングクラスでは、ユーザーは独自のルールを指定することも可能であり、または barr_naming preset を使用して Barr Group Embedded C Coding Standard の命名規則に対応する一連のルールを適用することも可能です。
デフォルト設定で適用されているルールはありません(つまり、 IDENTIFIER_NAMING_* パラメータの出荷時設定はなく、そして CodeSonar の出荷時状態から用意されている default presets 内でも IDENTIFIER_NAMING_* のルールは設定されていません。)。 これが意味することとして、独自のルールを指定しない、または適切なプリセットを有効化せずにこのワーニングクラスを有効にしても、警告(ワーニング)は表示されません。
| クラス名 | Naming Style Violation | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 日本語クラス名 | 命名規則違反 | ||||||||||||
| クラス分類 | スタイル (style) | ||||||||||||
| ニーモニック | LANG.ID.STYLE | ||||||||||||
| カテゴリー |
|
||||||||||||
| 対応言語 | C および C++ で利用可能です。 |
||||||||||||
| 有効/無効設定 | このワーニングクラスのチェックはデフォルトで無効になっており、プロジェクトには非正規の C向けAST
が必要になります。有効にするにはプロジェクト設定ファイル (configuration file) に以下の WARNING_FILTER ルールと
RETAIN_UNNORMALIZED_C_AST 設定を追加してください。
RETAIN_UNNORMALIZED_C_AST = Yes WARNING_FILTER += allow class="Naming Style Violation" |
すべてのクラス名はキャメルケースでなければならないという組織全体のスタイルルール・命名規則があることを仮定します。 たとえば、クラスの名前を MyClass にすることはできますが、myClass や myclass にすることはできません。.
全てのクラス名がこの規則に準拠していることを確認するには、次の IDENTIFIER_NAMING_CLASS_CASE エントリを適切な configuration file に追加して下さい。 組織内の横断的な規則の場合には、全てのプロジェクトで常に規則準拠の確認ができるよう、 general template configuration file に追加する、 若しくは組織レベルでチェックされるべき全ての規則を含んだ custom preset か default preset を作成します。
IDENTIFIER_NAMING_CLASS_CASE = CamelCase
Naming Style Violation の検出が有効となっていて、IDENTIFIER_NAMING_CLASS_CASE ルールが指定されている場合、 CodeSonar は次の警告(ワーニング)を発行します。
class A { // ok: camel case according to definition ^[A-Z][a-zA-Z0-9]*
// ...
};
class Capitalized { // ok: camel case according to definition ^[A-Z][a-zA-Z0-9]*
// ...
};
class Capitalizedmultiword { // ok: a human reader might object to the interior words not being
// individually capitalized, but the warning class check is syntactic only
// ...
};
class CamelCase { // ok: classic camel case
// ...
};
class UPPERCASE { // ok: camel case according to definition ^[A-Z][a-zA-Z0-9]*
// ...
};
class lowercase { // 'Naming Style Violation' warning issued here
// ...
};
class camelBack { // 'Naming Style Violation' warning issued here
// ...
};
class Camel_Snake { // 'Naming Style Violation' warning issued here
// ...
};
class camel_Snakeback { // 'Naming Style Violation' warning issued here
// ...
};
class mIxEd_cAse { // 'Naming Style Violation' warning issued here
// ...
};
int foo;
設定ファイルの以下のパラメータがこのワーニングクラスのチェックに影響します。