|
1 | 1 | # Improvements to C# analysis |
2 | 2 |
|
| 3 | +The following changes in version 1.22 affect C# analysis in all applications. |
| 4 | + |
3 | 5 | ## Changes to existing queries |
4 | 6 |
|
5 | 7 | | **Query** | **Expected impact** | **Change** | |
6 | 8 | |------------------------------|------------------------|-----------------------------------| |
7 | | -| Added lines (`cs/vcs/added-lines-per-file`) | No results | Query has been removed. | |
8 | | -| Churned lines (`cs/vcs/churn-per-file`) | No results | Query has been removed. | |
9 | 9 | | Constant condition (`cs/constant-condition`) | Fewer false positive results | Results have been removed for default cases (`_`) in switch expressions. | |
10 | | -| Defect filter | No results | Query has been removed. | |
11 | | -| Defect from SVN | No results | Query has been removed. | |
12 | | -| Deleted lines (`cs/vcs/deleted-lines-per-file`) | No results | Query has been removed. | |
13 | 10 | | Dispose may not be called if an exception is thrown during execution (`cs/dispose-not-called-on-throw`) | Fewer false positive results | Results have been removed where an object is disposed both by a `using` statement and a `Dispose` call. | |
14 | | -| Files edited in pairs | No results | Query has been removed. | |
15 | | -| Filter: only files recently edited | No results | Query has been removed. | |
16 | | -| Large files currently edited | No results | Query has been removed. | |
17 | | -| Metric from SVN | No results | Query has been removed. | |
18 | | -| Number of authors (version control) (`cs/vcs/authors-per-file`) | No results | Query has been removed. | |
19 | | -| Number of file-level changes (`cs/vcs/commits-per-file`) | No results | Query has been removed. | |
20 | | -| Number of co-committed files (`cs/vcs/co-commits-per-file`) | No results | Query has been removed. | |
21 | | -| Number of file re-commits (`cs/vcs/recommits-per-file`) | No results | Query has been removed. | |
22 | | -| Number of recent file changes (`cs/vcs/recent-commits-per-file`) | No results | Query has been removed. | |
23 | | -| Number of authors | No results | Query has been removed. | |
24 | | -| Number of commits | No results | Query has been removed. | |
25 | | -| Poorly documented files with many authors | No results | Query has been removed. | |
26 | | -| Recent activity | No results | Query has been removed. | |
27 | 11 | | Unchecked return value (`cs/unchecked-return-value`) | Fewer false positive results | Method calls that are expression bodies of `void` callables (for example, the call to `Foo` in `void Bar() => Foo()`) are no longer considered to use the return value. | |
28 | 12 |
|
| 13 | +## Removal of old queries |
| 14 | + |
| 15 | +The following historic queries are no longer available in the distribution: |
| 16 | + |
| 17 | +* Added lines (`cs/vcs/added-lines-per-file`) |
| 18 | +* Churned lines (`cs/vcs/churn-per-file`) |
| 19 | +* Defect filter |
| 20 | +* Defect from SVN |
| 21 | +* Deleted lines (`cs/vcs/deleted-lines-per-file`) |
| 22 | +* Files edited in pairs |
| 23 | +* Filter: only files recently edited |
| 24 | +* Large files currently edited |
| 25 | +* Metric from SVN |
| 26 | +* Number of authors (version control) (`cs/vcs/authors-per-file`) |
| 27 | +* Number of file-level changes (`cs/vcs/commits-per-file`) |
| 28 | +* Number of co-committed files (`cs/vcs/co-commits-per-file`) |
| 29 | +* Number of file re-commits (`cs/vcs/recommits-per-file`) |
| 30 | +* Number of recent file changes (`cs/vcs/recent-commits-per-file`) |
| 31 | +* Number of authors |
| 32 | +* Number of commits |
| 33 | +* Poorly documented files with many authors |
| 34 | +* Recent activity |
| 35 | + |
29 | 36 | ## Changes to code extraction |
30 | 37 |
|
31 | 38 | * The following C# 8 features are now extracted: |
|
34 | 41 |
|
35 | 42 | ## Changes to QL libraries |
36 | 43 |
|
37 | | -* The new class `AnnotatedType` models types with type annotations, including nullability information, return kinds (`ref` and `readonly ref`), and parameter kinds (`in`, `out`, and `ref`) |
38 | | - - The new predicate `Assignable.getAnnotatedType()` gets the annotated type of an assignable (such as a variable or a property) |
39 | | - - The new predicates `Callable.getAnnotatedReturnType()` and `DelegateType.getAnnotatedReturnType()` get the annotated type of the return value |
40 | | - - The new predicate `ArrayType.getAnnotatedElementType()` gets the annotated type of the array element |
41 | | - - The new predicate `ConstructedGeneric.getAnnotatedTypeArgument()` gets the annotated type of a type argument |
42 | | - - The new predicate `TypeParameterConstraints.getAnAnnotatedTypeConstraint()` gets a type constraint with type annotations |
43 | | -* The new class `SuppressNullableWarningExpr` models suppress-nullable-warning expressions such as `x!` |
44 | | -* The data-flow library (and taint-tracking library) now supports flow through fields. All existing configurations will have field-flow enabled by default, but it can be disabled by adding `override int fieldFlowBranchLimit() { result = 0 }` to the configuration class. Field assignments, `this.Foo = x`, object initializers, `new C() { Foo = x }`, and field initializers `int Foo = 0` are supported. |
| 44 | +* The new class `AnnotatedType` models types with type annotations, including nullability information, return kinds (`ref` and `readonly ref`), and parameter kinds (`in`, `out`, and `ref`). |
| 45 | + - The new predicate `Assignable.getAnnotatedType()` gets the annotated type of an assignable (such as a variable or a property). |
| 46 | + - The new predicates `Callable.getAnnotatedReturnType()` and `DelegateType.getAnnotatedReturnType()` gets the annotated type of the return value. |
| 47 | + - The new predicate `ArrayType.getAnnotatedElementType()` gets the annotated type of the array element. |
| 48 | + - The new predicate `ConstructedGeneric.getAnnotatedTypeArgument()` gets the annotated type of a type argument. |
| 49 | + - The new predicate `TypeParameterConstraints.getAnAnnotatedTypeConstraint()` gets a type constraint with type annotations. |
| 50 | +* The new class `SuppressNullableWarningExpr` models suppress-nullable-warning expressions such as `x!`. |
| 51 | +* The data-flow and taint-tracking libraries now support flow through fields. All existing configurations will have field-flow enabled by default, but it can be disabled by adding `override int fieldFlowBranchLimit() { result = 0 }` to the configuration class. Field assignments, `this.Foo = x`, object initializers, `new C() { Foo = x }`, and field initializers `int Foo = 0` are supported. |
45 | 52 | * The possibility of specifying barrier edges using |
46 | 53 | `isBarrierEdge`/`isSanitizerEdge` in data-flow and taint-tracking |
47 | 54 | configurations has been replaced with the option of specifying in- and |
48 | 55 | out-barriers on nodes by overriding `isBarrierIn`/`isSanitizerIn` and |
49 | 56 | `isBarrierOut`/`isSanitizerOut`. This should be simpler to use effectively, |
50 | 57 | as it does not require knowledge about the actual edges used internally by |
51 | 58 | the library. |
52 | | - |
53 | | -## Changes to autobuilder |
|
0 commit comments