-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: refresh documentation for latest statement support (#183)
* added block stmt doc * fixed lint issue * Added Return statement * added assert stmt * added assert stmt * 🐛 fix lint
- Loading branch information
1 parent
fa305a8
commit 3899d5c
Showing
7 changed files
with
120 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | | ||
| ------------------------------ | ----------------------------------------------------------------------------------| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
title: BlockStmt - Code-Pathfinder Reference | CodeQL Alternative | ||
description: "Block Statement Entity - Code PathFinder API Index" | ||
--- | ||
import PostHogLayout from '../../../../layouts/PostHogLayout.astro'; | ||
import { Badge } from '@astrojs/starlight/components'; | ||
|
||
<PostHogLayout> | ||
</PostHogLayout> | ||
|
||
### BlockStmt <Badge text="Entity" variant="tip" size="small" /> | ||
|
||
BlockStmt is a statement that contains a list of statements. It is used to declare variables, methods, and classes. | ||
|
||
#### Example | ||
```java | ||
class MyClass { | ||
... | ||
public void myMethod() | ||
{ // BlockStmt | ||
int myLocalVariable; // BlockStmt | ||
Double myLocalVariable2; // BlockStmt | ||
System.out.Println("Hello World"); // BlockStmt | ||
} // BlockStmt | ||
.... | ||
} | ||
``` | ||
|
||
### Attributes | ||
|
||
| Entity | Description | | ||
| ------------------------------ | ----------------------------------------------------------| | ||
| `GetAPrimaryQlClass()` | Returns the primary QL class name as a string | | ||
| `GetHalsteadID()` | Returns the Halstead complexity metric ID | | ||
| `GetPP()` | Returns the pretty-printed representation of the block | | ||
| `ToString()` | Returns string representation of the block statement | | ||
| `GetStmt(index int)` | Returns the statement at the specified index | | ||
| `GetAStmt()` | Returns a statement from the block | | ||
| `GetNumStmt()` | Returns the total number of statements in the block | | ||
| `GetLastStmt()` | Returns the last statement in the block | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
title: ReturnStmt - Code-Pathfinder Reference | CodeQL Alternative | ||
description: Return Statement Entity - Code PathFinder API Index" | ||
--- | ||
import PostHogLayout from '../../../../layouts/PostHogLayout.astro'; | ||
import { Badge } from '@astrojs/starlight/components'; | ||
|
||
<PostHogLayout> | ||
</PostHogLayout> | ||
|
||
### ReturnStmt <Badge text="Entity" variant="tip" size="small" /> | ||
|
||
ReturnStmt is a statement that returns a value from a method. | ||
|
||
#### Example | ||
```java | ||
class MyClass { | ||
... | ||
public int myMethod() | ||
{ | ||
return 1; // ReturnStmt | ||
} | ||
.... | ||
} | ||
``` | ||
|
||
### Attributes | ||
|
||
| Method | Description | | ||
| ------------------------------ | -----------------------------------------------------------| | ||
| GetAPrimaryQlClass() string | Returns the primary CodeQL class name for this entity | | ||
| GetHalsteadID() int | Returns the Halstead complexity metric identifier | | ||
| GetPP() string | Returns the pretty-printed representation of the statement | | ||
| ToString() string | Returns a string representation of the return statement | | ||
| GetResult() *Expr | Returns the expression being returned by this statement | | ||
| ------------------------------ | -----------------------------------------------------------| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters