Skip to main content

SA0163:ネストされたコメント

ネストされたコメントを検出します。

理論的根拠:ネストされたコメントは読みにくいため、避ける必要があります。

重要度:低

PLCopenルール:C3

121.
{attribute 'do-analysis'}
(* That is
(* nested comment 1 *)
*)
PROGRAM PLC_PRG
VAR
(* That is
// nested comment 2
comment *)
    iVal1: INT;
    iVal2: INT;

(* That is
(* nested comment 3 *) *)
    pVal3: POINTER TO DWORD;
    hugo: INT;
END_VAR
(* That is
// nested comment 4
comment *)
iVal1 := iVal1 + 1;
(* That is
(* nested comment 5 *)
*)

(* Not that one *)

での出力 メッセージ ビュー:

  • sa_icon_message.png SA0163: ネストされたコメント 'ネストされたコメント 1'

  • sa_icon_message.png SA0163: ネストされたコメント 'ネストされたコメント 2'

  • sa_icon_message.png SA0163: ネストされたコメント 'ネストされたコメント 3'

  • sa_icon_message.png SA0163: ネストされたコメント 'ネストされたコメント 4'

  • sa_icon_message.png SA0163: ネストされたコメント 'ネストされたコメント 5'