CodeQL documentation

Lines of commented-out code in files

ID: js/lines-of-commented-out-code-in-files
Kind: treemap
Severity: 
Precision: 
Tags:
   - maintainability

Click to see the query in the CodeQL repository

This metric counts the number of lines of commented-out code in each file. Large amounts of commented-out code often indicate poorly maintained code.

Example

In the following example, a console.log method call, perhaps originally used for debugging, is left in the code, but commented out. It should be removed altogether.

function area(r) {
	// console.log("Got r: " + r);
	return r.length * r.width;
}

References