Unicorn with delicious cookie
Nous utilisons des cookies pour améliorer votre expérience de navigation. En savoir plus
Accepter
to the top
>
>
>
Examples of errors detected by the V313…

Examples of errors detected by the V3138 diagnostic

V3138. String literal contains potential interpolated expression.


.NET Core Libraries (CoreFX)

V3138 String literal contains potential interpolated expression. Consider inspecting: e. SSPIHandleCache.cs 42


internal static void CacheCredential(SafeFreeCredentials newHandle)
{
  try
  {
    ....
  }
  catch (Exception e)
  {
    if (!ExceptionCheck.IsFatal(e))
    {
      NetEventSource.Fail(null, "Attempted to throw: {e}");
    }
  }
}

.NET Core Libraries (CoreFX)

V3138 String literal contains potential interpolated expression. Consider inspecting: algorithm. AuthenticationHelper.Digest.cs 58


public static async Task<string> GetDigestTokenForCredential(....)
{
  ....
  if (NetEventSource.IsEnabled)
    NetEventSource.Error(digestResponse,
                         "Algorithm not supported: {algorithm}");
  ....
}

Ryujinx

V3138 String literal contains potential interpolated expression. Consider inspecting: keyHash. CacheCollection.cs 524


public void AddValue(ref Hash128 keyHash, byte[] value)
{
    if (IsReadOnly)
    {
        Logger.Warning?.Print(LogClass.Gpu,
            "Trying to add {keyHash} on a read-only cache, ignoring.");
        ....
    }
    ....
}

Similar errors can be found in some other places:

  • V3138 String literal contains potential interpolated expression. Consider inspecting: keyHash. CacheCollection.cs 475

.NET 6 libraries

V3138 String literal contains potential interpolated expression. Consider inspecting: _pressureHigh. PhysicalMemoryMonitor.cs 110


internal void SetLimit(int physicalMemoryLimitPercentage)
{
  if (physicalMemoryLimitPercentage == 0)
  {
    // use defaults
    return;
  }
  _pressureHigh = Math.Max(3, physicalMemoryLimitPercentage);
  _pressureLow = Math.Max(1, _pressureHigh - 9);
  Dbg.Trace($"MemoryCacheStats",
            "PhysicalMemoryMonitor.SetLimit:
              _pressureHigh={_pressureHigh}, _pressureLow={_pressureLow}");
}

.NET 6 libraries

V3138 String literal contains potential interpolated expression. Consider inspecting: spec. MetricsEventSource.cs 381


private void ParseSpecs(string? metricsSpecs)
{
  ....
  string[] specStrings = ....
  foreach (string specString in specStrings)
  {
    if (!MetricSpec.TryParse(specString, out MetricSpec spec))
    {
      Log.Message("Failed to parse metric spec: {specString}");
    }
    else
    {
      Log.Message("Parsed metric: {spec}");
      ....
    }
  }
}

Unity C# reference source code

V3138 String literal contains potential interpolated expression. Consider inspecting: type. OverlayUtilities.cs 116


public static Overlay CreateOverlay(Type type)
{
  ....
  if (overlay == null)
  {
    Debug.LogWarning("Overlay of type {type} can not be instantiated." + ....);
    return null;
  }
  ....
}

Orleans

V3138 String literal contains potential interpolated expression. Consider inspecting: type. ExceptionCodec.cs 367


public Exception DeserializeException<TInput>(....)
{
  if (!_typeConverter.TryParse(typeName, out var type))
  {
    ....
  }
  else if (typeof(Exception).IsAssignableFrom(type))
  {
    ....
  }
  else
  {
    throw new NotSupportedException("Type {type} is not supported");
  }
}

AWS SDK for .NET

V3138 String literal contains potential interpolated expression. Consider inspecting: part. Fn.cs 82


public static object GetAttr(object value, string path)
{
  ....

  var parts = path.Split('.');
  ....

  for (int i = 0; i < parts.Length; i++)
  {
    var part = parts[i];

    ....
    if (!(propertyValue is IList))
      throw
        new ArgumentException("Object addressing by pathing segment '{part}'
                               with indexer must be IList");
    ....

    if (!(propertyValue is IPropertyBag))
      throw
        new ArgumentException("Object addressing by pathing segment '{part}'
                               must be IPropertyBag");
    ....
  }
  ....
}

Similar errors can be found in some other places:

  • V3138 String literal contains potential interpolated expression. Consider inspecting: part. Fn.cs 93

Jellyfin

V3138 String literal contains potential interpolated expression. Consider inspecting: bytesWritten. NetworkUtils.cs 105


public static byte MaskToCidr(IPAddress mask)
{
  ....
  if (!mask.TryWriteBytes(bytes, out var bytesWritten))
  {
    Console.WriteLine("Unable to write address bytes,
                       only ${bytesWritten} bytes written.");
  }
  ....
}

close form

Remplissez le formulaire ci‑dessous en 2 étapes simples :

Vos coordonnées :

Étape 1
Félicitations ! Voici votre code promo !

Type de licence souhaité :

Étape 2
Team license
Enterprise licence
** En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité
close form
Demandez des tarifs
Nouvelle licence
Renouvellement de licence
--Sélectionnez la devise--
USD
EUR
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
La licence PVS‑Studio gratuit pour les spécialistes Microsoft MVP
close form
Pour obtenir la licence de votre projet open source, s’il vous plait rempliez ce formulaire
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
I want to join the test
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
check circle
Votre message a été envoyé.

Nous vous répondrons à


Si l'e-mail n'apparaît pas dans votre boîte de réception, recherchez-le dans l'un des dossiers suivants:

  • Promotion
  • Notifications
  • Spam