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

V3030. Recurring check. This condition was already verified in previous line.


SharpDevelop

V3030 Recurring check. The 'location != null' condition was already verified in line 585. CSharpParser.cs 586


public override void Visit(Struct s)
{
  ....
  if (location != null && location.Count > 2) {
    if (location != null && curLoc < location.Count)
      newType.AddChild(....);
  ....
}

Similar errors can be found in some other places:

  • V3030 Recurring check. The 'location != null' condition was already verified in line 630. CSharpParser.cs 631
  • V3030 Recurring check. The 'location != null' condition was already verified in line 723. CSharpParser.cs 724

Microsoft Code Contracts

V3030 Recurring check. The 'this.lineOffsets == null' condition was already verified in line 612. Nodes.cs 613


public virtual void InsertOrDeleteLines(....)
{
  ....
  if (this.lineOffsets == null)
    if (this.lineOffsets == null) this.ComputeLineOffsets();
  if (lineCount < 0)
    this.DeleteLines(offset, -lineCount);
  else
    this.InsertLines(offset, lineCount);
  ....
}

.NET Core Libraries (CoreFX)

V3030 Recurring check. The 'baseTableRowCounts == null' condition was already verified in line 68. MetadataAggregator.cs 70


private MetadataAggregator(....)
{
  ....
  if (baseTableRowCounts == null)                           // <=
  {
    if (baseReader == null)
    {
      throw new ArgumentNullException("deltaReaders");
    }

    if (baseReader.GetTableRowCount(TableIndex.EncMap) != 0)
    {
      throw new ArgumentException("....", "baseReader");
    }

    CalculateBaseCounts(baseReader, out baseTableRowCounts, // <=
                                    out baseHeapSizes);
  }
  else
  {
    if (baseTableRowCounts == null)                         // <=
    {
      throw new ArgumentNullException("baseTableRowCounts");
    }

    ....
  }
  ....
}

IronPython and IronRuby

V3030 Recurring check. The 'cls != null' condition was already verified in line 373. LibraryDef.cs 374


public void ReflectTypes(Type[]/*!*/ allTypes) {
  ....
  def.Super = null;
  if (cls != null && def.Extends != typeof(BasicObject)
    && !def.Extends.IsInterface) {
    if (cls != null && cls.Inherits != null) {
      def.Super = new TypeRef(cls.Inherits);
  ....
}

PascalABC.NET

V3030 Recurring check. The 'upperScopeWhereVarsAreCaptured != scope' condition was already verified in line 383. TreeConverter CapturedVariablesSubstitutionClassGenerator.cs 391


private void VisitCapturedVar(....)
{
  ....
  if (upperScopeWhereVarsAreCaptured != scope)
  {
    ....
    if (upperScopeWhereVarsAreCaptured != scope)
    {
      ....
    }
    ....
  }
  ....
}

Similar errors can be found in some other places:

  • V3030 Recurring check. The 'kav.Count == 0' condition was already verified in line 2515. ParserTools DefaultLanguageInformation.cs 2518
  • V3030 Recurring check. The 'ret_tn != null' condition was already verified in line 289. CodeCompletion FindReferences.cs 291
  • V3030 Recurring check. The 'kav.Count == 0' condition was already verified in line 885. VBNETParser LanguageInformation.cs 888

Telerik UI for UWP

V3030 Recurring check. The '!showIndicatorWhenNoData' condition was already verified in line 139. RadDataBoundListBox.PullToRefresh.cs 141


internal void HandlePullToRefreshItemStateChanged(object item, ItemState state)
{
  ....
  bool showIndicatorWhenNoData = this.ShowPullToRefreshWhenNoData;

  if (this.realizedItems.Count == 0 && !showIndicatorWhenNoData)
  {
    if (state == ItemState.Recycled && !showIndicatorWhenNoData)
    {
      this.StopPullToRefreshLoading(false);
      this.HidePullToRefreshIndicator();
    }
    return;
  }
  ....
}

Nethermind

V3030 Recurring check. The '_logger.IsInfo' condition was already verified in line 242. Nethermind.Synchronization SyncServer.cs 244


private void LogBlockAuthorNicely(Block block, ISyncPeer syncPeer)
{
  if (_logger.IsInfo)
  {
    if (_logger.IsInfo)
    {
      ....
    }
  }
}


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

Проверено проектов
410
Собрано ошибок
14 111

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

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

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

goto PVS-Studio;
Этот сайт использует куки и другие технологии, чтобы предоставить вам более персонализированный опыт. Продолжая просмотр страниц нашего веб-сайта, вы принимаете условия использования этих файлов. Если вы не хотите, чтобы ваши данные обрабатывались, пожалуйста, покиньте данный сайт. Подробнее →
Принять