CodeQL library for C/C++
Search

Class CommentedOutCode

A piece of commented-out code, identified using heuristics

Import path

import Documentation.CommentedOutCode

Direct supertypes

Indirect supertypes

Inherited predicates

findRootCause

Gets the source of this element: either itself or a macro that expanded to this element.

from Element
fromLibrary

Holds if this element may be from a library.

from Element
fromSource

Holds if this element may be from source. This predicate holds for all elements, except for those in the dummy file, whose name is the empty string. The dummy file contains declarations that are built directly into the compiler.

from Element
getAPrimaryQlClass

Gets the name of a primary CodeQL class to which this element belongs.

from ElementBase
getCanonicalQLClass

DEPRECATED: use getAPrimaryQlClass instead.

from ElementBase
getComment

Gets the ith comment associated with this comment block.

from CommentBlock
getCommentedElement

Gets the AST element this comment is associated with. For example, the comment in the following code is associated with the declaration of j. int i; int j; // Comment on j

from Comment
getContents

Gets the text of this comment, including the opening // or /*, and the closing *``/ if present.

from Comment
getEnclosingElement

Gets the closest Element enclosing this one.

from Element
getFile

Gets the primary file where this element occurs.

from Element
getLine

Gets the contents of the i’th comment associated with this comment block.

from CommentBlock
getLocation

Gets the primary location of this element.

from Comment
getParentScope

Gets the parent scope of this Element, if any. A scope is a Type (Class / Enum), a Namespace, a BlockStmt, a Function, or certain kinds of Statement.

from Element
getPrimaryQlClasses

Gets a comma-separated list of the names of the primary CodeQL classes to which this element belongs.

from ElementBase
hasLocationInfo

Holds if this element is at the specified location. The location spans column startcolumn of line startline to column endcolumn of line endline in file filepath. For more information, see Locations.

from CommentBlock
isAffectedByMacro

Holds if this element is affected in any way by a macro. All elements that are totally or partially generated by a macro are included, so this is a super-set of isInMacroExpansion.

from Element
isCommentedOutCode

Holds if this comment block looks like code that has been commented out. Specifically: 1. It does not look like documentation (see isDocumentation). 2. It is not in a header file without any declaration entries or top level declarations. 3. More than half of the lines in the comment block look like code.

from CommentBlock
isDocumentation

Holds if the comment block is a C-style comment, and each comment line starts with a *.

from CommentBlock
isFromTemplateInstantiation

Holds if this Element is a part of a template instantiation (but not the template itself).

from Element
isFromUninstantiatedTemplate

Holds if this Element is part of a template template (not if it is part of an instantiation of template). This means it is represented in the database purely as syntax and without guarantees on the presence or correctness of type-based operations such as implicit conversions.

from Element
isInMacroExpansion

Holds if this element comes from a macro expansion. Only elements that are entirely generated by a macro are included - for elements that partially come from a macro, see isAffectedByMacro.

from Element
lastComment

Gets the last comment associated with this comment block.

from CommentBlock
numCodeLines

Gets the number of lines that look like code in the comments associated with this comment block.

from CommentBlock
numLines

Gets the number of lines in the comments associated with this comment block.

from CommentBlock
toString

Gets a textual representation of this element.

from Comment

Charpred