Skip to content

Commit 1c25e17

Browse files
authored
Merge pull request #1505 from hvitved/csharp/autoformat
Approved by calumgrant
2 parents f58c7cc + bd03e7a commit 1c25e17

File tree

6 files changed

+20
-14
lines changed

6 files changed

+20
-14
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/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)