metrica
Мы используем куки, чтобы пользоваться сайтом было удобно.
Хорошо
to the top
close form

Заполните форму в два простых шага ниже:

Ваши контактные данные:

Шаг 1
Поздравляем! У вас есть промокод!

Тип желаемой лицензии:

Шаг 2
Team license
Enterprise license
** Нажимая на кнопку, вы даете согласие на обработку
своих персональных данных. См. Политику конфиденциальности
close form
Запросите информацию о ценах
Новая лицензия
Продление лицензии
--Выберите валюту--
USD
EUR
RUB
* Нажимая на кнопку, вы даете согласие на обработку
своих персональных данных. См. Политику конфиденциальности

close form
Бесплатная лицензия PVS‑Studio для специалистов Microsoft MVP
* Нажимая на кнопку, вы даете согласие на обработку
своих персональных данных. См. Политику конфиденциальности

close form
Для получения лицензии для вашего открытого
проекта заполните, пожалуйста, эту форму
* Нажимая на кнопку, вы даете согласие на обработку
своих персональных данных. См. Политику конфиденциальности

close form
Мне интересно попробовать плагин на:
* Нажимая на кнопку, вы даете согласие на обработку
своих персональных данных. См. Политику конфиденциальности

close form
check circle
Ваше сообщение отправлено.

Мы ответим вам на


Если вы так и не получили ответ, пожалуйста, проверьте папку
Spam/Junk и нажмите на письме кнопку "Не спам".
Так Вы не пропустите ответы от нашей команды.

Вебинар: Трудности при интеграции SAST, как с ними справляться - 04.04

>
>
>
Примеры ошибок, обнаруженных с помощью …

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

V3062. An object is used as an argument to its own method. Consider checking the first actual argument of the 'Foo' method.


Accord.Net

V3062 An object 'observations' is used as an argument to its own method. Consider checking the first actual argument of the 'WeightedMean' method. Accord.Statistics InverseGaussianDistribution.cs 325


public static double WeightedMean(this double[] values,
                                       double[] weights)
{
  ....
}

public override void Fit(double[] observations,
                         double[] weights,
                         IFittingOptions options)
{
  ....
  mean = observations.WeightedMean(observations);
  ....
}

AWS SDK for .NET

V3062 An object 'attributeName' is used as an argument to its own method. Consider checking the first actual argument of the 'Contains' method. AWSSDK.MobileAnalytics.Net45 CustomEvent.cs 261


public string GetAttribute(string attributeName)
{
  if(string.IsNullOrEmpty(attributeName))
  {
    throw new ArgumentNullException("attributeName");
  }
  string ret = null;
  lock(_lock)
  {
    if(attributeName.Contains(attributeName))  // <=
      ret = _attributes[attributeName];
  }
  return ret;
}

.NET 7

V3062 An object 'DiagnosticLocation' is used as an argument to its own method. Consider checking the first actual argument of the 'Equals' method. LibraryImportGenerator.cs 43


public bool Equals(IncrementalStubGenerationContext? other)
{
  return    other is not null
         && StubEnvironment.AreCompilationSettingsEqual(Environment,
                                                        other.Environment)
         && SignatureContext.Equals(other.SignatureContext)
         && ContainingSyntaxContext.Equals(other.ContainingSyntaxContext)
         && StubMethodSyntaxTemplate.Equals(other.StubMethodSyntaxTemplate)
         && LibraryImportData.Equals(other.LibraryImportData)
         && DiagnosticLocation.Equals(DiagnosticLocation)     // <=
         && ForwardedAttributes.SequenceEqual(
              other.ForwardedAttributes,
              (IEqualityComparer<AttributeSyntax>)
                SyntaxEquivalentComparer.Instance)
        && GeneratorFactoryKey.Equals(other.GeneratorFactoryKey)
        && Diagnostics.SequenceEqual(other.Diagnostics);
}

Similar errors can be found in some other places:

  • V3062 An object 'DiagnosticLocation' is used as an argument to its own method. Consider checking the first actual argument of the 'Equals' method. JSImportGenerator.cs 42
  • V3062 An object 'DiagnosticLocation' is used as an argument to its own method. Consider checking the first actual argument of the 'Equals' method. JSExportGenerator.cs 37

nopCommerce

V3062 An object 'other' is used as an argument to its own method. Consider checking the first actual argument of the 'Equals' method. ImportManager.cs 3392


public partial class CategoryKey
{
  ....

  public bool Equals(CategoryKey y)
  {
    if (y == null)
      return false;

    if (Category != null && y.Category != null)
      return Category.Id == y.Category.Id;

    if (....)
    {
      return false;
    }

    return Key.Equals(y.Key);
  }

  public override bool Equals(object obj)
  {
    var other = obj as CategoryKey;
    return other?.Equals(other) ?? false;        // <=
  }
}