.NAME Commented out sections of code

.DESCRIPTION
Sections of code should not be "commented out" using 
C++ comments. 

.COMMENT V7.0

.SEVERITY Advisory

.COMMENT
Please refer to the MISRA C++:2008 document for further details (www.misra-cpp.com)

.COMMAND r_tcl_checker

.CODE
variable possibleCharsForStatements
set possibleCharsForStatements  [list + - * / = \%]

# reading all file and looking for comments
proc compute {standardName filename} {
	variable CurrentParameterList
	variable possibleCharsForStatements

	if { "$CurrentParameterList" == "" } {
		set CurrentParameterList 1
	}
	set chan [open $filename]
	set numLine 0
	set pos 0
	while {[gets $chan line] >= 0} {
		incr numLine
		if { [regexp {^.*?//(.*)$} $line beg str] } {
			set vio 0
			set nb 0
			set virg 0
			for { set i 0 } { $i < [string length $str] } { incr i } {
				if { [lsearch $possibleCharsForStatements [string range $str $i $i]] >= 0 } {
					incr nb
				}
				if { "[string range $str $i $i]" == ";" } {
					set virg 1
				}
			}
			if { $virg && $nb >= $CurrentParameterList } {
				set vio 1
			} else {
				if { [regexp {(for|while|switch|if)\s*\(} $str] } {
					set vio 1
				}
			}
			if { $vio } {
				set end [expr $pos + [string length $line] - 1]
				Violation $filename $pos $end $numLine $standardName "Code in comments not allowed"
			}
		}
		incr pos [string length $line]
		incr pos
	}
	close $chan
}
