CodeQL library for C#
codeql/csharp-all 0.9.0 (changelog, source)
Search

Module Completion

INTERNAL: Do not use.

Provides classes representing control flow completions.

A completion represents how a statement or expression terminates.

There are six kinds of completions: normal completion, return completion, break completion, continue completion, goto completion, and throw completion.

Normal completions are further subdivided into Boolean completions and all other normal completions. A Boolean completion adds the information that the expression terminated with the given boolean value due to a subexpression terminating with the other given Boolean value. This is only relevant for conditional contexts in which the value controls the control-flow successor.

Goto successors are further subdivided into label gotos, case gotos, and default gotos.

Import path

import semmle.code.csharp.controlflow.internal.Completion

Imports

csharp

The default C# QL library.

Predicates

assertionCompletion

Gets a valid completion when argument i fails in assertion a.

foreachEmptiness

Holds if cfe is the element inside foreach statement fs that has the emptiness completion.

switchMatching

Holds if pe is the pattern inside case c, belonging to switch s, that has the matching completion.

Classes

BooleanCompletion

A completion that represents evaluation of an expression with a Boolean value.

BreakCompletion

A completion that represents evaluation of a statement or an expression resulting in a break (in a loop or in a switch statement).

Completion

A completion of a statement or an expression.

ConditionalCompletion

A completion that represents evaluation of an expression, whose value determines the successor. Either a Boolean completion (BooleanCompletion), a nullness completion (NullnessCompletion), a matching completion (MatchingCompletion), or an emptiness completion (EmptinessCompletion).

ContinueCompletion

A completion that represents evaluation of a statement or an expression resulting in a loop continuation (a continue statement).

EmptinessCompletion

A completion that represents evaluation of an emptiness test, for example a test in a foreach statement.

ExitCompletion

A completion that represents evaluation of a statement or an expression resulting in a program exit, for example System.Environment.Exit(0).

FalseCompletion

A Boolean false completion.

GotoCompletion

A completion that represents evaluation of a statement or an expression resulting in a goto jump.

MatchingCompletion

A completion that represents matching, for example a case statement in a switch statement.

NestedBreakCompletion

A nested completion for a loop that exists with a break.

NestedCompletion

A nested completion. For example, in

NormalCompletion

A completion that represents normal evaluation of a statement or an expression.

NullnessCompletion

A completion that represents evaluation of an expression that is either null or non-null.

ReturnCompletion

A completion that represents evaluation of a statement or an expression resulting in a return from a callable.

SimpleCompletion

A simple (normal) completion.

ThrowCompletion

A completion that represents evaluation of a statement or an expression resulting in a thrown exception.

TrueCompletion

A Boolean true completion.