Skip to content

Commit 292a948

Browse files
committed
Pending changes exported from your codespace
1 parent 455cde2 commit 292a948

15 files changed

+38
-38
lines changed

docs/codeql/codeql-language-guides/abstract-syntax-tree-classes-for-working-with-java-programs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Abstract syntax tree classes for working with Java programs
44
===========================================================
55

6-
CodeQL has a large selection of classes for representing the abstract syntax tree of Java programs.
6+
CodeQL has a large selection of classes for representing the abstract syntax tree of Java and Kotlin programs.
77

88
.. include:: ../reusables/abstract-syntax-tree.rst
99

docs/codeql/codeql-language-guides/analyzing-data-flow-in-java.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
.. _analyzing-data-flow-in-java:
22

3-
Analyzing data flow in Java
3+
Analyzing data flow in Java and Kotlin
44
===========================
55

6-
You can use CodeQL to track the flow of data through a Java program to its use.
6+
You can use CodeQL to track the flow of data through a Java/Kotlin program to its use.
77

88
.. include:: ../reusables/kotlin-beta-note.rst
99

@@ -12,7 +12,7 @@ You can use CodeQL to track the flow of data through a Java program to its use.
1212
About this article
1313
------------------
1414

15-
This article describes how data flow analysis is implemented in the CodeQL libraries for Java and includes examples to help you write your own data flow queries.
15+
This article describes how data flow analysis is implemented in the CodeQL libraries for Java/Kotlin and includes examples to help you write your own data flow queries.
1616
The following sections describe how to use the libraries for local data flow, global data flow, and taint tracking.
1717

1818
For a more general introduction to modeling data flow, see ":ref:`About data flow analysis <about-data-flow-analysis>`."

docs/codeql/codeql-language-guides/basic-query-for-cpp-code.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ After the initial ``import`` statement, this simple query comprises three parts
5252
+---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
5353
| Query part | Purpose | Details |
5454
+===============================================================+===================================================================================================================+========================================================================================================================+
55-
| ``import cpp`` | Imports the standard CodeQL libraries for C/C++. | Every query begins with one or more ``import`` statements. |
55+
| ``import c-cpp`` | Imports the standard CodeQL libraries for C/C++. | Every query begins with one or more ``import`` statements. |
5656
+---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
5757
| ``from IfStmt ifstmt, BlockStmt block`` | Defines the variables for the query. | We use: |
5858
| | Declarations are of the form: | |

docs/codeql/codeql-language-guides/basic-query-for-java-code.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ After the initial ``import`` statement, this simple query comprises three parts
7070
+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------+
7171
| Query part | Purpose | Details |
7272
+==================================================================================================+===================================================================================================================+===================================================================================================+
73-
| ``import java`` | Imports the standard CodeQL libraries for Java and Kotlin. | Every query begins with one or more ``import`` statements. |
73+
| ``import java-kotlin`` | Imports the standard CodeQL libraries for Java and Kotlin. | Every query begins with one or more ``import`` statements. |
7474
+--------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------+
7575
| ``from MethodAccess ma`` | Defines the variables for the query. | We use: |
7676
| | Declarations are of the form: | |
@@ -133,7 +133,7 @@ Further reading
133133

134134
.. Article-specific substitutions for the reusables used in docs/codeql/reusables/vs-code-basic-instructions
135135
136-
.. |language-text| replace:: Java
136+
.. |language-text| replace:: Java/Kotlin
137137

138138
.. |language-code| replace:: ``java``
139139

docs/codeql/codeql-language-guides/basic-query-for-javascript-code.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. _basic-query-for-javascript-code:
22

3-
Basic query for JavaScript code
3+
Basic query for JavaScript and TypeScript code
44
===============================
55

66
Learn to write and run a simple CodeQL query using Visual Studio Code with the CodeQL extension.
@@ -10,7 +10,7 @@ Learn to write and run a simple CodeQL query using Visual Studio Code with the C
1010
About the query
1111
---------------
1212

13-
In JavaScript, any expression can be turned into an expression statement. While this is sometimes convenient, it can be dangerous. For example, imagine a programmer wants to assign a new value to a variable ``x`` by means of an assignment ``x = 42``. However, they accidentally type two equals signs, producing the comparison statement ``x == 42``. This is valid JavaScript, so no error is generated. The statement simply compares ``x`` to ``42``, and then discards the result of the comparison.
13+
In JavaScript and TypeScript, any expression can be turned into an expression statement. While this is sometimes convenient, it can be dangerous. For example, imagine a programmer wants to assign a new value to a variable ``x`` by means of an assignment ``x = 42``. However, they accidentally type two equals signs, producing the comparison statement ``x == 42``. This is valid JavaScript, so no error is generated. The statement simply compares ``x`` to ``42``, and then discards the result of the comparison.
1414

