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


V6014. It's odd that this function always returns one and the same value of NN.


CUBA Platform

V6014 It's odd that this method always returns one and the same value. DefaultExceptionHandler.java(40)


@Override
public boolean handle(ErrorEvent event, App app) {
  Throwable t = event.getThrowable();
  if (t instanceof SocketException
      || ExceptionUtils.getRootCause(t) instanceof SocketException) {
    return true;
  }
  if (ExceptionUtils.getThrowableList(t).stream()
      .anyMatch(o -> o.getClass().getName().equals("...."))) {
    return true;
  }
  if (StringUtils.contains(ExceptionUtils.getMessage(t), "....")) {
    return true;
  }
  AppUI ui = AppUI.getCurrent();
  if (ui == null) {
    return true;
  }
  if (t != null) {
    if (app.getConnection().getSession() != null) {
      showDialog(app, t);
    } else {
      showNotification(app, t);
    }
  }
  return true;
}

Similar errors can be found in some other places:

  • V6014 It's odd that this method always returns one and the same value. ErrorNodesFinder.java(31)
  • V6014 It's odd that this method always returns one and the same value. FileDownloadController.java(69)
  • V6014 It's odd that this method always returns one and the same value. IdVarSelector.java(73)
  • And 4 additional diagnostic messages.


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

Проверено проектов
367
Собрано ошибок
13 552

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

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

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

goto PVS-Studio;