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

Request our prices
New License
License Renewal
--Select currency--
USD
EUR
GBP
RUB
* By clicking this button you agree to our Privacy Policy statement

Free PVS-Studio license for Microsoft MVP specialists
* By clicking this button you agree to our Privacy Policy statement

To get the licence for your open-source project, please fill out this form
* By clicking this button you agree to our Privacy Policy statement

I am interested to try it on the platforms:
* By clicking this button you agree to our Privacy Policy statement

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 V312…

Examples of errors detected by the V3128 diagnostic

V3128. The field (property) is used before it is initialized in constructor.


SharpDevelop

V3128 The 'contentPanel' field is used before it is initialized in constructor. SearchResultsPad.cs 66


Grid contentPanel;
public SearchResultsPad()
{
  ....
  defaultToolbarItems = ToolBarService
    .CreateToolBarItems(contentPanel, ....);
  ....
  contentPanel = new Grid {....};
  ....
}

PascalABC.NET

V3128 The 'dockPanel' field is used before it is initialized in constructor. ICSharpCode.SharpDevelop SearchResultsPad.cs 49


....
DockPanel dockPanel;
....
public SearchResultsPad()
{
  ....
  defaultToolbarItems = ToolBarService.
    CreateToolBarItems(dockPanel, ....);  // <=
  foreach (object toolBarItem in defaultToolbarItems) {
    toolBar.Items.Add(toolBarItem);
  }
  ....
  dockPanel = new DockPanel {
    Children = { toolBar, contentPlaceholder }
  };
  ....
}

.NET Core Libraries (CoreFX)

V3128 The '_index' field is used before it is initialized in constructor. PrinterSettings.Windows.cs 1679


private class ArrayEnumerator : IEnumerator
{
  private object[] _array;
  private object _item;
  private int _index;
  private int _startIndex;
  private int _endIndex;
  public ArrayEnumerator(object[] array, int startIndex, int count)
  {
    _array = array;
    _startIndex = startIndex;
    _endIndex = _index + count; // <=

    _index = _startIndex;
  }
  ....
}

.NET Core Libraries (CoreFX)

V3128 The '_timerInterval' field is used before it is initialized in constructor. TransactionTable.cs 151


internal class TransactionTable
{
  ....
  private int _timerInterval;
  ....
  internal TransactionTable()
  {
    _timer = new Timer(new TimerCallback(ThreadTimer),
                       null,
                       Timeout.Infinite,
                       _timerInterval); // <=

    ....
    _timerInterval = 1 << TransactionTable.timerInternalExponent;
    ....
  }
}

OpenRA

V3128 The 'Frames' field is used before it is initialized in constructor. CursorSequence.cs 35


public class CursorSequence
{
  ....
  public readonly ISpriteFrame[] Frames;

  public CursorSequence(
    FrameCache cache,
    string name,
    string cursorSrc,
    string palette,
    MiniYaml info
  )
  {
    var d = info.ToDictionary();

    Start = Exts.ParseIntegerInvariant(d["Start"].Value);
    Palette = palette;
    Name = name;

    if (
      (d.ContainsKey("Length") && d["Length"].Value == "*") ||
      (d.ContainsKey("End") && d["End"].Value == "*")
    )
      Length = Frames.Length - Start;
    else if (d.ContainsKey("Length"))
      Length = Exts.ParseIntegerInvariant(d["Length"].Value);
    else if (d.ContainsKey("End"))
      Length = Exts.ParseIntegerInvariant(d["End"].Value) - Start;
    else
      Length = 1;

    Frames = cache[cursorSrc]
      .Skip(Start)
      .Take(Length)
      .ToArray();

    ....
  }
}

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