Примеры ошибок, обнаруженных с помощью диагностики V3117


V3117. Constructor parameter is not used.


PowerShell

V3117 Constructor parameter 'errorCategory_Message' is not used. System.Management.Automation ErrorPackage.cs 1125


private void PopulateProperties(
  Exception exception,
  object targetObject,
  string fullyQualifiedErrorId,
  ErrorCategory errorCategory,
  string errorCategory_Activity,
  string errorCategory_Reason,
  string errorCategory_TargetName,
  string errorCategory_TargetType,
  string errorCategory_Message,
  string errorDetails_Message,
  string errorDetails_RecommendedAction,
  string errorDetails_ScriptStackTrace)
{ .... }

internal ErrorRecord(
  Exception exception,
  object targetObject,
  string fullyQualifiedErrorId,
  ErrorCategory errorCategory,
  string errorCategory_Activity,
  string errorCategory_Reason,
  string errorCategory_TargetName,
  string errorCategory_TargetType,
  string errorCategory_Message,
  string errorDetails_Message,
  string errorDetails_RecommendedAction)
{
  PopulateProperties(
    exception,
    targetObject,
    fullyQualifiedErrorId,
    errorCategory,
    errorCategory_Activity,
    errorCategory_Reason,
    errorCategory_TargetName,
    errorCategory_TargetType,
    errorDetails_Message,            // <=
    errorDetails_Message,            // <=
    errorDetails_RecommendedAction,
    null);
}

Infer.NET

V3117 Constructor parameter 'useLazyQuantifier' is not used. Runtime RegexpFormattingSettings.cs 38


public RegexpFormattingSettings(
         bool putOptionalInSquareBrackets,
         bool showAnyElementAsQuestionMark,
         bool ignoreElementDistributionDetails,
         int truncationLength,
         bool escapeCharacters,
         bool useLazyQuantifier)
{
  this.PutOptionalInSquareBrackets = putOptionalInSquareBrackets;
  this.ShowAnyElementAsQuestionMark = showAnyElementAsQuestionMark;
  this.IgnoreElementDistributionDetails = ignoreElementDistributionDetails;
  this.TruncationLength = truncationLength;
  this.EscapeCharacters = escapeCharacters;
}

FastReport

V3117 Constructor parameter 'iniCapacity' is not used. FastString.cs 434


public FastString(int iniCapacity)
{
  Init(initCapacity);
}

.NET Core Libraries (CoreFX)

V3117 Constructor parameter 'securityUrl' is not used. XmlSecureResolver.cs 15


public XmlSecureResolver(XmlResolver resolver, string securityUrl)
{
  _resolver = resolver;
}

.NET Core Libraries (CoreFX)

V3117 Constructor parameter 'checkSecurity' is not used. ObjectManager.cs 33


internal ObjectManager(
  ISurrogateSelector selector,
  StreamingContext context,
  bool checkSecurity,
  bool isCrossAppDomain)
{
  _objects = new ObjectHolder[DefaultInitialSize];
  _selector = selector;
  _context = context;
  _isCrossAppDomain = isCrossAppDomain;
}

.NET Core Libraries (CoreFX)

V3117 Constructor parameter 'userOptions' is not used. DbConnectionPool.cs 26


private sealed class PendingGetConnection
{
  public PendingGetConnection(
           long dueTime,
           DbConnection owner,
           TaskCompletionSource<DbConnectionInternal> completion,
           DbConnectionOptions userOptions)
  {
    DueTime = dueTime;
    Owner = owner;
    Completion = completion;
  }

  public long DueTime { get; private set; }
  public DbConnection Owner { get; private set; }
  public TaskCompletionSource<DbConnectionInternal>
           Completion { get; private set; }
  public DbConnectionOptions UserOptions { get; private set; }
}


Найденные ошибки

Проверено проектов
346
Собрано ошибок
13 188

А ты совершаешь ошибки в коде?

Проверь с помощью
PVS-Studio

Статический анализ
кода для C, C++, C#
и Java

goto PVS-Studio;