Pour obtenir une clé
d'essai remplissez le formulaire ci-dessous
Demandez des tariffs
Nouvelle licence
Renouvellement de licence
--Sélectionnez la devise--
USD
EUR
RUB
* En cliquant sur ce bouton, vous acceptez notre politique de confidentialité

Free PVS-Studio license for Microsoft MVP specialists
To get the licence for your open-source project, please fill out this form
** En cliquant sur ce bouton, vous acceptez notre politique de confidentialité.

I am interested to try it on the platforms:
** En cliquant sur ce bouton, vous acceptez notre politique de confidentialité.

Votre message a été envoyé.

Nous vous répondrons à


Si vous n'avez toujours pas reçu de réponse, vérifiez votre dossier
Spam/Junk et cliquez sur le bouton "Not Spam".
De cette façon, vous ne manquerez la réponse de notre équipe.

>
>
>
Examples of errors detected by the V303…

Examples of errors detected by the V3038 diagnostic

V3038. The argument was passed to method several times. It is possible that another argument should be passed instead.


SharpDevelop

V3038 The first argument of 'Replace' function is equal to the second argument. ReflectionDisassembler.cs 349


void
WriteSecurityDeclarationArgument(CustomAttributeNamedArgument na)
{
  ....
  output.Write("string('{0}')",
    NRefactory.CSharp.TextWriterTokenWriter.
    ConvertString((string)na.Argument.Value).Replace("'", "\'"));
  ....
}

Correct version: Replace("'", "\\'") There is exactly the same bug in the 'Xamarin.Forms' project.


Xamarin.Forms

V3038 The first argument of 'Replace' function is equal to the second argument. ICSharpCode.Decompiler ReflectionDisassembler.cs 349


void WriteSecurityDeclarationArgument(
         CustomAttributeNamedArgument na)
{
  ....
  output.Write("string('{0}')",
    NRefactory.CSharp
              .TextWriterTokenWriter
              .ConvertString(
                (string)na.Argument.Value).Replace("'", "\'"));
  ....
}

There is exactly the same bug in the 'SharpDevelop' project.


PascalABC.NET

V3038 The 'enum_consts[i]' argument was passed to 'Compare' method several times. It is possible that other argument should be passed instead. CodeCompletion SymTable.cs 2206


private List<string> enum_consts = new List<string>();
public override bool IsEqual(SymScope ts)
{
  EnumScope es = ts as EnumScope;
  if (es == null) return false;
  if (enum_consts.Count != es.enum_consts.Count) return false;
  for (int i = 0; i < es.enum_consts.Count; i++)
    if (string.Compare(enum_consts[i],
                       this.enum_consts[i], true) != 0)  // <=
      return false;
  return true;
}

OpenCvSharp

V3038 The argument was passed to method several times. It is possible that other argument should be passed instead. Cv2_photo.cs 124


public static void FastNlMeansDenoisingMulti(....)
{
  ....
  NativeMethods.photo_fastNlMeansDenoisingMulti(
    srcImgPtrs,
    srcImgPtrs.Length,
    dst.CvPtr,
    imgToDenoiseIndex,
    templateWindowSize,
    h,
    templateWindowSize,
    searchWindowSize);
  ....
}

public static extern void photo_fastNlMeansDenoisingMulti(
  IntPtr[] srcImgs,
  int srcImgsLength,
  IntPtr dst,
  int imgToDenoiseIndex,
  int temporalWindowSize,
  float h,
  int templateWindowSize,
  int searchWindowSize)

Similar errors can be found in some other places:

  • V3038 The argument was passed to method several times. It is possible that other argument should be passed instead. Cv2_photo.cs 149
  • V3038 The argument was passed to method several times. It is possible that other argument should be passed instead. Cv2_photo.cs 180
  • V3038 The argument was passed to method several times. It is possible that other argument should be passed instead. Cv2_photo.cs 205

ONLYOFFICE Community Server

V3038 The '"yy"' argument was passed to 'Replace' method several times. It is possible that other argument should be passed instead. MasterLocalizationResources.cs 38


private static string GetDatepikerDateFormat(string s)
{
    return s
        .Replace("yyyy", "yy")
        .Replace("yy", "yy")   // <=
        .Replace("MMMM", "MM")
        .Replace("MMM", "M")
        .Replace("MM", "mm")
        .Replace("M", "mm")
        .Replace("dddd", "DD")
        .Replace("ddd", "D")
        .Replace("dd", "11")
        .Replace("d", "dd")
        .Replace("11", "dd")
        .Replace("'", "")
        ;
}

ILSpy

V3038 The '"'"' argument was passed to 'Replace' method several times. It is possible that other argument should be passed instead. ICSharpCode.Decompiler ReflectionDisassembler.cs 772


private static void WriteSimpleValue(ITextOutput output,
                                     object value, string typeName)
{
  switch (typeName)
  {
    case "string":
      output.Write(  "'"
                   + DisassemblerHelpers
                      .EscapeString(value.ToString())
                      .Replace("'", "\'")                   // <=
                   + "'");
      break;
    case "type":
    ....
  }
  ....
}

Unicorn with delicious cookie
Nous utilisons des cookies pour améliorer votre expérience de navigation. En savoir plus
Accepter