Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fc9c7ea

Browse files
committed
CSharp: Autoformat qls
1 parent bcaaebf commit fc9c7ea

5 files changed

Lines changed: 18 additions & 6 deletions

File tree

csharp/ql/src/Language Abuse/UselessUpcast.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
import csharp
1414

1515
/** A static callable. */
16-
class StaticCallable extends Callable { StaticCallable() { this.(Modifiable).isStatic() } }
16+
class StaticCallable extends Callable {
17+
StaticCallable() { this.(Modifiable).isStatic() }
18+
}
1719

1820
/** An instance callable, that is, a non-static callable. */
1921
class InstanceCallable extends Callable {

csharp/ql/src/Likely Bugs/Collections/ContainerSizeCmpZero.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ private predicate containerSizeAccess(PropertyAccess pa, string containerKind) {
3737
)
3838
}
3939

40-
class ZeroLiteral extends Expr { ZeroLiteral() { getValue() = "0" } }
40+
class ZeroLiteral extends Expr {
41+
ZeroLiteral() { getValue() = "0" }
42+
}
4143

4244
/**
4345
* Whether `smaller` is checked to be no greater than `greater` by `e` being `trueOrFalse`

csharp/ql/src/Likely Bugs/Statements/UseBraces.ql

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@ Stmt getASuccessorStmt(Stmt s) {
2525
result = findSuccessorStmt(s.getAControlFlowNode().getASuccessor())
2626
}
2727

28-
class IfThenStmt extends IfStmt { IfThenStmt() { not exists(Stmt s | getElse() = s) } }
28+
class IfThenStmt extends IfStmt {
29+
IfThenStmt() { not exists(Stmt s | getElse() = s) }
30+
}
2931

30-
class IfThenElseStmt extends IfStmt { IfThenElseStmt() { exists(Stmt s | getElse() = s) } }
32+
class IfThenElseStmt extends IfStmt {
33+
IfThenElseStmt() { exists(Stmt s | getElse() = s) }
34+
}
3135

3236
Stmt getTrailingBody(Stmt s) {
3337
result = s.(ForStmt).getBody() or

csharp/ql/src/Performance/StringConcatenationInLoop.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
import csharp
1313

1414
// any use of + that has string type
15-
class StringCat extends AddExpr { StringCat() { this.getType() instanceof StringType } }
15+
class StringCat extends AddExpr {
16+
StringCat() { this.getType() instanceof StringType }
17+
}
1618

1719
/**
1820
* Holds if `e` is an assignment of the form

csharp/ql/test/library-tests/assemblies/assemblies.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ class TypeRef extends @typeref {
88
Type getType() { typeref_type(this, result) }
99
}
1010

11-
class MissingType extends TypeRef { MissingType() { not exists(getType()) } }
11+
class MissingType extends TypeRef {
12+
MissingType() { not exists(getType()) }
13+
}
1214

1315
from
1416
Class class1, MissingType class2, MissingType class3, MissingType class4, MissingType class5,

0 commit comments

Comments
 (0)