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

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

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

V3031. An excessive check can be simplified. The operator '||' operator is surrounded by opposite expressions 'x' and '!x'.


SharpDevelop

V3031 An excessive check can be simplified. The '||' operator is surrounded by opposite expressions. DockablePane.cs 549


internal override ManagedContent RemoveContent(int index)
{
  ....
  if (((dockableContent == null)
      || (dockableContent != null &&
          dockableContent.SavedStateAndPosition == null)
      || (dockableContent != null &&
          dockableContent.SavedStateAndPosition.ContainerPane
          != this))
      && Items.Count == 0)
  ....
}

There is no error here, but the code can be simplified. "dockableContent != null" checks are not necessary here.


Xamarin.Forms

V3031 An excessive check can be simplified. The '||' operator is surrounded by opposite expressions. Xamarin.Forms.Platform.iOS.Classic ContextActionCell.cs 102


public override void LayoutSubviews()
{
  ....
  if (_scroller == null || (_scroller != null &&
                            _scroller.Frame == Bounds))
    return;
  ....
}

There is no error here, but the code can be simplified.


FlashDevelop

V3031 An excessive check can be simplified. The '||' operator is surrounded by opposite expressions. DockContentHandler.cs 540


internal void SetDockState(....)
{
  ....
  if ((Pane != oldPane) || (Pane == oldPane
    && oldDockState != oldPane.DockState))
  {
    RefreshDockPane(Pane);
  }
  ....
}

There is no error here, however, the conditions Pane != oldPane and Pane == oldPane are mutually exclusive, so this expression can be simplified


Mono

V3031 An excessive check can be simplified. The '||' operator is surrounded by opposite expressions. mcs-net_4_x ILGenerator.cs 456


public void Emit(OpCode opc)
{
  Debug.Assert(opc != OpCodes.Ret || (
               opc == OpCodes.Ret && stackHeight <= 1));
  ....
}

There is no error here, but the code can be simplified.


Mono

V3031 An excessive check can be simplified. The '||' operator is surrounded by opposite expressions. System.Windows.Forms-net_4_x ContainerControl.cs 506


public bool Validate (bool checkAutoValidate)
{
  if ((checkAutoValidate &&
      (AutoValidate != AutoValidate.Disable)) ||
      !checkAutoValidate)
    return Validate ();

  return true;
}

There is no error here, but the code can be simplified.


Orchard CMS

V3031 An excessive check can be simplified. The '||' operator is surrounded by opposite expressions '!ssl' and 'ssl && CdnSupportsSsl'. ResourceDefinition.cs 190


public string ResolveUrl(....) {
  ....
  if (!ssl || (ssl && CdnSupportsSsl)) {
    ....
  }
}

Telerik UI for UWP

V3031 An excessive check can be simplified. The '||' operator is surrounded by opposite expressions. SelectedItemCollection.cs 77


private bool CanInsertItem(object item)
{
  return    this.suspendLevel == 0
         && this.AllowSelect
         && ((!this.AllowMultipleSelect && this.Count == 0)
             || this.AllowMultipleSelect);
}

There is no error here, but the code can be simplified.

Similar errors can be found in some other places:

  • V3031 An excessive check can be simplified. The '||' operator is surrounded by opposite expressions. SelectedItemCollection.cs 93
  • V3031 An excessive check can be simplified. The '||' operator is surrounded by opposite expressions. StackVirtualizationStrategy.cs 49
  • V3031 An excessive check can be simplified. The '||' operator is surrounded by opposite expressions 'state == null' and 'state != null'. LocalFieldDescriptionsProviderBase.cs 24

RunUO

V3031 An excessive check can be simplified. The '||' operator is surrounded by opposite expressions 'bPlayerOnly' and '!bPlayerOnly'. BaseCreature.cs 3005


public virtual double GetFightModeRanking( Mobile m,
                                           FightMode acqType,
                                           bool bPlayerOnly )
{
  if ( ( bPlayerOnly && m.Player ) ||  !bPlayerOnly )
  {
    ....
  }
  ....
}

RunUO

V3031 An excessive check can be simplified. The '||' operator is surrounded by opposite expressions 'pack == null' and 'pack != null'. BODBuyGump.cs 64


public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
{
  ....
  if ( (pack == null) ||
       ((pack != null) &&
        (!pack.CheckHold(
                m_From,
                item,
                true,
                true,
                0,
                item.PileWeight + item.TotalWeight)) ) )
  {
    pv.SayTo(m_From, 503204);
    m_From.SendGump(new BOBGump(m_From, m_Book, m_Page, null));
  }
  ....
}