Skip to content

Commit 29eaacd

Browse files
committed
Fix typos and comment styling
1 parent fcd4262 commit 29eaacd

File tree

12 files changed

+40
-39
lines changed

12 files changed

+40
-39
lines changed

csharp/ql/src/Linq/Helpers.qll

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ predicate isIEnumerableType(ValueOrRefType t) {
2727
}
2828

2929
/**
30-
* Holds if `ForeachStmt` could be converted to a `.All()` call. That is,
31-
* the `ForeachStmt` contains a single `if` with a condition that accesses
32-
* the loop variable and with a body that assigns `false` to a variable and
33-
* `break`s out of the `foreach`.
30+
* Holds if `foreach` statement `fes` could be converted to a `.All()` call.
31+
* That is, the `ForeachStmt` contains a single `if` with a condition that
32+
* accesses the loop variable and with a body that assigns `false` to a variable
33+
* and `break`s out of the `foreach`.
3434
*/
3535
predicate missedAllOpportunity(ForeachStmt fes) {
3636
exists(IfStmt is |
@@ -51,9 +51,10 @@ predicate missedAllOpportunity(ForeachStmt fes) {
5151
}
5252

5353
/**
54-
* Holds if `ForeachStmt` could be converted to a `.Cast()` call. That is, the
55-
* loop variable is accessed only in the first statement of the block, and the
56-
* access is a cast. The first statement needs to be a `LocalVariableDeclStmt`.
54+
* Holds if `foreach` statement `fes` could be converted to a `.Cast()` call.
55+
* That is, the loop variable is accessed only in the first statement of the
56+
* block, and the access is a cast. The first statement needs to be a
57+
* `LocalVariableDeclStmt`.
5758
*/
5859
predicate missedCastOpportunity(ForeachStmt fes, LocalVariableDeclStmt s) {
5960
s = firstStmt(fes) and
@@ -67,10 +68,10 @@ predicate missedCastOpportunity(ForeachStmt fes, LocalVariableDeclStmt s) {
6768
}
6869

6970
/**
70-
* Holds if `ForeachStmt` could be converted to an `.OfType()` call. That is, the
71-
* loop variable is accessed only in the first statement of the block, and the
72-
* access is a cast with the `as` operator. The first statement needs to be a
73-
* `LocalVariableDeclStmt`.
71+
* Holds if `foreach` statement `fes` could be converted to an `.OfType()` call.
72+
* That is, the loop variable is accessed only in the first statement of the
73+
* block, and the access is a cast with the `as` operator. The first statement
74+
* needs to be a `LocalVariableDeclStmt`.
7475
*/
7576
predicate missedOfTypeOpportunity(ForeachStmt fes, LocalVariableDeclStmt s) {
7677
s = firstStmt(fes) and
@@ -84,9 +85,10 @@ predicate missedOfTypeOpportunity(ForeachStmt fes, LocalVariableDeclStmt s) {
8485
}
8586

8687
/**
87-
* Holds if `ForeachStmt` could be converted to a `.Select()` call. That is, the
88-
* loop variable is accessed only in the first statement of the block, and the
89-
* access is not a cast. The first statement needs to be a `LocalVariableDeclStmt`.
88+
* Holds if `foreach` statement `fes` could be converted to a `.Select()` call.
89+
* That is, the loop variable is accessed only in the first statement of the
90+
* block, and the access is not a cast. The first statement needs to be a
91+
* `LocalVariableDeclStmt`.
9092
*/
9193
predicate missedSelectOpportunity(ForeachStmt fes, LocalVariableDeclStmt s) {
9294
s = firstStmt(fes) and
@@ -97,10 +99,10 @@ predicate missedSelectOpportunity(ForeachStmt fes, LocalVariableDeclStmt s) {
9799
}
98100

99101
/**
100-
* Holds if `ForeachStmt` could be converted to a `.Where()` call. That is, first
101-
* statement of the loop is an `if`, which accesses the loop variable, and the body
102-
* of the `if` is either a `continue` or there's nothing else in the loop than the
103-
* `if`.
102+
* Holds if `foreach` statement `fes` could be converted to a `.Where()` call.
103+
* That is, first statement of the loop is an `if`, which accesses the loop
104+
* variable, and the body of the `if` is either a `continue` or there's nothing
105+
* else in the loop than the `if`.
104106
*/
105107
predicate missedWhereOpportunity(ForeachStmt fes, IfStmt is) {
106108
// The very first thing the foreach loop does is test its iteration variable.

csharp/ql/src/external/CodeDuplication.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ predicate mostlyDuplicateClass(Class c, Class other, string message) {
276276
)
277277
}
278278

279-
/** Holds if the two files are similar or duplated. */
279+
/** Holds if the two files are similar or duplicated. */
280280
predicate fileLevelDuplication(File f, File other) {
281281
similarFiles(f, other, _) or duplicateFiles(f, other, _)
282282
}

csharp/ql/src/semmle/code/cil/Access.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ReadRefAccess extends ReadAccess, ReadRef { }
3131

3232
/** An instruction that writes a variable. */
3333
class WriteAccess extends VariableAccess, @cil_write_access {
34-
/** Gets the `Expr` whose value is used in this variable write. */
34+
/** Gets the expression whose value is used in this variable write. */
3535
Expr getExpr() { none() }
3636
}
3737

csharp/ql/src/semmle/code/csharp/exprs/Expr.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ class RangeExpr extends Expr, @range_expr {
10111011

10121012
/** An index expression, for example `^1` meaning "1 from the end". */
10131013
class IndexExpr extends Expr, @index_expr {
1014-
/** Gets the sub expression of this `IndexExpr`. */
1014+
/** Gets the sub expression of this index expression. */
10151015
Expr getExpr() { result.getParent() = this }
10161016

10171017
override string toString() { result = "^..." }

csharp/ql/src/semmle/code/csharp/frameworks/EntityFramework.qll

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ private import semmle.code.csharp.frameworks.system.collections.Generic
88
private import semmle.code.csharp.frameworks.Sql
99
private import semmle.code.csharp.dataflow.LibraryTypeDataFlow
1010

11-
/** Definitions relating to the `System.ComponentModel.DataAnnotations`. */
11+
/**
12+
* Definitions relating to the `System.ComponentModel.DataAnnotations`
13+
* namespace.
14+
*/
1215
module DataAnnotations {
1316
/** Class for `NotMappedAttribute`. */
1417
class NotMappedAttribute extends Attribute {
@@ -22,7 +25,7 @@ module DataAnnotations {
2225

2326
/**
2427
* Definitions relating to the `Microsoft.EntityFrameworkCore` or
25-
* `System.Data.Entity`.
28+
* `System.Data.Entity` namespaces.
2629
*/
2730
module EntityFramework {
2831
/** An EF6 or EFCore namespace. */

csharp/ql/src/semmle/code/csharp/frameworks/system/Linq.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
private import csharp as csharp
66
private import semmle.code.csharp.frameworks.System as System
77

8-
/** Definitions relating to the `System.Linq`. */
8+
/** Definitions relating to the `System.Linq` namespace. */
99
module SystemLinq {
1010
/** The `System.Linq` namespace. */
1111
class Namespace extends csharp::Namespace {

csharp/ql/src/semmle/code/csharp/frameworks/system/data/Common.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
private import csharp as csharp
66
private import semmle.code.csharp.frameworks.system.Data as Data
77

8-
/** Definitions relating to the `System.Data.Common`. */
8+
/** Definitions relating to the `System.Data.Common` namespace. */
99
module SystemDataCommon {
1010
/** The `System.Data.Common` namespace. */
1111
class Namespace extends csharp::Namespace {

csharp/ql/src/semmle/code/csharp/frameworks/system/data/Entity.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
private import csharp as csharp
66
private import semmle.code.csharp.frameworks.system.Data as Data
77

8-
/** Definitions relating to the `System.Data.Entity`. */
8+
/** Definitions relating to the `System.Data.Entity` namespace. */
99
module SystemDataEntity {
1010
/** The `System.Data.Entity` namespace. */
1111
class Namespace extends csharp::Namespace {
@@ -79,7 +79,7 @@ module SystemDataEntity {
7979
}
8080
}
8181

82-
/** Definitions relating to the `System.Data.Entity.Infrastructure`. */
82+
/** Definitions relating to the `System.Data.Entity.Infrastructure` namespace. */
8383
module SystemDataEntityInfrastructure {
8484
/** The `System.Data.Entity.Infrastructure` namespace. */
8585
class Namespace extends csharp::Namespace {

csharp/ql/src/semmle/code/csharp/frameworks/system/linq/Expressions.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
private import csharp as csharp
66
private import semmle.code.csharp.frameworks.system.Linq
77

8-
/** Definitions relating to the `System.Linq.Expressions`. */
8+
/** Definitions relating to the `System.Linq.Expressions` namespace. */
99
module SystemLinqExpressions {
1010
/** The `System.Linq.Expressions` namespace. */
1111
class Namespace extends csharp::Namespace {

csharp/ql/src/semmle/code/csharp/frameworks/system/xml/XPath.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import csharp as csharp
44
private import semmle.code.csharp.frameworks.system.Xml as xml
55

6-
/** Definitions relating to the `System.Xml.XPath`. */
6+
/** Definitions relating to the `System.Xml.XPath` namespace. */
77
module SystemXmlXPath {
88
/** The `System.Xml.XPath` namespace. */
99
class Namespace extends csharp::Namespace {

0 commit comments

Comments
 (0)