mirror of
https://github.com/github/codeql.git
synced 2026-04-20 22:44:52 +02:00
C#: Fix violations
This commit is contained in:
@@ -56,7 +56,7 @@ namespace Semmle.Extraction.CIL
|
||||
}
|
||||
|
||||
#if DEBUG_LABELS
|
||||
Dictionary<string, ILabelledEntity> debugLabels = new Dictionary<string, ILabelledEntity>();
|
||||
private readonly Dictionary<string, ILabelledEntity> debugLabels = new Dictionary<string, ILabelledEntity>();
|
||||
#endif
|
||||
|
||||
public IExtractedEntity Create(Handle h)
|
||||
@@ -66,7 +66,7 @@ namespace Semmle.Extraction.CIL
|
||||
}
|
||||
|
||||
// Lazily cache primitive types.
|
||||
PrimitiveType[] primitiveTypes = new PrimitiveType[(int)PrimitiveTypeCode.Object + 1];
|
||||
private readonly PrimitiveType[] primitiveTypes = new PrimitiveType[(int)PrimitiveTypeCode.Object + 1];
|
||||
|
||||
public PrimitiveType Create(PrimitiveTypeCode code)
|
||||
{
|
||||
|
||||
@@ -43,9 +43,11 @@ namespace Semmle.Extraction
|
||||
{
|
||||
get
|
||||
{
|
||||
var writer = new StringWriter();
|
||||
Populate(writer);
|
||||
return writer.ToString();
|
||||
using (var writer = new StringWriter())
|
||||
{
|
||||
Populate(writer);
|
||||
return writer.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -103,34 +103,6 @@ namespace Semmle.Extraction
|
||||
tb.Write(TrapBuilder.ToString());
|
||||
tb.Write("\"");
|
||||
}
|
||||
|
||||
class IdTrapBuilder
|
||||
{
|
||||
public readonly List<string> Fragments = new List<string>();
|
||||
|
||||
public void Append(object arg)
|
||||
{
|
||||
if (arg is IEntity)
|
||||
{
|
||||
var key = ((IEntity)arg).Label;
|
||||
Fragments.Add("{#");
|
||||
Fragments.Add(key.Value.ToString());
|
||||
Fragments.Add("}");
|
||||
}
|
||||
else
|
||||
Fragments.Add(arg.ToString());
|
||||
}
|
||||
|
||||
public void Append(string arg)
|
||||
{
|
||||
Fragments.Add(arg);
|
||||
}
|
||||
|
||||
public void AppendLine()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user