You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: change-notes/1.20/analysis-python.md
+13-12Lines changed: 13 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,23 @@
1
1
# Improvements to Python analysis
2
2
3
+
## General improvements
3
4
4
-
## General improvements
5
+
### Extractor changes
5
6
6
-
> Changes that affect alerts in many files or from many queries
7
-
> For example, changes to file classification
7
+
The extractor now parses all Python code from a single unified grammar. This means that almost all Python code will be successfully parsed, even if mutually incompatible Python code is present in the same project. This also means that Python code for any version can be correctly parsed on a worker running any other supported version of Python. For example, Python 3.7 code is parsed correctly, even if the installed version of Python is only 3.5. This will reduce the number of syntax errors found in many projects.
8
+
9
+
### Regular expression analysis improvements
10
+
11
+
The Python `re` (regular expressions) module library has a couple of constants called `MULTILINE` and `VERBOSE` which determine the parsing of regular expressions. Python 3.6 changed the implementation of these constants, which resulted in false positive results for some queries. The relevant QL libraries have been updated to support both implementations which will remove false positive results from projects that use Python 3.6 and later versions.
12
+
13
+
### API improvements
8
14
9
-
The constants `MULTILINE` and `VERBOSE` in `re` module, are now understood for Python 3.6 and upward.
10
-
Removes false positives seen when using Python 3.6, but not when using earlier versions.
11
15
The API has been improved to declutter the global namespace and improve discoverability and readability.
12
16
* New predicates `ModuleObject::named(name)` and `ModuleObject.attr(name)` have been added, allowing more readable access to common objects. For example, `(any ModuleObject m | m.getName() = "sys").getAttribute("exit")` can be replaced with `ModuleObject::named("sys").attr("exit")`
13
-
* The API for accessing builtin functions has been improved. Predicates of the form `theXXXFunction()`, such as `theLenFunction()`, have been deprecated in favour of `Object::builtin(name)`.
17
+
* The API for accessing builtin functions has been improved. Predicates of the form `theXXXFunction()`, such as `theLenFunction()`, have been deprecated in favor of `Object::builtin(name)`.
14
18
* A configuration based API has been added for writing data flow and taint tracking queries. This is provided as a convenience for query authors who have written data flow or taint tracking queries for other languages, so they can use a similar format of query across multiple languages.
@@ -24,7 +28,7 @@ The API has been improved to declutter the global namespace and improve discover
24
28
| Overly permissive file permissions (`py/overly-permissive-file`) | security, external/cwe/cwe-732 | Finds instances where a file is created with overly permissive permissions. Results are not shown on LGTM by default. |
25
29
| Use of insecure SSL/TLS version (`py/insecure-protocol`) | security, external/cwe/cwe-327 | Finds instances where a known insecure protocol has been specified. Results are shown on LGTM by default. |
@@ -35,11 +39,8 @@ The API has been improved to declutter the global namespace and improve discover
35
39
| Unused import (`py/unused-import`) | Fewer false positive results | Results where the imported module is used in a `doctest` string are no longer reported. |
36
40
| Unused import (`py/unused-import`) | Fewer false positive results | Results where the imported module is used in a type-hint comment are no longer reported. |
37
41
38
-
## Changes to code extraction
39
-
40
-
* The extractor now parses all Python code from a single unified grammar. This means that almost all Python code will be successfully parsed, even if mutually incompatible Python code is present in the same project. This also means that Python code for any version can be correctly parsed on a worker running any other supported version of Python. For example, Python 3.7 code is parsed correctly, even if the installed version of Python is only 3.5.
Copy file name to clipboardExpand all lines: change-notes/1.20/extractor-javascript.md
+6-20Lines changed: 6 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,25 +2,11 @@
2
2
3
3
# Improvements to JavaScript analysis
4
4
5
-
> NOTES
6
-
>
7
-
> Please describe your changes in terms that are suitable for
8
-
> customers to read. These notes will have only minor tidying up
9
-
> before they are published as part of the release notes.
10
-
>
11
-
> This file is written for lgtm users and should contain *only*
12
-
> notes about changes that affect lgtm enterprise users. Add
13
-
> any other customer-facing changes to the `studio-java.md`
14
-
> file.
15
-
>
16
-
17
-
## General improvements
18
-
19
5
## Changes to code extraction
20
6
21
-
* Parallel extraction of JavaScript files (but not TypeScript files) on LGTM is now supported. The `LGTM_THREADS` environment variable can be set to indicate how many files should be extracted in parallel. If this variable is not set, parallel extraction is disabled.
22
-
*The extractor now offers experimental support for [E4X](https://developer.mozilla.org/en-US/docs/Archive/Web/E4X), a legacy language extension developed by Mozilla.
23
-
*The extractor now supports additional [Flow](https://flow.org/) syntax.
24
-
*The extractor now supports [Nullish Coalescing](https://github.com/tc39/proposal-nullish-coalescing) expressions.
25
-
*The extractor now supports [TypeScript 3.2](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-2.html).
26
-
* The TypeScript extractor now handles the control-flow of logical operators and destructuring assignments more accurately.
7
+
* Parallel extraction of JavaScript files (but not TypeScript files) on LGTM is now supported. If LGTM is configured to evaluate queries using multiple threads, then JavaScript files are also extracted using multiple threads.
8
+
*Experimental support for [E4X](https://developer.mozilla.org/en-US/docs/Archive/Web/E4X), a legacy language extension developed by Mozilla, is available.
9
+
*Additional [Flow](https://flow.org/) syntax is now supported.
10
+
*[Nullish Coalescing](https://github.com/tc39/proposal-nullish-coalescing) expressions are now supported.
11
+
*[TypeScript 3.2](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-2.html) is now supported.
12
+
* The TypeScript extractor now handles the controlflow of logical operators and destructuring assignments more accurately.
0 commit comments