V3061. Parameter 'A' is always rewritten in method body before being used.
V3061 Parameter 'dialogs' is always rewritten in method body before being used. HFReasoner.cs 45
public async Task<FunctionCallFromLlm> GetNextInstruction(
....,
List<RoleDialogModel> dialogs
)
{
var next = GetNextStepPrompt(router);
var completion = CompletionProvider.GetChatCompletion(
_services,
provider: router?.LlmConfig?.Provider,
model: router?.LlmConfig?.Model);
dialogs = new List<RoleDialogModel>
{
new RoleDialogModel(AgentRole.User, next)
{
FunctionName = nameof(HFReasoner),
MessageId = messageId
}
};
var response = await completion.GetChatCompletions(router, dialogs);
....
}
V3061 Parameter 'sbiexOriginal' is always rewritten in method body before being used. WinEventTests.cs 404
private void TestScrollByOverflowImpl(
CmdApp app, ViewportArea area, IntPtr hConsole,
WinCon.CONSOLE_SCREEN_BUFFER_INFO_EX sbiex,
Queue<EventData> expected,
WinCon.CONSOLE_SCREEN_BUFFER_INFO_EX sbiexOriginal
)
{
// Get original screen information
sbiexOriginal = app.GetScreenBufferInfo(); // <=
short promptLineEnd = sbiexOriginal.dwCursorPosition.X;
promptLineEnd--; // prompt line ended one position left of cursor
// Resize the window to only have two lines left at the bottom
// to test overflow when we echo some text
sbiex = sbiexOriginal;
....
}
Similar errors can be found in some other places:
V3061 Parameter 'availableSize' is always rewritten in method body before being used. Canvas.cs 149
protected override Size MeasureOverride(Size availableSize)
{
availableSize = new Size(double.PositiveInfinity,
double.PositiveInfinity);
foreach (Control child in Children)
{
child.Measure(availableSize);
}
return new Size();
}
V3061 Parameter 'storeId' is always rewritten in method body before being used. UIStoresController.cs 890
[HttpPost("{storeId}/tokens/create")]
public async Task<IActionResult> CreateToken(string storeId, ....)
{
if (!ModelState.IsValid)
{
return View(nameof(CreateToken), model);
}
model.Label = model.Label ?? String.Empty;
var userId = GetUserId();
if (userId == null)
return Challenge(AuthenticationSchemes.Cookie);
storeId = model.StoreId; // <=
....
}
V3061 Parameter 'namedBuildTarget' is always rewritten in method body before being used. PlayerSettingsIconsEditor.cs 396
public void IconSectionGUI(NamedBuildTarget namedBuildTarget,....)
{
....
if (platformUsesStandardIcons)
{
var selectedDefault = (m_SelectedPlatform < 0);
// Set default platform variables
BuildPlatform platform = null;
namedBuildTarget = NamedBuildTarget.Standalone;
....
}
....
}
V3061 Parameter 'mode' is always rewritten in method body before being used. Ftp.cs 306
private static bool Put(Context context,
PhpResource ftp_stream,
string remote_file,
string local_file,
int mode,
bool append,
int startpos)
{ .... }
public static bool ftp_put(Context context,
PhpResource ftp_stream,
string remote_file,
string local_file,
int mode = FTP_IMAGE,
int startpos = 0)
{
return Put(context,
ftp_stream,
remote_file,
local_file,
mode = FTP_IMAGE, // <=
false,
startpos);
}
V3061 Parameter 'instruction' is always rewritten in method body before being used. EndConditionalBlock.cs 18
public static void Emit(byte[] instruction, CompilationContext context)
{
// 20000000
// Use the conditional begin instruction stored in the stack.
instruction = context.CurrentBlock.BaseInstruction;
....
}
V3061 Parameter 'array' is always rewritten in method body before being used. SecurityPortfolioManager.cs 192
public void CopyTo(KeyValuePair<Symbol, SecurityHolding>[] array, int index)
{
array = new KeyValuePair<Symbol, SecurityHolding>[Securities.Count];
var i = 0;
foreach (var asset in Securities)
{
if (i >= index)
{
array[i] = new KeyValuePair<Symbol,SecurityHolding>(asset.Key,
asset.Value.Holdings);
}
i++;
}
}
V3061 Parameter 'numberOfResults' is always rewritten in method body before being used. DocumentHandler.cs(273), DocumentHandler.cs(267) Raven.Server
private async Task<int> WriteDocumentsJsonAsync(...., int numberOfResults)
{
using (
var writer = new AsyncBlittableJsonTextWriter(
context,
ResponseBodyStream(),
Database.DatabaseShutdown
)
)
{
writer.WriteStartObject();
writer.WritePropertyName(nameof(GetDocumentsResult.Results));
numberOfResults = await writer.WriteDocumentsAsync( // <=
context,
documentsToWrite,
metadataOnly
);
....
}
return numberOfResults;
}
V3061 Parameter 'index' is always rewritten in method body before being used. DataEngine.cs 1443
private static Tuple<Group, int> FindGroupAndItemIndex(.... int index, ....)
{
if (exhaustiveSearch)
{
....
}
else
{
var aggregateRowGroup = rowRootGroup;
var rowGroupNames = valueProvider.GetRowGroupNames(item);
foreach (var groupName in rowGroupNames)
{
Group group;
if (aggregateRowGroup.TryGetGroup(groupName, out group))
{
aggregateRowGroup = group;
}
}
index = aggregateRowGroup.IndexOf(item, valueProvider.GetSortComparer());
return Tuple.Create(aggregateRowGroup, index);
}
}
V3061 Parameter 'docPos' is always rewritten in method body before being used. CanonicalXmlDocument.cs 37
public void Write(StringBuilder strBuilder,
DocPosition docPos,
AncestralNamespaceContextManager anc)
{
docPos = DocPosition.BeforeRootElement; // <=
foreach (XmlNode childNode in ChildNodes)
{
if (childNode.NodeType == XmlNodeType.Element)
{
....
docPos = DocPosition.AfterRootElement;
}
else
{
CanonicalizationDispatcher.Write(
childNode, strBuilder, docPos, anc); // <=
}
}
}
Similar errors can be found in some other places:
V3061 Parameter 'errorInfo' is always rewritten in method body before being used. corlib-net_4_x Marshal.cs 1552
internal static int SetErrorInfo (int dwReserved,
IErrorInfo errorInfo)
{
int retVal = 0;
errorInfo = null; // <=
....
retVal = _SetErrorInfo (dwReserved, errorInfo);
....
}
V3061 Parameter 'numericValue' is always rewritten in method body before being used. NodePacketTranslator.cs 320
public void TranslateEnum<T>(ref T value, int numericValue)
{
numericValue = _reader.ReadInt32(); // <=
Type enumType = value.GetType();
value = (T)Enum.ToObject(enumType, numericValue);
}
Similar errors can be found in some other places:
V3061 Parameter 'fDistance' is always rewritten in method body before being used. GPSTrackerPlugin.WorldWind.cs 1667
void ShowInfo(.... , float fDistance )
{
....
if (m_fTotalDistance>=0F)
{
string sUnit=(m_fTotalDistance>=1F)?"km":"m";
fDistance = (m_fTotalDistance < 1F) ?
(m_fTotalDistance * 1000F) :
m_fTotalDistance;
sInfo += "Track Distance: " +
Convert.ToString(
decimal.Round(
Convert.ToDecimal(fDistance),3)) +
sUnit +
"\n";
}
....
}
V3061 Parameter 'mode' is always rewritten in method body before being used. Accord.Statistics TriangularDistribution.cs 646
private static double WeightedMode(double[] observations,
double[] weights,
double mode,
int imax,
int imin)
{
....
var bestValue = currentValue;
....
mode = bestValue;
return mode;
}
Similar errors can be found in some other places:
V3061 Parameter 'libraryData' is always rewritten in method body before being used. SiliconStudio.TextureConverter DxtTexLib.cs 213
private void Load(TexImage image,
DxtTextureLibraryData libraryData,
LoadingRequest loader)
{
....
libraryData = new DxtTextureLibraryData(); // <=
image.LibraryData[this] = libraryData;
libraryData.Image = new ScratchImage();
....
}
Similar errors can be found in some other places:
V3061 Parameter 'internalEvent' is always rewritten in method body before being used. SiliconStudio.Xenko ParameterCollection.cs 1158
internal delegate void InternalValueChangedDelegate(
InternalValue internalValue, object oldValue);
private static InternalValueChangedDelegate
CreateInternalValueChangedEvent(
ParameterKey key,
InternalValueChangedDelegate internalEvent,
ValueChangedDelegate originalEvent)
{
internalEvent = (internalValue, oldValue) =>
originalEvent(key, internalValue, oldValue);
return internalEvent;
}