CodeQL library for Java/Kotlin
codeql/java-all 0.8.12 (changelog, source)
Search

Class ConstSwitchStmt

A switch statement that always selects the same case.

Import path

import semmle.code.java.controlflow.UnreachableBlocks

Direct supertypes

Indirect supertypes

Predicates

getAFailingCase

Gets a case that never matches.

getMatchingCase

Gets the matching case, if it can be deduced.

getMatchingConstCase

Gets the ConstCase that matches, if any.

Inherited predicates

getACase

Gets a case of this switch statement, which may be either a normal case or a default.

from SwitchStmt
getAChild

Gets a child of this statement, if any.

from Stmt
getAConstCase

Gets a (non-default) constant case of this switch statement.

from SwitchStmt
getAPatternCase

Gets a (non-default) pattern case of this switch statement.

from SwitchStmt
getAPrimaryQlClass

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

from SwitchStmt
getAStmt

Gets an immediate child statement of this switch statement.

from SwitchStmt
getBasicBlock

Gets the basic block in which this statement occurs.

from Stmt
getCase

Gets the ith case of this switch statement, which may be either a normal case or a default.

from SwitchStmt
getCompilationUnit

Gets the compilation unit in which this statement occurs.

from Stmt
getControlFlowNode

Gets the ControlFlowNode corresponding to this statement.

from Stmt
getDefaultCase

Gets the default case of this switch statement, if any.

from SwitchStmt
getEnclosingCallable

Gets the immediately enclosing callable (method or constructor) whose body contains this statement.

from Stmt
getEnclosingStmt

Gets the statement containing this statement, if any.

from Stmt
getExpr

Gets the expression of this switch statement.

from SwitchStmt
getFile

Gets the file associated with this element.

from Top
getHalsteadID

This statement’s Halstead ID (used to compute Halstead metrics).

from SwitchStmt
getIndex

Gets the index of this statement as a child of its parent.

from Stmt
getLocation

Gets the source location for this element.

from Top
getMetrics

Cast this statement to a class that provides access to metrics information.

from Stmt
getNumberOfCommentLines

Gets the number of comment lines that this element ranges over.

from Top
getNumberOfLinesOfCode

Gets the number of lines of code that this element ranges over.

from Top
getParent

Gets the parent of this statement.

from Stmt
getPrimaryQlClasses

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

from Top
getStmt

Gets the immediate child statement of this switch statement that occurs at the specified (zero-based) position.

from SwitchStmt
getTotalNumberOfLines

Gets the total number of lines that this element ranges over, including lines of code, comment and whitespace-only lines.

from Top
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 Top
hasNullCase

Holds if this switch has a case handling a null literal.

from SwitchStmt
isNthChildOf

Holds if this statement is the child of the specified parent at the specified (zero-based) position.

from Stmt
pp

Gets a printable representation of this statement. May include more detail than toString().

from SwitchStmt
toString

Gets a textual representation of this element.

from SwitchStmt

Charpred