Skip to content

Commit

Permalink
added assert stmt
Browse files Browse the repository at this point in the history
  • Loading branch information
shivasurya committed Dec 1, 2024
1 parent 5ea5501 commit 86060a1
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions docs/src/content/docs/api/Entities/assertstmt.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: AssertStmt - Code-Pathfinder Reference | CodeQL Alternative
description: "AssertStmt Statement Entity - Code PathFinder API Index"
---
import PostHogLayout from '../../../../layouts/PostHogLayout.astro';
import { Badge } from '@astrojs/starlight/components';

<PostHogLayout>
</PostHogLayout>

### AssertStmt <Badge text="Entity" variant="tip" size="small" />

AssertStmt is a statement that asserts a condition.

#### Example
```java
class MyClass {
...
public void myMethod()
{
assert myLocalVariable == 1; // AssertStmt
}
....
}
```

### Attributes

| Entity | Description |
| ------------------------------ | ----------------------------------------------------------------------------------|
| GetAPrimaryQlClass() string | Returns the primary QL class name for the assert statement |
| GetHalsteadID() int | Returns the Halstead ID metric for complexity measurement of the assert statement |
| GetPP() string | Returns the pretty-printed representation of the assert statement |
| ToString() string | Returns a string representation of the assert statement |
| GetMessage() *Expr | Returns the message expression associated with the assert statement if present |
| GetExpr() *Expr | Returns the condition expression being asserted in the statement |
| ------------------------------ | ----------------------------------------------------------------------------------|

0 comments on commit 86060a1

Please sign in to comment.