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

Examples of errors detected by the V3053 diagnostic

V3053. An excessive expression. Examine the substrings "abc" and "abcd".


GitExtensions

V3053 An excessive expression. Examine the substrings 'notepad' and 'notepad++'. GitCommands GitModule.cs 691


public void EditNotes(string revision)
{
  string editor = GetEffectivePathSetting("core.editor")
                  .ToLower();

  if (editor.Contains("gitextensions") ||
      editor.Contains("notepad") ||
      editor.Contains("notepad++")) // <=
  {
    RunGitCmd("notes edit " + revision);
  }
  ....
}

Orchard CMS

V3053 An excessive expression. Examine the substrings ' ' and ' \t'. ExtensionHarvester.cs 335


private static bool IsFeatureFieldDeclaration(string line) {
  if (line.StartsWith("\t\t") ||
      line.StartsWith("\t    ") ||
      line.StartsWith("    ") ||
      line.StartsWith("    \t"))
          return true;

  return false;
}

SharpDevelop

V3053 An excessive expression. Examine the substrings '/debug' and '/debugport'. NDebugger.cs 287


public bool IsKernelDebuggerEnabled {
  get {
    ....
    if (systemStartOptions.Contains("/debug") ||
     systemStartOptions.Contains("/crashdebug") ||
     systemStartOptions.Contains("/debugport") ||
     systemStartOptions.Contains("/baudrate")) {
      return true;
    }
    ....
  }
}

PascalABC.NET

V3053 An excessive expression. Examine the substrings 'reduction' and 'reduction('. TreeConverter OpenMP.cs 267


private void ProcessClauses(string Text, ....)
{
  ....
  if (....)
  {
    ....
  }
  else if (AllowReduction &&
           (Text.StartsWith("reduction") ||
            Text.StartsWith("reduction(")))
  {
    ....
  }
  ....
}

Unity C# reference source code

V3053 An excessive expression. Examine the substrings 'UnityEngine.' and 'UnityEngine.SetupCoroutine'. StackTrace.cs 43


static bool IsSystemStacktraceType(object name)
{
  string casted = (string)name;
  return casted.StartsWith("UnityEditor.") ||
    casted.StartsWith("UnityEngine.") ||
    casted.StartsWith("System.") ||
    casted.StartsWith("UnityScript.Lang.") ||
    casted.StartsWith("Boo.Lang.") ||
    casted.StartsWith("UnityEngine.SetupCoroutine");
}

Unity C# reference source code

V3053 An excessive expression. Examine the substrings 'Windows.dll' and 'Windows.'. AssemblyHelper.cs 84


static private bool CouldBelongToDotNetOrWindowsRuntime(string
  assemblyPath)
{
  return assemblyPath.IndexOf("mscorlib.dll") != -1 ||
    assemblyPath.IndexOf("System.") != -1 ||
    assemblyPath.IndexOf("Windows.dll") != -1 ||  // <=
    assemblyPath.IndexOf("Microsoft.") != -1 ||
    assemblyPath.IndexOf("Windows.") != -1 ||  // <=
    assemblyPath.IndexOf("WinRTLegacy.dll") != -1 ||
    assemblyPath.IndexOf("platform.dll") != -1;
}

Azure SDK for .NET

V3053 An excessive expression. Examine the substrings 'IList' and 'List'. PropertyData.cs 157


public class PropertyData
{
  ....
  public bool IsTypeCollection => this.Type.Contains("IList") ||
                                  this.Type.Contains("IEnumerable") ||
                                  this.Type.Contains("List") ||         // <=
                                  this.Type.Contains("IReadOnlyList");  // <=
}

Similar errors can be found in some other places:

  • V3053 An excessive expression. Examine the substrings 'List' and 'IReadOnlyList'. PropertyData.cs 158

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