Skip to content

Commit bd03e7a

Browse files
committed
C#: Auto format
1 parent 1a9f362 commit bd03e7a

File tree

8 files changed

+22
-20
lines changed

8 files changed

+22
-20
lines changed

csharp/ql/src/API Abuse/DisposeNotCalledOnException.ql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ private predicate localFlowStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo)
6363
private predicate reachesDisposeCall(DisposeCall disposeCall, DataFlow::Node node) {
6464
localFlowStep(node, DataFlow::exprNode(disposeCall.getQualifier()))
6565
or
66-
exists(DataFlow::Node mid | reachesDisposeCall(disposeCall, mid) |
67-
localFlowStep(node, mid)
68-
)
66+
exists(DataFlow::Node mid | reachesDisposeCall(disposeCall, mid) | localFlowStep(node, mid))
6967
}
7068

7169
/**

csharp/ql/src/Likely Bugs/LeapYear/UnsafeYearConstruction.ql

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ class UnsafeYearCreationFromArithmeticConfiguration extends TaintTracking::Confi
3434
}
3535
}
3636

37-
from UnsafeYearCreationFromArithmeticConfiguration config, DataFlow::PathNode source, DataFlow::PathNode sink
37+
from
38+
UnsafeYearCreationFromArithmeticConfiguration config, DataFlow::PathNode source,
39+
DataFlow::PathNode sink
3840
where config.hasFlowPath(source, sink)
39-
select sink, source, sink, "This $@ based on a 'System.DateTime.Year' property is used in a construction of a new 'System.DateTime' object, flowing to the 'year' argument.", source, "arithmetic operation"
41+
select sink, source, sink,
42+
"This $@ based on a 'System.DateTime.Year' property is used in a construction of a new 'System.DateTime' object, flowing to the 'year' argument.",
43+
source, "arithmetic operation"

csharp/ql/src/Likely Bugs/MishandlingJapaneseEra.ql

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ predicate isExactEraStartDateCreation(ObjectCreation cr) {
2626
cr.getType().hasQualifiedName("System.DateTime") or
2727
cr.getType().hasQualifiedName("System.DateTimeOffset")
2828
) and
29-
isEraStart(cr.getArgument(0).getValue().toInt(), cr.getArgument(1).getValue().toInt(), cr.getArgument(2).getValue().toInt())
29+
isEraStart(cr.getArgument(0).getValue().toInt(), cr.getArgument(1).getValue().toInt(),
30+
cr.getArgument(2).getValue().toInt())
3031
}
3132

3233
predicate isDateFromJapaneseCalendarToDateTime(MethodCall mc) {
@@ -64,9 +65,12 @@ predicate isDateFromJapaneseCalendarCreation(ObjectCreation cr) {
6465

6566
from Expr expr, string message
6667
where
67-
isDateFromJapaneseCalendarToDateTime(expr) and message = "'DateTime' created from Japanese calendar with explicit or current era and hard-coded year."
68+
isDateFromJapaneseCalendarToDateTime(expr) and
69+
message = "'DateTime' created from Japanese calendar with explicit or current era and hard-coded year."
6870
or
69-
isDateFromJapaneseCalendarCreation(expr) and message = "'DateTime' constructed from Japanese calendar with explicit or current era and hard-coded year."
71+
isDateFromJapaneseCalendarCreation(expr) and
72+
message = "'DateTime' constructed from Japanese calendar with explicit or current era and hard-coded year."
7073
or
71-
isExactEraStartDateCreation(expr) and message = "Hard-coded the beginning of the Japanese Heisei era."
74+
isExactEraStartDateCreation(expr) and
75+
message = "Hard-coded the beginning of the Japanese Heisei era."
7276
select expr, message

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ private predicate alwaysNullExpr(Expr expr) {
4141
or
4242
alwaysNullMethod(expr.(StaticCall).getTarget())
4343
or
44-
forex(VariableUpdate vu | DefUse::variableUpdateUse(_, vu, expr) |
45-
alwaysNullVariableUpdate(vu)
46-
)
44+
forex(VariableUpdate vu | DefUse::variableUpdateUse(_, vu, expr) | alwaysNullVariableUpdate(vu))
4745
}
4846

4947
pragma[noinline]

csharp/ql/src/semmle/code/csharp/Stmt.qll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,9 +1303,7 @@ class UsingDeclStmt extends LocalVariableDeclStmt, UsingStmt, @using_decl_stmt {
13031303
result = LocalVariableDeclStmt.super.getVariableDeclExpr(n)
13041304
}
13051305

1306-
override Expr getAnExpr() {
1307-
result = this.getAVariableDeclExpr().getInitializer()
1308-
}
1306+
override Expr getAnExpr() { result = this.getAVariableDeclExpr().getInitializer() }
13091307
}
13101308

13111309
/**

csharp/ql/test/library-tests/csharp8/NullCoalescingControlFlow.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ query predicate edges(ControlFlow::Node node1, ControlFlow::Node node2, string l
44
label = "semmle.label" and
55
exists(ControlFlow::SuccessorType t |
66
node2 = node1.getASuccessorByType(t) and value = t.toString()
7-
)
8-
and node1.getEnclosingCallable().hasName("NullCoalescing")
7+
) and
8+
node1.getEnclosingCallable().hasName("NullCoalescing")
99
}

csharp/ql/test/library-tests/csharp8/StaticLocalFunctions.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ import csharp
22

33
from LocalFunction fn, string modifier
44
where fn.hasModifier(modifier)
5-
select fn, modifier
5+
select fn, modifier

csharp/ql/test/library-tests/csharp8/UsingControlFlow.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ query predicate edges(ControlFlow::Node node1, ControlFlow::Node node2, string l
44
label = "semmle.label" and
55
exists(ControlFlow::SuccessorType t |
66
node2 = node1.getASuccessorByType(t) and value = t.toString()
7-
)
8-
and node1.getEnclosingCallable().hasName("TestUsingDeclarations")
7+
) and
8+
node1.getEnclosingCallable().hasName("TestUsingDeclarations")
99
}

0 commit comments

Comments
 (0)