You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Warning: There are identical sub-expressions 's.SubscriptionTimeoutSettings == SubscriptionTimeoutSettings' to the left and to the right of the '&&' operator.
Looks suspicious that the SubscriptionTimeoutSettings field is checked twice, whereas the MaxFixedBufferSize field is not checked.
Issue 2
internal static string Base64Encode(this long value, string prefix)
{
// 11 is the number of characters it takes to represent long.MaxValue
// so we will never need a larger size for encoding longs
Span<char> sb = stackalloc char[11 + prefix?.Length ?? 0];
....
}
Warning: Perhaps the '??' operator works in a different way than it was expected. Its priority is lower than priority of other operators in its left part.
If prefix is null then sb will be an empty array. Looks like it should contain 11 elements at least. If so, the correct expression should contain parentheses:
11 + (prefix?.Length ?? 0)
Issue 3
protected override void PreStart() => Console.WriteLine("Good Morning, we are awake!", ConsoleColor.Green);
protected override void PostStop() => Console.WriteLine("Good Night, going to bed!", ConsoleColor.Red);
Warning: Incorrect format. A different number of format items is expected while calling 'WriteLine' function. Arguments not used: ConsoleColor.Green.
Hello,
PVS-Studio (static analyzer) issued a few warnings on the sources. I've described the most suspicious below. Hope it'll be useful. :)
P.S. Please, let me know if I should open separate issues for each code fragment.
Issue 1
Warning: There are identical sub-expressions 's.SubscriptionTimeoutSettings == SubscriptionTimeoutSettings' to the left and to the right of the '&&' operator.
Link to the sources: link
Looks suspicious that the
SubscriptionTimeoutSettings
field is checked twice, whereas theMaxFixedBufferSize
field is not checked.Issue 2
Warning: Perhaps the '??' operator works in a different way than it was expected. Its priority is lower than priority of other operators in its left part.
Link to the sources: link.
If
prefix
isnull
thensb
will be an empty array. Looks like it should contain 11 elements at least. If so, the correct expression should contain parentheses:Issue 3
Warning: Incorrect format. A different number of format items is expected while calling 'WriteLine' function. Arguments not used: ConsoleColor.Green.
Link to the sources: link.
'WriteLine' method doesn't contain overloads that accept arguments of the 'ConsoleColor' type. So, they'll be ignored.
Issue 4
Warning: Expression '!(failedActor is null)' is always true.
Link to the sources: link.
The
failedActor
is always notnull
here._actor
is notnull
at theelse
branch, as a resultfailedActor
too.The text was updated successfully, but these errors were encountered: