V3009. It's odd that this method always returns one and the same value of NN.
V3009 It's odd that this method always returns one and the same value of 'true'. DynamicNode.cs 695
private bool ConvertPropertyValueByDataType(....)
{
if (string.IsNullOrEmpty(string.Format("{0}", result)))
{
result = false;
return true;
}
....
return true;
....
return true;
....
return true;
....
return true;
....
return true;
....
....
return true;
}
V3009 It's odd that this method always returns one and the same value of 'true'. LinearEqualities.cs 5262
public bool TryGetFirstAvailableDimension(out int dim)
{
for (var i = 0; i < map.Length; i++)
{
if (!map[i])
{
dim = i;
return true;
}
}
map.Length++;
dim = map.Length;
return true;
}
V3009 It's odd that this method always returns one and the same value of 'false'. Xamarin.Forms.UITest.TestCloud OptionSet.cs 239
static bool
Unprocessed(ICollection<string> extra, Option def,
OptionContext c, string argument)
{
if (def == null)
{
....
return false;
}
....
return false;
}
V3009 It's odd that this method always returns one and the same value of 'true'. ComReference.cs 304
internal static bool GetTypeLibNameForITypeLib(....)
{
....
if (typeLib2 == null)
{
....
return true; // <=
}
....
try
{
if (data == null || ...)
{
....
return true; // <=
}
....
}
catch (COMException ex)
{
....
return true; // <=
}
return true; // <=
}
V3009 It's odd that this method always returns one and the same value of 'false'. NETGenerator NETGenerator.cs 5434
private bool BeginOnForNode(IStatementNode value)
{
//if (value is IForNode) return true;
IStatementsListNode stats = value as IStatementsListNode;
if (stats == null) return false;
if (stats.statements.Length == 0) return false;
//if (stats.statements[0] is IForNode) return true;
return false;
}
Similar errors can be found in some other places:
V3009 CWE-393 It's odd that this method always returns one and the same value of 'true'. Main.cs 10153
private bool LoadTextSTFromMatroska(
MatroskaTrackInfo matroskaSubtitleInfo,
MatroskaFile matroska,
bool batchMode)
{
....
_fileDateTime = new DateTime();
_converted = true;
if (batchMode)
return true;
SubtitleListview1.Fill(_subtitle, _subtitleAlternate);
if (_subtitle.Paragraphs.Count > 0)
SubtitleListview1.SelectIndexAndEnsureVisible(0);
ShowSource();
return true;
}
V3009 CWE-393 It's odd that this method always returns one and the same value of 'false'. ProjectBrowser.cs 1417
// Returns true if we should early out of OnGUI
bool HandleCommandEventsForTreeView()
{
....
if (....)
{
....
if (....)
return false;
....
}
return false;
}
V3009 [CWE-393] It's odd that this method always returns one and the same value of 'true'. AWSSDK.Core.Net45 Lexer.cs 651
private static bool State19 (....)
{
while (....) {
switch (....) {
case '"':
....
return true;
case '\\':
....
return true;
default:
....
continue;
}
}
return true;
}
Similar errors can be found in some other places:
V3009 It's odd that this method always returns one and the same value of 'true'. XmlBinaryWriterSession.cs 29
public virtual bool TryAdd(XmlDictionaryString value, out int key)
{
IntArray keys;
if (value == null)
....
if (_maps.TryGetValue(value.Dictionary, out keys))
{
....
return true; // <=
}
....
return true; // <=
}
V3009 It's odd that this method always returns one and the same value of 'false'. XmlObjectSerializerWriteContext.cs 415
internal virtual bool OnHandleReference(....)
{
if (xmlWriter.depth < depthToCheckCyclicReference)
return false;
if (canContainCyclicReference)
....
return false;
}
V3009 It's odd that this method always returns one and the same value of 'true'. MaskedTextProvider.cs 1529
public bool Remove(out int testPosition, out MaskedTextResultHint resultHint)
{
....
if (lastAssignedPos == INVALID_INDEX)
{
....
return true; // nothing to remove.
}
....
return true;
}
V3009 It's odd that this method always returns one and the same value of 'true'. DataGridRows.cs 412
internal bool ScrollSlotIntoView(int slot, bool scrolledHorizontally)
{
if (.....)
{
....
if (DisplayData.FirstScrollingSlot < slot
&& DisplayData.LastScrollingSlot > slot)
{
return true;
}
else if (DisplayData.FirstScrollingSlot == slot && slot != -1)
{
....
return true;
}
....
}
....
return true;
}
V3009 [CWE-393] It's odd that this method always returns one and the same value of 'false'. KeyCounterAction.cs 19
public bool OnPressed(T action, bool forwards)
{
if (!EqualityComparer<T>.Default.Equals(action, Action))
return false;
IsLit = true;
if (forwards)
Increment();
return false;
}
public bool OnPressed(T action) =>
Target.Children
.OfType<KeyCounterAction<T>>()
.Any(c => c.OnPressed(action, Clock.Rate >= 0));
Similar errors can be found in some other places:
V3009 It's odd that this method always returns one and the same value of '".xml"'. CustomXmlPartTypeInfo.cs 31
internal static string GetTargetExtension(CustomXmlPartType partType)
{
switch (partType)
{
case CustomXmlPartType.AdditionalCharacteristics:
return ".xml";
case CustomXmlPartType.Bibliography:
return ".xml";
case CustomXmlPartType.CustomXml:
return ".xml";
case CustomXmlPartType.InkContent:
return ".xml";
default:
return ".xml";
}
}
Similar errors can be found in some other places:
V3009 It's odd that this method always returns one and the same value of 'PredefinedObjectAcl.PublicRead'. GoogleCloudStorage.cs 305
private PredefinedObjectAcl GetGoogleCloudAcl(ACL acl)
{
switch (acl)
{
case ACL.Read:
return PredefinedObjectAcl.PublicRead;
default:
return PredefinedObjectAcl.PublicRead;
}
}
V3009 It's odd that this method always returns one and the same value of 'true'. MessageEngine.cs 318
//TODO: Simplify
public bool SetUnread(List<int> ids, bool unread, bool allChain = false)
{
....
if (!chainedMessages.Any())
return true;
var listIds = allChain
? chainedMessages.Where(x => x.IsNew == !unread).Select(....).ToList()
: ids;
if (!listIds.Any())
return true;
....
return true;
}
135 lines of code