1515
The query you will run finds instances of this problem. The query searches for expressions ``e`` that are pure—that is, their evaluation does not lead to any side effects—but appear as an expression statement.
1616

@@ -50,7 +50,7 @@ After the initial ``import`` statement, this simple query comprises three parts
5050
+---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
5151
| Query part | Purpose | Details |
5252
+===============================================================+===================================================================================================================+========================================================================================================================+
53-
| ``import javascript`` | Imports the standard CodeQL libraries for JavaScript. | Every query begins with one or more ``import`` statements. |
53+
| ``import javascript-typescript`` | Imports the standard CodeQL libraries for JavaScript and TypeScript. | Every query begins with one or more ``import`` statements. |
5454
+---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
5555
| ``from Expr e`` | Defines the variables for the query. | ``e`` is declared as a variable that ranges over expressions. |
5656
| | Declarations are of the form: | |

docs/codeql/codeql-language-guides/codeql-for-java.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Experiment and learn how to write effective and efficient queries for CodeQL dat
1010

1111
.. pull-quote:: Enabling Kotlin support
1212

13-
CodeQL treats Java and Kotlin as parts of the same language, so to enable Kotlin support you should enable ``java`` as a language.
13+
CodeQL treats Java and Kotlin as parts of the same language, so to enable Kotlin support you should enable ``java-kotlin`` as a language.
1414

1515
.. toctree::
1616
:hidden:
@@ -26,11 +26,11 @@ Experiment and learn how to write effective and efficient queries for CodeQL dat
2626
working-with-source-locations
2727
abstract-syntax-tree-classes-for-working-with-java-programs
2828

29-
- :doc:`Basic query for Java code <basic-query-for-java-code>`: Learn to write and run a simple CodeQL query.
29+
- :doc:`Basic query for Java and Kotlin code <basic-query-for-java-code>`: Learn to write and run a simple CodeQL query.
3030

31-
- :doc:`CodeQL library for Java <codeql-library-for-java>`: When analyzing Java code, you can use the large collection of classes in the CodeQL library for Java.
31+
- :doc:`CodeQL library for Java and Kotlin <codeql-library-for-java>`: When analyzing Java/Kotlin code, you can use the large collection of classes in the CodeQL library for Java/Kotlin.
3232

33-
- :doc:`Analyzing data flow in Java <analyzing-data-flow-in-java>`: You can use CodeQL to track the flow of data through a Java program to its use.
33+
- :doc:`Analyzing data flow in Java and Kotlin <analyzing-data-flow-in-java>`: You can use CodeQL to track the flow of data through a Java/Kotlin program to its use.
3434

3535
- :doc:`Java types <types-in-java>`: You can use CodeQL to find out information about data types used in Java code. This allows you to write queries to identify specific type-related issues.
3636

@@ -44,4 +44,4 @@ Experiment and learn how to write effective and efficient queries for CodeQL dat
4444

4545
- :doc:`Working with source locations <working-with-source-locations>`: You can use the location of entities within Java code to look for potential errors. Locations allow you to deduce the presence, or absence, of white space which, in some cases, may indicate a problem.
4646

47-
- :doc:`Abstract syntax tree classes for working with Java programs <abstract-syntax-tree-classes-for-working-with-java-programs>`: CodeQL has a large selection of classes for representing the abstract syntax tree of Java programs.
47+
- :doc:`Abstract syntax tree classes for working with Java and Kotlin programs <abstract-syntax-tree-classes-for-working-with-java-programs>`: CodeQL has a large selection of classes for representing the abstract syntax tree of Java/Kotlin programs.

docs/codeql/codeql-language-guides/codeql-for-javascript.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
CodeQL for JavaScript
44
=====================
55

6-
Experiment and learn how to write effective and efficient queries for CodeQL databases generated from JavaScript codebases.
6+
Experiment and learn how to write effective and efficient queries for CodeQL databases generated from JavaScript and TypeScript codebases.
77

88
.. toctree::
99
:hidden:
@@ -18,7 +18,7 @@ Experiment and learn how to write effective and efficient queries for CodeQL dat
1818
abstract-syntax-tree-classes-for-working-with-javascript-and-typescript-programs
1919
data-flow-cheat-sheet-for-javascript
2020

21-
- :doc:`Basic query for JavaScript code <basic-query-for-javascript-code>`: Learn to write and run a simple CodeQL query.
21+
- :doc:`Basic query for JavaScript and TypeScript code <basic-query-for-javascript-code>`: Learn to write and run a simple CodeQL query.
2222

2323
- :doc:`CodeQL library for JavaScript <codeql-library-for-javascript>`: When you're analyzing a JavaScript program, you can make use of the large collection of classes in the CodeQL library for JavaScript.
2424

0 commit comments

Comments
 (0)