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.
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

** This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
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

** This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
I am interested to try it on the platforms:
* 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 V300…

Examples of errors detected by the V3008 diagnostic

V3008. The 'x' variable is assigned values twice successively. Perhaps this is a mistake.


SharpDevelop

V3008 The 'foundInvocations' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 211, 209. RedundantAssignmentIssue.cs 211


public override void VisitInvocationExpression(
  InvocationExpression methodDeclaration)
{
  ....
  foundInvocations = (idExpression.Identifier == _varName);
  foundInvocations = true;
  ....
}

SharpDevelop

V3008 The 'pos' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 151, 148. CodeSnippet.cs 151


public static Snippet CreateAvalonEditSnippet(
  ITextEditor context, string snippetText)
{
  ....
  int pos = 0;
  foreach (Match m in pattern.Matches(snippetText)) {
    if (pos < m.Index) {
      snippet.Elements.Add(....);
      pos = m.Index;                                  // <=
    }
    snippet.Elements.Add(CreateElementForValue(
      context, replaceableElements, m.Groups[1].Value,
      m.Index, snippetText));
    pos = m.Index + m.Length;                         // <=
  }
  ....
}

SharpDevelop

V3008 The 'd' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 121, 120. AddNewFileCommand.cs 121


object LoadResource(string name)
{
  ....
  try {
    FileStream s = new FileStream(name, FileMode.Open);
    BinaryReader r = new BinaryReader(s);
    Byte[] d = new Byte[(int)s.Length];
    d = r.ReadBytes((int)s.Length);
    s.Close();
    return d;
  } catch (Exception ex) {
  ....
}

SharpDevelop

V3008 The 'clickedNode' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 105, 104. PositionedGraphNodeControl.xaml.cs 105


void PropertyExpandButton_Click(object sender, RoutedEventArgs e)
{
  ....
  ContentPropertyNode clickedNode =
    clickedButton.DataContext as ContentPropertyNode;
  clickedNode = clickedButton.DataContext as ContentPropertyNode;
  if (clickedNode == null)
  ....
}

The code is redundant. Repeated assignment can be removed.


SharpDevelop

V3008 The 'ignoreDialogIdSelectedInTextEditor' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 204, 201. WixDialogDesigner.cs 204


void OpenDesigner()
{
  try {
    ignoreDialogIdSelectedInTextEditor = true;
    WorkbenchWindow.ActiveViewContent = this;
  } finally {
    ignoreDialogIdSelectedInTextEditor = false;
  }
}

Microsoft Code Contracts

V3008 The 'this.InsideMonitor' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 751, 749. AssertionCrawlerAnalysis.cs 751


private Data(Data state, Variable v)
{
  this.IsReached = state.IsReached;
  this.InsideMonitor = state.InsideMonitor;  // <=
  this.symbols = new List<Variable>(state.symbols) { v };
  this.InsideMonitor = false;                // <=
}

.NET Core Libraries (CoreFX)

V3008 The 'HResult' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 169, 166. WebSocketException.cs 169


private void SetErrorCodeOnError(int nativeError)
{
    if (!Succeeded(nativeError))
    {
        HResult = nativeError;
    }

    HResult = nativeError;  // <=
}

.NET Core Libraries (CoreFX)

V3008 The 'ResPrec' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 1735, 1731. SQLDecimal.cs 1735


public static SqlDecimal operator /(SqlDecimal x, SqlDecimal y)
{
  int ResPrec;
  ....
  ResPrec = ResScale + x.m_bPrec + y.m_bPrec + 1;     // <=
  MinScale = Math.Min(ResScale, s_cNumeDivScaleMin);

  ResInteger = Math.Min(ResInteger, s_NUMERIC_MAX_PRECISION);
  ResPrec = ResInteger + ResScale;                    // <=

  if (ResPrec > s_NUMERIC_MAX_PRECISION)
      ResPrec = s_NUMERIC_MAX_PRECISION;
  ....
}

.NET Core Libraries (CoreFX)

V3008 The 'prefix' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 953, 952. XmlSerializationWriter.cs 953


protected void WriteAttribute(string localName, string ns, ....)
{
  ....
  string prefix = localName.Substring(0, colon);
  prefix = _w.LookupPrefix(ns);
  _w.WriteStartAttribute(prefix,
                         localName.Substring(colon + 1), ns);
  ....
}

.NET Compiler Platform ("Roslyn")

V3008 The 'retVal' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 324, 313. DiagnosticExtensions.cs 324


public static string Stringize(this Diagnostic e)
{
  var retVal = string.Empty;
  if (e.Location.IsInSource)
  {
    retVal = e.Location.SourceSpan.ToString() + ": ";
  }
  else if (e.Location.IsInMetadata)
  {
    return "metadata: ";
  }
  else
  {
    return "no location: ";
  }
  retVal = e.Severity.ToString() + " " + e.Id + ": " +
           e.GetMessage(CultureInfo.CurrentCulture);
  return retVal;
}

.NET Compiler Platform ("Roslyn")

V3008 The 'count' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 317, 314. SymReader.cs 317


public int GetMethodsInDocument(
  ISymUnmanagedDocument document,
  int bufferLength,
  out int count,
  ....)
{
  ....
  if (bufferLength > 0)
  {
    ....
    count = actualCount;
  }
  else
  {
    count = extentsByMethod.Length;
  }
  count = 0;
  return HResult.S_OK;
}

Sony ATF

V3008 The 'Y' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 221, 217. Atf.Core.vs2010 QuatF.cs 221


public float X;
public float Y;

public float Z;
public void Set(Matrix4F m)
{
  ....
  ww = -0.5 * (m.M22 + m.M33);
  if (ww >= 0)
  {
    if (ww >= EPS2)
    {
      double wwSqrt = Math.Sqrt(ww);
      X = (float)wwSqrt;
      ww = 0.5 / wwSqrt;
      Y = (float)(m.M21 * ww);
      Z = (float)(m.M31 * ww);
      return;
    }
  }
  else
  {
    X = 0;
    Y = 0;
    Z = 1;
    return;
  }

  X = 0;
  ww = 0.5 * (1.0f - m.M33);
  if (ww >= EPS2)
  {
    double wwSqrt = Math.Sqrt(ww);
    Y = (float)wwSqrt;                   // <=
    Z = (float)(m.M32 / (2.0 * wwSqrt));
  }

  Y = 0; // <=
  Z = 1;
}

Sony ATF

V3008 The 'Z' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 222, 218. Atf.Core.vs2010 QuatF.cs 222


public float X;
public float Y;

public float Z;
public void Set(Matrix4F m)
{
  ....
  ww = -0.5 * (m.M22 + m.M33);
  if (ww >= 0)
  {
    if (ww >= EPS2)
    {
      double wwSqrt = Math.Sqrt(ww);
      X = (float)wwSqrt;
      ww = 0.5 / wwSqrt;
      Y = (float)(m.M21 * ww);
      Z = (float)(m.M31 * ww);
      return;
    }
  }
  else
  {
    X = 0;
    Y = 0;
    Z = 1;
    return;
  }

  X = 0;
  ww = 0.5 * (1.0f - m.M33);
  if (ww >= EPS2)
  {
    double wwSqrt = Math.Sqrt(ww);
    Y = (float)wwSqrt;
    Z = (float)(m.M32 / (2.0 * wwSqrt)); // <=
  }

  Y = 0;
  Z = 1; // <=
}

Samples by the Infragistics Company

V3008 The 'x' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 96, 95. RectEx.cs 96


public static void Normalize(....)
{
  var x = rect.X < boundingRect.X ? boundingRect.X : rect.X;
  x = (rect.X + rect.Width) > boundingRect.Right ?
      boundingRect.X : rect.X;
}

Samples by the Infragistics Company

V3008 The 'color' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 165, 163. BrushTool.cs 165


private static GradientStopCollection fromInterpolation(....){
  ....
  Color color=ColorTool.FromAHSV(ahsv[0],
                                 ahsv[1],
                                 ahsv[2],
                                 ahsv[3]);
  color = ColorTool.FromARGBInterpolation(min, p, max[i].Color);
  ....
}

WPF samples by Microsoft

V3008 The 'arg' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 176, 173. CommandLine.cs 176


private object InvokMethod(....)
{
  arg = commandLine.Substring(
    commandLine.IndexOf("(", StringComparison.Ordinal) + 1,
      commandLine.IndexOf(")",
        StringComparison.Ordinal) -
        (commandLine.IndexOf("(",
          StringComparison.Ordinal) + 1));
  arg = commandLine.Substring(
    commandLine.IndexOf("(",
      StringComparison.Ordinal) + 1);
}

Old NASA World Wind (C#)

V3008 The 'X' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 40, 38. Point3d.cs 40


public Point3d (Point3d P)
{
   X = P.X;
   Y = P.Y;
   X = P.Z;  // <=
}

Similar errors can be found in some other places:

  • V3008 The 'this._imagePath' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 270, 263. ImageLayer.cs 270
  • V3008 The 'm_PolygonFill' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 1623, 1618. ShapeFileLayer.cs 1623

GitExtensions

V3008 The 'exp.ExceptionPointers' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 124, 123. NBug DumpWriter.cs 124


private static bool Write(....)
{
  ....
  exp.ExceptionPointers = IntPtr.Zero;
  exp.ExceptionPointers = Marshal.GetExceptionPointers();
  ....
}

Media Portal 2

V3008 The 'Released' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 57, 56. OmDbSeasonEpisode.cs 57


public string ReleasedStr
{
  get {
    ....
  }
  set {
    DateTime releaseDate;
    if (DateTime.TryParse(value, out releaseDate))
      Released = releaseDate;
    Released = null;                        // <=
  }
}

Perhaps forgot add 'else' block for 'if' statement and put 'Released = null' into them.


PascalABC.NET

V3008 The 'codeCompileUnit' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 126, 124. VisualPascalABCNET CodeDomHostLoader.cs 126


CodeCompileUnit codeCompileUnit = null;
private DesignSurface Designer;
....
protected override CodeCompileUnit Parse()
{
  ....
  CodeCompileUnit ccu = null;
  DesignSurface ds = new DesignSurface();
  ....
  ccu = cg.GetCodeCompileUnit(idh);
  ....
  codeCompileUnit = ccu;
  Designer = ds;
  codeCompileUnit = ccu;  // <=
  ....
}

Similar errors can be found in some other places:

  • V3008 The 'mSTEPToolStripMenuItem_Enabled' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 541, 532. VisualPascalABCNET VisibilityService.cs 541
  • V3008 The variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 62, 60. NETGenerator Helpers.cs 62
  • V3008 The 'loc' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 2123, 2122. TreeConverter compilation_context.cs 2123
  • And 3 additional diagnostic messages.

Unity C# reference source code

V3008 CWE-563 The 'fail' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 1633, 1632. UNetWeaver.cs 1633


class Weaver
{
  ....
  public static bool fail;
  ....
  static public bool IsValidTypeToGenerate(....)
  {
    ....
    if (....)
    {
      ....
      Weaver.fail = true;
      fail = true;
      return false;
    }
    return true;
  }
....
}

Infer.NET

V3008 The 'lowerBound' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 324, 323. Runtime GaussianOp.cs 324


public static Gaussian SampleAverageConditional(....)
{
  ....
  if (sample.Precision < 0)
  {
    precisionIsBetween = true;
    lowerBound = -1.0 / v;
    upperBound = -mean.Precision;
  }
  else if (sample.Precision < -mean.Precision)
  {
    precisionIsBetween = true;
    lowerBound = 0;
    upperBound = -mean.Precision;
  }
  else
  {
    precisionIsBetween = false;
    lowerBound = -mean.Precision;
    lowerBound = -1.0 / v;
  }
  ....
}

AWS SDK for .NET

V3008 [CWE-563] The 'this.linker.s3.region' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 116, 114. AWSSDK.DynamoDBv2.Net45 S3Link.cs 116


public string Region
{
  get
  {
    ....
  }
  set
  {
    if (String.IsNullOrEmpty(value))
    {
      this.linker.s3.region = "us-east-1";
    }
    this.linker.s3.region = value;
  }
}

.NET Core Libraries (CoreFX)

V3008 The '_streamSet' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 123, 119. MimePart.cs 123


internal void SetContent(Stream stream)
{
  if (stream == null)
  {
    throw new ArgumentNullException(nameof(stream));
  }

  if (_streamSet)
  {
    _stream.Close();
    _stream = null;     // <=
    _streamSet = false; // <=
  }

  _stream = stream;     // <=
  _streamSet = true;    // <=
  _streamUsedOnce = false;
  TransferEncoding = TransferEncoding.Base64;
}

ShareX

V3008 The 'url' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 197, 196. Seafile.cs 197


public SeafileCheckAccInfoResponse GetAccountInfo()
{
  string url = URLHelpers.FixPrefix(APIURL);
  url = URLHelpers.CombineURL(APIURL, "account/info/?format=json");
  ....
}

Similar errors can be found in some other places:

  • V3008 The 'url' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 93, 92. Seafile.cs 93
  • V3008 The 'url' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 120, 119. Seafile.cs 120

Telerik UI for UWP

V3008 The 'currentColumnLength' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 791, 785. WrapLayout.cs 791


private void OnAvailableLengthChanged(double oldValue, double newValue)
{
  ....
  if (....)
  {
    if (currentColumnLength > 0)
    {
      var paddingValue = Math.Max(0, newValue - currentColumnLength);
      this.paddingRenderInfo.Add(paddingValue);
      currentColumnLength = 0;     // <=
      slotCount++;
    }
    this.ColumnSlotsRenderInfo.Update(i, newValue);
    this.paddingRenderInfo.Add(0);
    currentColumnLength = 0;     // <=
    slotCount++;
    continue;
  }
  else
  {
    ....
  }
  ....
}

Orchard CMS

V3008 The 'content' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 197, 190. DynamicCacheTagHelper.cs 197


public override async Task ProcessAsync(....)
{
  ....
  IHtmlContent content;
  ....
  try
  {
    content = await output.GetChildContentAsync();
  }
  finally
  {
    _cacheScopeManager.ExitScope();
  }
  content = await ProcessContentAsync(output, cacheContext);
  ....
}

Emby

V3008 The 'Chapters' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 29, 28. Title.cs 29


public Title(uint titleNum)
{
    ProgramChains = new List<ProgramChain>();
    Chapters = new List<Chapter>();
    Chapters = new List<Chapter>();
    TitleNumber = titleNum;
}

OpenRA

V3008 The 'widget.Bounds.Width' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 78, 75. SpawnSelectorTooltipLogic.cs 78


public SpawnSelectorTooltipLogic(....)
{
  ....
  var textWidth = ownerFont.Measure(labelText).X;
  if (textWidth != cachedWidth)
  {
    label.Bounds.Width = textWidth;
    widget.Bounds.Width = 2 * label.Bounds.X + textWidth; // <=
  }

  widget.Bounds.Width = Math.Max(                         // <=
    teamWidth + 2 * labelMargin,
    label.Bounds.Right + labelMargin
  );
  team.Bounds.Width = widget.Bounds.Width;
  ....
}

Open XML SDK

V3008 The '_rawOuterXml' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 164, 161. OpenXmlElement.cs 164


internal string RawOuterXml
{
    get => _rawOuterXml;

    set
    {
        if (string.IsNullOrEmpty(value))
        {
            _rawOuterXml = string.Empty;
        }

        _rawOuterXml = value;
    }
}

QuantConnect Lean

V3008 The 'MaxOrders' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 244, 240. BacktestingSetupHandler.cs 244


public bool Setup(SetupHandlerParameters parameters)
{
  ....
  if (job.UserPlan == UserPlan.Free)
  {
    MaxOrders = 10000;
  }
  else
  {
    MaxOrders = int.MaxValue;
    MaximumRuntime += MaximumRuntime;
  }

  MaxOrders = job.Controls.BacktestingMaxOrders; // <=
  ....
}

Similar errors can be found in some other places:

  • V3008 The 'SessionId' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 182, 172. BacktestResultPacket.cs 182

ONLYOFFICE Community Server

V3008 The 'key' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 244, 240. Metadata.cs 244


private byte[] GenerateKey()
{
    var key = new byte[keyLength];

    using (var deriveBytes = new Rfc2898DeriveBytes(Password, Salt, ....))
    {
        key = deriveBytes.GetBytes(keyLength);
    }

    return key;
}

C#5 -> C#8

Similar errors can be found in some other places:

  • V3008 The 'hmacKey' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 256, 252. Metadata.cs 256
  • V3008 The 'hmacHash' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 270, 264. Metadata.cs 270
  • V3008 The 'paths' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 512, 508. RackspaceCloudStorage.cs 512
  • And 2 additional diagnostic messages.

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