Примеры ошибок, обнаруженных с помощью диагностики V3013


V3013. It is odd that the body of 'Foo_1' function is fully equivalent to the body of 'Foo_2' function.


IronPython and IronRuby

V3013 It is odd that the body of 'IsPositiveOne' function is fully equivalent to the body of 'IsNegativeOne' function (351, line 355). BigDecimal.cs 351


public static bool IsPositiveOne(BigDecimal x) {
  return IsOne(x) && IsPositive(x);
}

public static bool IsNegativeOne(BigDecimal x) {
  return IsOne(x) && IsPositive(x);
}

.NET Compiler Platform ("Roslyn")

V3013 It is odd that the body of 'Whitespace' function is fully equivalent to the body of 'ElasticWhitespace' function (118, line 129). SyntaxFactory.cs 118


public static SyntaxTrivia Whitespace(string text)
{
  return Syntax.InternalSyntax.SyntaxFactory.Whitespace(
           text, elastic: false);
}

public static SyntaxTrivia ElasticWhitespace(string text)
{
  return Syntax.InternalSyntax.SyntaxFactory.Whitespace(
           text, elastic: false);
}

Samples by the Infragistics Company

V3013 It is odd that the body of 'StartCurrent' function is fully equivalent to the body of 'StopCurrent' function (503, line 507). DataViewModel.cs 503


public void StartCurrent()
{
  StartTask("Current");
}

public void StopCurrent()
{
  StartTask("Current");
}

FlashDevelop

V3013 It is odd that the body of 'SuspendMdiClientLayout' function is fully equivalent to the body of 'PerformMdiClientLayout' function (377, line 389). DockPanel.MdiClientController.cs 377


private void SuspendMdiClientLayout()
{
  if (GetMdiClientController().MdiClient != null)
    GetMdiClientController().MdiClient.PerformLayout(); //<=
}

private void PerformMdiClientLayout()
{
  if (GetMdiClientController().MdiClient != null)
    GetMdiClientController().MdiClient.PerformLayout();
}

Similar errors can be found in some other places:

  • V3013 It is odd that the body of 'State11' function is fully equivalent to the body of 'State15' function (532, line 589). Lexer.cs 532


Найденные ошибки

Проверено проектов
346
Собрано ошибок
13 188

А ты совершаешь ошибки в коде?

Проверь с помощью
PVS-Studio

Статический анализ
кода для C, C++, C#
и Java

goto PVS-Studio;