Skip to content

Commit 0fc46f5

Browse files
committed
C#: Fix compiler warnings related to errors in XML comments.
1 parent 3580982 commit 0fc46f5

File tree

21 files changed

+52
-64
lines changed

21 files changed

+52
-64
lines changed

csharp/autobuilder/Semmle.Autobuild.CSharp/AutoBuildRule.cs

+3-5
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,9 @@ public BuildScript Analyse(IAutobuilder<CSharpAutobuildOptions> builder, bool au
4949
tryCleanExtractorArgsLogs &
5050
BuildScript.DeleteFile(Extractor.GetCSharpLogPath());
5151

52-
/// <summary>
53-
/// Execute script `s` and check that the C# extractor has been executed.
54-
/// If either fails, attempt to cleanup any artifacts produced by the extractor,
55-
/// and exit with code 1, in order to proceed to the next attempt.
56-
/// </summary>
52+
// Execute script `s` and check that the C# extractor has been executed.
53+
// If either fails, attempt to cleanup any artifacts produced by the extractor,
54+
// and exit with code 1, in order to proceed to the next attempt.
5755
BuildScript IntermediateAttempt(BuildScript s) =>
5856
(s & this.autobuilder.CheckExtractorRun(false)) |
5957
(attemptExtractorCleanup & BuildScript.Failure);

csharp/autobuilder/Semmle.Autobuild.Shared/Autobuilder.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ protected Autobuilder(IBuildActions actions, TAutobuildOptions options, Diagnost
195195
}
196196

197197
/// <summary>
198-
/// Retrieves the value of an environment variable named <paramref name="name"> or throws
198+
/// Retrieves the value of an environment variable named <paramref name="name"/> or throws
199199
/// an exception if no such environment variable has been set.
200200
/// </summary>
201201
/// <param name="name">The name of the environment variable.</param>
@@ -228,7 +228,7 @@ protected string RequireEnvironmentVariable(string name)
228228
private readonly IDiagnosticsWriter diagnostics;
229229

230230
/// <summary>
231-
/// Makes <see cref="path" /> relative to the root source directory.
231+
/// Makes <paramref name="path"/> relative to the root source directory.
232232
/// </summary>
233233
/// <param name="path">The path which to make relative.</param>
234234
/// <returns>The relative path.</returns>

csharp/autobuilder/Semmle.Autobuild.Shared/MarkdownUtil.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static class MarkdownUtil
2222
public static string ToMarkdownLink(this string link, string title) => $"[{title}]({link})";
2323

2424
/// <summary>
25-
/// Renders <see cref="projects" /> as a markdown list of the project paths.
25+
/// Renders <paramref name="projects"/> as a markdown list of the project paths.
2626
/// </summary>
2727
/// <param name="projects">
2828
/// The list of projects whose paths should be rendered as a markdown list.
@@ -35,7 +35,7 @@ public static string ToMarkdownList(this IEnumerable<IProjectOrSolution> project
3535
}
3636

3737
/// <summary>
38-
/// Renders <see cref="items" /> as a markdown list.
38+
/// Renders <paramref name="items" /> as a markdown list.
3939
/// </summary>
4040
/// <typeparam name="T">The item type.</typeparam>
4141
/// <param name="items">The list that should be formatted as a markdown list.</param>

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/Assets.cs

+15-15
Original file line numberDiff line numberDiff line change
@@ -127,21 +127,21 @@ private void AddPackageDependencies(JObject json, string jsonPath)
127127
///
128128
/// Example:
129129
/// "project": {
130-
// "version": "1.0.0",
131-
// "frameworks": {
132-
// "net7.0": {
133-
// "frameworkReferences": {
134-
// "Microsoft.AspNetCore.App": {
135-
// "privateAssets": "none"
136-
// },
137-
// "Microsoft.NETCore.App": {
138-
// "privateAssets": "all"
139-
// }
140-
// }
141-
// }
142-
// }
143-
// }
144-
//
130+
/// "version": "1.0.0",
131+
/// "frameworks": {
132+
/// "net7.0": {
133+
/// "frameworkReferences": {
134+
/// "Microsoft.AspNetCore.App": {
135+
/// "privateAssets": "none"
136+
/// },
137+
/// "Microsoft.NETCore.App": {
138+
/// "privateAssets": "all"
139+
/// }
140+
/// }
141+
/// }
142+
/// }
143+
/// }
144+
///
145145
/// Adds the following dependencies
146146
/// Paths: {
147147
/// "microsoft.aspnetcore.app.ref",

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DotNetVersion.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ private string FullVersion
2727
* This is the same as FullPath, except that we assume that the
2828
* reference assemblies are in a directory called "packs" and
2929
* the reference assemblies themselves are in a directory called
30-
* "<Framework>.Ref/ref".
30+
* "[Framework].Ref/ref".
3131
* Example:
3232
* FullPath: /usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.2
3333
* FullPathReferenceAssemblies: /usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/7.0.2/ref

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/FileContent.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ public HashSet<PackageReference> AllPackages
3838
/// True if any file in the source directory indicates that ASP.NET Core is used.
3939
/// The following heuristic is used to decide, if ASP.NET Core is used:
4040
/// If any file in the source directory contains something like (this will most like be a .csproj file)
41-
/// <Project Sdk="Microsoft.NET.Sdk.Web">
42-
/// <FrameworkReference Include="Microsoft.AspNetCore.App"/>
41+
/// &lt;Project Sdk="Microsoft.NET.Sdk.Web"&gt;
42+
/// &lt;FrameworkReference Include="Microsoft.AspNetCore.App"/&gt;
4343
/// </summary>
4444
public bool UseAspNetCoreDlls
4545
{

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/IDotNetCliInvoker.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ internal interface IDotNetCliInvoker
1010
string Exec { get; }
1111

1212
/// <summary>
13-
/// Execute `dotnet <args>` and return true if the command succeeded, otherwise false.
13+
/// Execute `dotnet <paramref name="args"/>` and return true if the command succeeded, otherwise false.
1414
/// If `silent` is true the output of the command is logged as `debug` otherwise as `info`.
1515
/// </summary>
1616
bool RunCommand(string args, bool silent = true);
1717

1818
/// <summary>
19-
/// Execute `dotnet <args>` and return true if the command succeeded, otherwise false.
19+
/// Execute `dotnet <paramref name="args"/>` and return true if the command succeeded, otherwise false.
2020
/// The output of the command is returned in `output`.
2121
/// If `silent` is true the output of the command is logged as `debug` otherwise as `info`.
2222
/// </summary>
2323
bool RunCommand(string args, out IList<string> output, bool silent = true);
2424

2525
/// <summary>
26-
/// Execute `dotnet <args>` in `<workingDirectory>` and return true if the command succeeded, otherwise false.
26+
/// Execute `dotnet <paramref name="args"/>` in `<paramref name="workingDirectory"/>` and return true if the command succeeded, otherwise false.
2727
/// The output of the command is returned in `output`.
2828
/// If `silent` is true the output of the command is logged as `debug` otherwise as `info`.
2929
/// </summary>

csharp/extractor/Semmle.Extraction.CSharp/CodeAnalysisExtensions/SymbolExtensions.cs

+6-9
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,6 @@ bool IdDependsOnImpl(ITypeSymbol? type)
133133

134134
/// <summary>
135135
/// Constructs a unique string for this type symbol.
136-
///
137-
/// The supplied action <paramref name="subTermAction"/> is applied to the
138-
/// syntactic sub terms of this type (if any).
139136
/// </summary>
140137
/// <param name="cx">The extraction context.</param>
141138
/// <param name="trapFile">The trap builder used to store the result.</param>
@@ -495,31 +492,31 @@ public static bool IsReallyUnbound(this INamedTypeSymbol type) =>
495492

496493
/// <summary>
497494
/// Holds if this type is of the form <code>int?</code> or
498-
/// <code>System.Nullable<int></code>.
495+
/// <code>System.Nullable&lt;int&gt;</code>.
499496
/// </summary>
500497
public static bool IsBoundNullable(this ITypeSymbol type) =>
501498
type.SpecialType == SpecialType.None && type.OriginalDefinition.IsUnboundNullable();
502499

503500
/// <summary>
504-
/// Holds if this type is <code>System.Nullable<T></code>.
501+
/// Holds if this type is <code>System.Nullable&lt;T&gt;</code>.
505502
/// </summary>
506503
public static bool IsUnboundNullable(this ITypeSymbol type) =>
507504
type.SpecialType == SpecialType.System_Nullable_T;
508505

509506
/// <summary>
510-
/// Holds if this type is <code>System.Span<T></code>.
507+
/// Holds if this type is <code>System.Span&lt;T&gt;</code>.
511508
/// </summary>
512509
public static bool IsUnboundSpan(this ITypeSymbol type) =>
513510
type.ToString() == "System.Span<T>";
514511

515512
/// <summary>
516-
/// Holds if this type is of the form <code>System.Span<byte></code>.
513+
/// Holds if this type is of the form <code>System.Span&lt;byte&gt;</code>.
517514
/// </summary>
518515
public static bool IsBoundSpan(this ITypeSymbol type) =>
519516
type.SpecialType == SpecialType.None && type.OriginalDefinition.IsUnboundSpan();
520517

521518
/// <summary>
522-
/// Holds if this type is <code>System.ReadOnlySpan<T></code>.
519+
/// Holds if this type is <code>System.ReadOnlySpan&lt;T&gt;</code>.
523520
/// </summary>
524521
public static bool IsUnboundReadOnlySpan(this ITypeSymbol type) =>
525522
type.ToString() == "System.ReadOnlySpan<T>";
@@ -536,7 +533,7 @@ attribute.AttributeClass is INamedTypeSymbol nt &&
536533
}
537534

538535
/// <summary>
539-
/// Holds if this type is of the form <code>System.ReadOnlySpan<byte></code>.
536+
/// Holds if this type is of the form <code>System.ReadOnlySpan&lt;byte&gt;</code>.
540537
/// </summary>
541538
public static bool IsBoundReadOnlySpan(this ITypeSymbol type) =>
542539
type.SpecialType == SpecialType.None && type.OriginalDefinition.IsUnboundReadOnlySpan();

csharp/extractor/Semmle.Extraction.CSharp/Entities/Base/CachedEntity.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Semmle.Extraction.CSharp.Entities
77
/// <summary>
88
/// A cached entity.
99
///
10-
/// The <see cref="Entity.Id"/> property is used as label in caching.
10+
/// The <see cref="Entity.Label"/> property is used as label in caching.
1111
/// </summary>
1212
public abstract class CachedEntity : LabelledEntity
1313
{

csharp/extractor/Semmle.Extraction.CSharp/Entities/Base/IEntity.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ namespace Semmle.Extraction.CSharp
99
/// Entities are divided into two types: normal entities and cached
1010
/// entities.
1111
///
12-
/// Normal entities implement <see cref="FreshEntity"/> directly, and they
12+
/// Normal entities implement <see cref="Entities.FreshEntity"/> directly, and they
1313
/// (may) emit contents to the trap file during object construction.
1414
///
15-
/// Cached entities implement <see cref="CachedEntity"/>, and they
16-
/// emit contents to the trap file when <see cref="CachedEntity.Populate"/>
17-
/// is called. Caching prevents <see cref="CachedEntity.Populate"/>
15+
/// Cached entities implement <see cref="Entities.CachedEntity"/>, and they
16+
/// emit contents to the trap file when <see cref="Entities.CachedEntity.Populate"/>
17+
/// is called. Caching prevents <see cref="Entities.CachedEntity.Populate"/>
1818
/// from being called on entities that have already been emitted.
1919
/// </summary>
2020
public interface IEntity

csharp/extractor/Semmle.Extraction.CSharp/Entities/Expression.cs

+1-4
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ internal void SetType(ITypeSymbol? type)
7777
/// <summary>
7878
/// Gets a string representation of a constant value.
7979
/// </summary>
80-
/// <param name="obj">The value.</param>
80+
/// <param name="value">The value.</param>
8181
/// <returns>The string representation.</returns>
8282
public static string ValueAsString(object? value)
8383
{
@@ -98,7 +98,6 @@ public static string ValueAsString(object? value)
9898
/// <param name="node">The node to extract.</param>
9999
/// <param name="parent">The parent entity.</param>
100100
/// <param name="child">The child index.</param>
101-
/// <param name="type">A type hint.</param>
102101
/// <returns>The new expression.</returns>
103102
public static Expression Create(Context cx, ExpressionSyntax node, IExpressionParentEntity parent, int child, Boolean isCompilerGenerated = false)
104103
{
@@ -120,7 +119,6 @@ public static Expression Create(Context cx, ExpressionSyntax node, IExpressionPa
120119
/// <param name="node">The node to extract.</param>
121120
/// <param name="parent">The parent entity.</param>
122121
/// <param name="child">The child index.</param>
123-
/// <param name="type">A type hint.</param>
124122
public static void CreateDeferred(Context cx, ExpressionSyntax node, IExpressionParentEntity parent, int child)
125123
{
126124
if (ContainsPattern(node))
@@ -244,7 +242,6 @@ public static ExprKind UnaryOperatorKind(Context cx, ExprKind originalKind, Expr
244242
/// to show the target of the call. Also note the dynamic method
245243
/// name if available.
246244
/// </summary>
247-
/// <param name="cx">Context</param>
248245
/// <param name="node">The expression.</param>
249246
public void OperatorCall(TextWriter trapFile, ExpressionSyntax node)
250247
{

csharp/extractor/Semmle.Extraction.CSharp/Entities/Expression`1.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ protected Expression(ExpressionNodeInfo info)
2020
/// <code>expressions</code> and <code>expr_location</code> are populated by the constructor
2121
/// (should not fail), so even if expression-type specific population fails (e.g., in
2222
/// standalone extraction), the expression created via
23-
/// <see cref="Expression.Create(Context, ExpressionSyntax, IEntity, int, ITypeSymbol)"/> will
23+
/// <see cref="Expression.Create"/> will
2424
/// still be valid.
2525
/// </summary>
2626
protected abstract void PopulateExpression(TextWriter trapFile);

csharp/extractor/Semmle.Extraction.CSharp/Entities/Types/NamedType.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@ public static NamedType Create(Context cx, INamedTypeSymbol type) =>
2121
NamedTypeFactory.Instance.CreateEntityFromSymbol(cx, type);
2222

2323
/// <summary>
24-
/// Creates a named type entity from a tuple type. Unlike `Create`, this
24+
/// Creates a named type entity from a tuple type. Unlike <see cref="Create"/>, this
2525
/// will create an entity for the underlying `System.ValueTuple` struct.
26-
/// For example, `(int, string)` will result in an entity for
27-
/// `System.ValueTuple<int, string>`.
26+
/// For example, `(int, string)` will result in an entity for `System.ValueTuple&lt;int, string&gt;`.
2827
/// </summary>
2928
public static NamedType CreateNamedTypeFromTupleType(Context cx, INamedTypeSymbol type) =>
3029
UnderlyingTupleTypeFactory.Instance.CreateEntity(cx, (new SymbolEqualityWrapper(type), typeof(TupleType)), type);

csharp/extractor/Semmle.Extraction.CSharp/Entities/Types/Nullability.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ public static IEnumerable<AnnotatedTypeSymbol> GetAnnotatedTypeArguments(this An
209209
/// This is so that we can avoid populating nullability in most cases.
210210
/// For example,
211211
/// <code>
212-
/// IEnumerable&lt;string?&gt // false
213-
/// IEnumerable&lt;string?&gt? // true
212+
/// IEnumerable&lt;string?&gt; // false
213+
/// IEnumerable&lt;string?&gt;? // true
214214
/// string? // true
215215
/// string[] // true
216216
/// string?[] // false

csharp/extractor/Semmle.Extraction.CSharp/Entities/UserOperator.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private bool IsImplicitOperator(out ITypeSymbol containingType)
8686
/// Logs an error if the name is not found.
8787
/// </summary>
8888
/// <param name="cx">Extractor context.</param>
89-
/// <param name="methodName">The method name.</param>
89+
/// <param name="method">The method symbol.</param>
9090
/// <returns>The converted name.</returns>
9191
private static string OperatorSymbol(Context cx, IMethodSymbol method)
9292
{

csharp/extractor/Semmle.Extraction.CSharp/Extractor/Context.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ internal void AddFreshLabel(Entity entity)
152152
/// <summary>
153153
/// Enqueue the given action to be performed later.
154154
/// </summary>
155-
/// <param name="toRun">The action to run.</param>
155+
/// <param name="a">The action to run.</param>
156156
public void PopulateLater(Action a, bool preserveDuplicationKey = true)
157157
{
158158
var key = preserveDuplicationKey ? GetCurrentTagStackKey() : null;
@@ -598,7 +598,6 @@ public Entities.Location CreateLocation(Microsoft.CodeAnalysis.Location? locatio
598598
/// <summary>
599599
/// Register a program entity which can be bound to comments.
600600
/// </summary>
601-
/// <param name="cx">Extractor context.</param>
602601
/// <param name="entity">Program entity.</param>
603602
/// <param name="l">Location of the entity.</param>
604603
public void BindComments(Entity entity, Microsoft.CodeAnalysis.Location? l)

csharp/extractor/Semmle.Extraction.CSharp/Extractor/TrapWriter.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ private static bool TryMove(string sourceFile, string destFile)
171171
/// <summary>
172172
/// Close the trap file, and move it to the right place in the trap directory.
173173
/// If the file exists already, rename it to allow the new file (ending .trap.gz)
174-
/// to sit alongside the old file (except if <paramref name="discardDuplicates"/> is true,
174+
/// to sit alongside the old file (except if <see cref="discardDuplicates"/> is true,
175175
/// in which case only the existing file is kept).
176176
/// </summary>
177177
public void Dispose()

csharp/extractor/Semmle.Extraction.CSharp/Trap/EscapingTextWriter.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Semmle.Extraction.CSharp
88
{
99
/// <summary>
1010
/// A `TextWriter` object that wraps another `TextWriter` object, and which
11-
/// HTML escapes the characters `&`, `{`, `}`, `"`, `@`, and `#`, before
11+
/// HTML escapes the characters &amp;, {, }, &quot;, @, and #, before
1212
/// writing to the underlying object.
1313
/// </summary>
1414
public sealed class EscapingTextWriter : TextWriter

csharp/extractor/Semmle.Extraction.CSharp/Trap/TrapExtensions.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ public static TextWriter AppendList<T>(this EscapingTextWriter trapFile, string
226226
/// <summary>
227227
/// Builds a trap builder using a separator and an action for each item in the list.
228228
/// </summary>
229-
/// <typeparam name="T">The type of the items.</typeparam>
229+
/// <typeparam name="T2">The type of the items.</typeparam>
230230
/// <param name="trapFile">The trap builder to append to.</param>
231231
/// <param name="separator">The separator string (e.g. ",")</param>
232232
/// <param name="items">The list of items.</param>
@@ -251,7 +251,7 @@ public static T1 BuildList<T1, T2>(this T1 trapFile, string separator, IEnumerab
251251
/// <summary>
252252
/// Builds a trap builder using a separator and an action for each item in the list.
253253
/// </summary>
254-
/// <typeparam name="T">The type of the items.</typeparam>
254+
/// <typeparam name="T2">The type of the items.</typeparam>
255255
/// <param name="trapFile">The trap builder to append to.</param>
256256
/// <param name="separator">The separator string (e.g. ",")</param>
257257
/// <param name="items">The list of items.</param>

csharp/extractor/Semmle.Util/CanonicalPathCache.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public enum Symlinks
208208
/// Create cache with a given capacity.
209209
/// </summary>
210210
/// <param name="pathStrategy">The algorithm for determining the canonical path.</param>
211-
/// <param name="capacity">The size of the cache.</param>
211+
/// <param name="maxCapacity">The size of the cache.</param>
212212
public CanonicalPathCache(int maxCapacity, PathStrategy pathStrategy)
213213
{
214214
if (maxCapacity <= 0)
@@ -230,7 +230,6 @@ public CanonicalPathCache(int maxCapacity, PathStrategy pathStrategy)
230230
/// </remarks>
231231
///
232232
/// <param name="maxCapacity">Size of the cache.</param>
233-
/// <param name="symlinks">Policy for following symlinks.</param>
234233
/// <returns>A new CanonicalPathCache.</returns>
235234
public static CanonicalPathCache Create(ILogger logger, int maxCapacity)
236235
{

csharp/extractor/Semmle.Util/CommandBuilder.cs

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ public CommandBuilder CallBatFile(string batFile, string? argumentsOpt = null)
6262
/// </summary>
6363
/// <param name="argument">The argument to append.</param>
6464
/// <param name="force">Whether to always quote the argument.</param>
65-
/// <param name="cmd">Whether to escape for cmd.exe</param>
6665
///
6766
/// <remarks>
6867
/// This implementation is copied from

0 commit comments

Comments
 (0)