To get a trial key
fill out the form below
Team License (standard version)
Enterprise License (extended version)
* By clicking this button you agree to our Privacy Policy statement

** This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Request our prices
New License
License Renewal
--Select currency--
USD
EUR
GBP
RUB
* By clicking this button you agree to our Privacy Policy statement

** This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Message submitted.

Your message has been sent. We will email you at


If you haven't received our response, please do the following:
check your Spam/Junk folder and click the "Not Spam" button for our message.
This way, you won't miss messages from our team in the future.

>
>
Examples of errors detected by the V303…

Examples of errors detected by the V3030 diagnostic

April 5, 2021

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)
    {
      ....
    }
  }
}

ONLYOFFICE Community Server

V3030 Recurring check. The '!String.IsNullOrEmpty(user)' condition was already verified in line 173. CommonLinkUtility.cs 176


public static string GetUserProfile(string user, bool absolute)
{
  var queryParams = "";

  if (!String.IsNullOrEmpty(user))
  {
      var guid = Guid.Empty;
      if (!String.IsNullOrEmpty(user) && 32 <= user.Length && user[8] == '-')
      {
        ....
}

Popular related articles
Free PVS-Studio for those who develops open source projects

Date: 12.22.2018

Author: Andrey Karpov

On the New 2019 year's eve, a PVS-Studio team decided to make a nice gift for all contributors of open-source projects hosted on GitHub, GitLab or Bitbucket. They are given free usage of PVS-Studio s…
Characteristics of PVS-Studio Analyzer by the Example of EFL Core Libraries, 10-15% of False Positives

Date: 07.31.2017

Author: Andrey Karpov

After I wrote quite a big article about the analysis of the Tizen OS code, I received a large number of questions concerning the percentage of false positives and the density of errors (how many erro…
The Ultimate Question of Programming, Refactoring, and Everything

Date: 04.14.2016

Author: Andrey Karpov

Yes, you've guessed correctly - the answer is "42". In this article you will find 42 recommendations about coding in C++ that can help a programmer avoid a lot of errors, save time and effort. The au…
Static analysis as part of the development process in Unreal Engine

Date: 06.27.2017

Author: Andrey Karpov

Unreal Engine continues to develop as new code is added and previously written code is changed. What is the inevitable consequence of ongoing development in a project? The emergence of new bugs in th…
How PVS-Studio Proved to Be More Attentive Than Three and a Half Programmers

Date: 10.22.2018

Author: Andrey Karpov

Just like other static analyzers, PVS-Studio often produces false positives. What you are about to read is a short story where I'll tell you how PVS-Studio proved, just one more time, to be more atte…
Appreciate Static Code Analysis!

Date: 10.16.2017

Author: Andrey Karpov

I am really astonished by the capabilities of static code analysis even though I am one of the developers of PVS-Studio analyzer myself. The tool surprised me the other day as it turned out to be sma…
PVS-Studio ROI

Date: 01.30.2019

Author: Andrey Karpov

Occasionally, we're asked a question, what monetary value the company will receive from using PVS-Studio. We decided to draw up a response in the form of an article and provide tables, which will sho…
PVS-Studio for Java

Date: 01.17.2019

Author: Andrey Karpov

In the seventh version of the PVS-Studio static analyzer, we added support of the Java language. It's time for a brief story of how we've started making support of the Java language, how far we've co…
The Last Line Effect

Date: 05.31.2014

Author: Andrey Karpov

I have studied many errors caused by the use of the Copy-Paste method, and can assure you that programmers most often tend to make mistakes in the last fragment of a homogeneous code block. I have ne…
Technologies used in the PVS-Studio code analyzer for finding bugs and potential vulnerabilities

Date: 11.21.2018

Author: Andrey Karpov

A brief description of technologies used in the PVS-Studio tool, which let us effectively detect a large number of error patterns and potential vulnerabilities. The article describes the implementati…

Comments (0)

Next comments

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
This website uses cookies and other technology to provide you a more personalized experience. By continuing the view of our web-pages you accept the terms of using these files. If you don't want your personal data to be processed, please, leave this site.
Learn More →
Accept